mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] infiniband: nes: return value of skb_linearize should be handled
@ 2016-12-07  7:30 Zhouyi Zhou
  2016-12-14 19:29 ` Doug Ledford
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2016-12-07  7:30 UTC (permalink / raw)
  To: faisal.latif, dledford, sean.hefty, hal.rosenstock, eric.dumazet,
	linux-rdma, linux-kernel
  Cc: Zhouyi Zhou, Zhouyi Zhou

Return value of skb_linearize should be handled in function 
nes_netdev_start_xmit.

Compiled in x86_64
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> 
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>

---
 drivers/infiniband/hw/nes/nes_nic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 2b27d13..dfd1f57 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -662,10 +662,14 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 				nesnic->sq_head &= nesnic->sq_size-1;
 			}
 		} else {
-			nesvnic->linearized_skbs++;
 			hoffset = skb_transport_header(skb) - skb->data;
 			nhoffset = skb_network_header(skb) - skb->data;
-			skb_linearize(skb);
+			if (skb_linearize(skb)) {
+				nesvnic->tx_sw_dropped++;
+				kfree_skb(skb);
+				return NETDEV_TX_OK;
+			}
+			nesvnic->linearized_skbs++;
 			skb_set_transport_header(skb, hoffset);
 			skb_set_network_header(skb, nhoffset);
 			if (!nes_nic_send(skb, netdev))
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] infiniband: nes: return value of skb_linearize should be handled
  2016-12-07  7:30 [PATCH 1/1] infiniband: nes: return value of skb_linearize should be handled Zhouyi Zhou
@ 2016-12-14 19:29 ` Doug Ledford
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2016-12-14 19:29 UTC (permalink / raw)
  To: Zhouyi Zhou, faisal.latif, sean.hefty, hal.rosenstock,
	eric.dumazet, linux-rdma, linux-kernel
  Cc: Zhouyi Zhou


[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]

On 12/7/2016 2:30 AM, Zhouyi Zhou wrote:
> Return value of skb_linearize should be handled in function 
> nes_netdev_start_xmit.
> 
> Compiled in x86_64
> Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com> 
> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks.

-- 
Doug Ledford <dledford@redhat.com>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-14 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07  7:30 [PATCH 1/1] infiniband: nes: return value of skb_linearize should be handled Zhouyi Zhou
2016-12-14 19:29 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome