* [PATCH] cxgb4: add missing release on skb in uld_send()
@ 2020-07-18 5:18 Navid Emamdoost
2020-07-21 1:31 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Navid Emamdoost @ 2020-07-18 5:18 UTC (permalink / raw
To: Vishal Kulkarni, David S. Miller, Jakub Kicinski, netdev,
linux-kernel
Cc: emamd001, Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all
execution paths except one. Release skb when returning NET_XMIT_DROP.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 32a45dc51ed7..d8c37fd4b808 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
txq_info = adap->sge.uld_txq_info[tx_uld_type];
if (unlikely(!txq_info)) {
WARN_ON(true);
+ consume_skb(skb);
return NET_XMIT_DROP;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] cxgb4: add missing release on skb in uld_send()
2020-07-18 5:18 [PATCH] cxgb4: add missing release on skb in uld_send() Navid Emamdoost
@ 2020-07-21 1:31 ` David Miller
2020-07-22 18:57 ` [PATCH v2] " Navid Emamdoost
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2020-07-21 1:31 UTC (permalink / raw
To: navid.emamdoost; +Cc: vishal, kuba, netdev, linux-kernel, emamd001
From: Navid Emamdoost <navid.emamdoost@gmail.com>
Date: Sat, 18 Jul 2020 00:18:43 -0500
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
> index 32a45dc51ed7..d8c37fd4b808 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
> @@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
> txq_info = adap->sge.uld_txq_info[tx_uld_type];
> if (unlikely(!txq_info)) {
> WARN_ON(true);
> + consume_skb(skb);
> return NET_XMIT_DROP;
> }
>
This is a packet drop so kfree_skb() is more appropriate here.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] cxgb4: add missing release on skb in uld_send()
2020-07-21 1:31 ` David Miller
@ 2020-07-22 18:57 ` Navid Emamdoost
2020-07-23 1:14 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Navid Emamdoost @ 2020-07-22 18:57 UTC (permalink / raw
To: Vishal Kulkarni, David S. Miller, Jakub Kicinski, netdev,
linux-kernel
Cc: emamd001, Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all
execution paths except one. Release skb when returning NET_XMIT_DROP.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
changes in v2:
- using kfree_skb() based on David Miller suggestion.
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index d8c37fd4b808..92eee66cbc84 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2938,7 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
txq_info = adap->sge.uld_txq_info[tx_uld_type];
if (unlikely(!txq_info)) {
WARN_ON(true);
- consume_skb(skb);
+ kfree_skb(skb);
return NET_XMIT_DROP;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] cxgb4: add missing release on skb in uld_send()
2020-07-22 18:57 ` [PATCH v2] " Navid Emamdoost
@ 2020-07-23 1:14 ` David Miller
2020-07-23 2:58 ` [PATCH v3] " Navid Emamdoost
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2020-07-23 1:14 UTC (permalink / raw
To: navid.emamdoost; +Cc: vishal, kuba, netdev, linux-kernel, emamd001
From: Navid Emamdoost <navid.emamdoost@gmail.com>
Date: Wed, 22 Jul 2020 13:57:21 -0500
> In the implementation of uld_send(), the skb is consumed on all
> execution paths except one. Release skb when returning NET_XMIT_DROP.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> changes in v2:
> - using kfree_skb() based on David Miller suggestion.
This doesn't apply to any of my networking GIT trees.
Please base this on either 'net' or 'net-next' as appropriate,
and indicate this in your Subject line f.e. "[PATCH net v2] ..."
Thank you.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3] cxgb4: add missing release on skb in uld_send()
2020-07-23 1:14 ` David Miller
@ 2020-07-23 2:58 ` Navid Emamdoost
2020-07-23 3:09 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Navid Emamdoost @ 2020-07-23 2:58 UTC (permalink / raw
To: Vishal Kulkarni, David S. Miller, Jakub Kicinski, netdev,
linux-kernel
Cc: emamd001, Navid Emamdoost
In the implementation of uld_send(), the skb is consumed on all
execution paths except one. Release skb when returning NET_XMIT_DROP.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
v3:
- fixed the base problem, and used kfree_skb
---
drivers/net/ethernet/chelsio/cxgb4/sge.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 32a45dc51ed7..92eee66cbc84 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
txq_info = adap->sge.uld_txq_info[tx_uld_type];
if (unlikely(!txq_info)) {
WARN_ON(true);
+ kfree_skb(skb);
return NET_XMIT_DROP;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cxgb4: add missing release on skb in uld_send()
2020-07-23 2:58 ` [PATCH v3] " Navid Emamdoost
@ 2020-07-23 3:09 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-07-23 3:09 UTC (permalink / raw
To: navid.emamdoost; +Cc: vishal, kuba, netdev, linux-kernel, emamd001
From: Navid Emamdoost <navid.emamdoost@gmail.com>
Date: Wed, 22 Jul 2020 21:58:39 -0500
> In the implementation of uld_send(), the skb is consumed on all
> execution paths except one. Release skb when returning NET_XMIT_DROP.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-07-23 3:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-18 5:18 [PATCH] cxgb4: add missing release on skb in uld_send() Navid Emamdoost
2020-07-21 1:31 ` David Miller
2020-07-22 18:57 ` [PATCH v2] " Navid Emamdoost
2020-07-23 1:14 ` David Miller
2020-07-23 2:58 ` [PATCH v3] " Navid Emamdoost
2020-07-23 3:09 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.