Thread (6 messages) flat view 6 messages, 4 authors, 2016-12-07

Re: [PATCH] net: return value of skb_linearize should be handled in Linux kernel

From: Eric Dumazet <hidden>
Date: 2016-12-07 06:51:29
Also in: intel-wired-lan, linux-rdma, linux-scsi, lkml

On Tue, 2016-12-06 at 15:10 +0800, Zhouyi Zhou wrote:
quoted hunk ↗ jump to hunk
kmalloc_reserve may fail to allocate memory inside skb_linearize, 
which means skb_linearize's return value should not be ignored. 
Following patch correct the uses of skb_linearize.

Compiled in x86_64

Signed-off-by: Zhouyi Zhou <redacted>
---
 drivers/infiniband/hw/nes/nes_nic.c           | 5 +++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 6 +++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 +--
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c             | 7 +++++--
 drivers/scsi/fcoe/fcoe.c                      | 5 ++++-
 net/tipc/link.c                               | 3 ++-
 net/tipc/name_distr.c                         | 5 ++++-
 7 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 2b27d13..69372ea 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -662,10 +662,11 @@ 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))
+				return NETDEV_TX_BUSY;
This would live lock.

Please drop the packet.

You probably should send one patch per driver, to ease code review and
acceptance.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help