All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [net-next PATCH v4 1/2] ixgbe: add XDP support for pass and drop actions
Date: Fri, 10 Mar 2017 21:39:33 -0800	[thread overview]
Message-ID: <58C38D95.5010000@gmail.com> (raw)
In-Reply-To: <CAKgT0UfUideLMR-8j-RUDee+fMbAsNw=7HdPTk=L3Q8Kc8gxQQ@mail.gmail.com>

On 17-03-10 12:38 PM, Alexander Duyck wrote:
> On Fri, Mar 10, 2017 at 11:11 AM, John Fastabend
> <john.fastabend@gmail.com> wrote:
>> Basic XDP drop support for ixgbe. Uses READ_ONCE/xchg semantics on XDP
>> programs instead of rcu primitives as suggested by Daniel Borkmann and
>> Alex Duyck.
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> 
> Two minor cosmetic complaints below.  However the patch looks good to
> me.  Feel free to add this to both patches for the next revision.
> 
> Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
> 


[...]

>>         /* allocate a skb to store the frags */
>> @@ -2097,7 +2108,7 @@ static struct sk_buff *ixgbe_construct_skb(struct ixgbe_ring *rx_ring,
>>                         IXGBE_CB(skb)->dma = rx_buffer->dma;
>>
>>                 skb_add_rx_frag(skb, 0, rx_buffer->page,
>> -                               rx_buffer->page_offset,
>> +                               xdp->data - page_address(rx_buffer->page),
>>                                 size, truesize);
>>  #if (PAGE_SIZE < 8192)
>>                 rx_buffer->page_offset ^= truesize;
>> @@ -2105,7 +2116,8 @@ static struct sk_buff *ixgbe_construct_skb(struct ixgbe_ring *rx_ring,
>>                 rx_buffer->page_offset += truesize;
>>  #endif
>>         } else {
>> -               memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
>> +               memcpy(__skb_put(skb, size),
>> +                      xdp->data, ALIGN(size, sizeof(long)));
> 
> I'm not sure what happened here.  Is this line over 80 characters?  If
> not it probably doesn't need to be wrapped.  If it is then you might
> want to fix the line wrapping up since it doesn't look right.
> 

It is over 80 lines. What is your issue with the line wrapping?

>>                 rx_buffer->pagecnt_bias++;
>>         }
>>

[...]

>>  /**
>>   * ixgbe_clean_rx_irq - Clean completed descriptors from Rx ring - bounce buf
>>   * @q_vector: structure containing interrupt and ring information
>> @@ -2184,6 +2230,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
>>                 union ixgbe_adv_rx_desc *rx_desc;
>>                 struct ixgbe_rx_buffer *rx_buffer;
>>                 struct sk_buff *skb;
>> +               struct xdp_buff xdp;
>>                 unsigned int size;
>>
>>                 /* return some buffers to hardware, one at a time is too slow */
>> @@ -2205,15 +2252,29 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
>>
>>                 rx_buffer = ixgbe_get_rx_buffer(rx_ring, rx_desc, &skb, size);
>>
>> -               /* retrieve a buffer from the ring */
> 
> You can probably leave this comment here.  That is my preference anyway.
> 

Sure.

Thanks,
John


  reply	other threads:[~2017-03-11  5:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 19:11 [Intel-wired-lan] [net-next PATCH v4 1/2] ixgbe: add XDP support for pass and drop actions John Fastabend
2017-03-10 19:12 ` [Intel-wired-lan] [net-next PATCH v4 2/2] ixgbe: add support for XDP_TX action John Fastabend
2017-03-10 20:38 ` [Intel-wired-lan] [net-next PATCH v4 1/2] ixgbe: add XDP support for pass and drop actions Alexander Duyck
2017-03-11  5:39   ` John Fastabend [this message]
2017-03-11 15:49 ` William Tu
2017-03-11 16:48   ` John Fastabend
2017-03-11 20:05     ` William Tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58C38D95.5010000@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.