Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1537523

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

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] net: return value of skb_linearize should be handled in Linux kernel
Date 2016-12-07 08:00 +0100
Message-ID <sLEmS-4W7-1@gated-at.bofh.it> (permalink)
References <sLicG-7oX-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2016-12-06 at 15:10 +0800, Zhouyi Zhou wrote:
> 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 <zhouzhouyi@gmail.com>
> ---
>  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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] net: return value of skb_linearize should be handled in Linux kernel Zhouyi Zhou <zhouzhouyi@gmail.com> - 2016-12-06 08:20 +0100
  Re: [PATCH] net: return value of skb_linearize should be handled in  Linux kernel Yuval Shaia <yuval.shaia@oracle.com> - 2016-12-06 18:00 +0100
  Re: [PATCH] net: return value of skb_linearize should be handled in  Linux kernel Cong Wang <xiyou.wangcong@gmail.com> - 2016-12-07 06:10 +0100
    Re: [PATCH] net: return value of skb_linearize should be handled in  Linux kernel Zhouyi Zhou <zhouzhouyi@gmail.com> - 2016-12-07 07:30 +0100
      Re: [PATCH] net: return value of skb_linearize should be handled in  Linux kernel Cong Wang <xiyou.wangcong@gmail.com> - 2016-12-07 19:00 +0100
  Re: [PATCH] net: return value of skb_linearize should be handled in  Linux kernel Eric Dumazet <eric.dumazet@gmail.com> - 2016-12-07 08:00 +0100

csiph-web