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


Groups > linux.kernel > #1537962

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

From Cong Wang <xiyou.wangcong@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] net: return value of skb_linearize should be handled in Linux kernel
Date 2016-12-07 19:00 +0100
Message-ID <sLOFA-3bg-15@gated-at.bofh.it> (permalink)
References <sLicG-7oX-19@gated-at.bofh.it> <sLCEq-40h-3@gated-at.bofh.it> <sLDTP-4MF-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 6, 2016 at 10:27 PM, Zhouyi Zhou <zhouzhouyi@gmail.com> wrote:
> On Wed, Dec 7, 2016 at 1:02 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Mon, Dec 5, 2016 at 11:10 PM, Zhouyi Zhou <zhouzhouyi@gmail.com> wrote:
>>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>>> index 2a653ec..ab787cb 100644
>>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
>>> @@ -490,7 +490,11 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
>>>          */
>>>         if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
>>>             (fctl & FC_FC_END_SEQ)) {
>>> -               skb_linearize(skb);
>>> +               int err = 0;
>>> +
>>> +               err = skb_linearize(skb);
>>> +               if (err)
>>> +                       return err;
>>
>>
>> You can reuse 'rc' instead of adding 'err'.
> rc here is meaningful for the length of data being ddped. If using rc
> here, a successful
> skb_linearize will assign rc to 0.

Right, I thought it returns 0 on success.


>>
>>
>>
>>>                 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc));
>>>                 crc->fcoe_eof = FC_EOF_T;
>>>         }
>>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>>> index fee1f29..4926d48 100644
>>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>>> @@ -2173,8 +2173,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
>>>                                 total_rx_bytes += ddp_bytes;
>>>                                 total_rx_packets += DIV_ROUND_UP(ddp_bytes,
>>>                                                                  mss);
>>> -                       }
>>> -                       if (!ddp_bytes) {
>>> +                       } else {
>>>                                 dev_kfree_skb_any(skb);
>>>                                 continue;
>>>                         }
>>
>>
>> This piece doesn't seem to be related.
> if ddp_bytes is negative there will be some error, I think the skb
> should not pass to upper layer.

You misunderstand my point, this return value is for ixgbe_fcoe_ddp()
not skb_linearize(), you need to make it a separate patch because this
patch, as in $subject, only fixes skb_linearize().

Back to linux.kernel | Previous | NextPrevious in thread | Next 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