From: John Fastabend <john.fastabend@gmail.com>
To: Or Gerlitz <gerlitz.or@gmail.com>
Cc: Brenden Blanco <bblanco@plumgrid.com>,
David Miller <davem@davemloft.net>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
John Fastabend <john.r.fastabend@intel.com>,
Linux Netdev List <netdev@vger.kernel.org>,
Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: [net-next PATCH] e1000: add initial XDP support
Date: Sun, 28 Aug 2016 22:33:56 -0700 [thread overview]
Message-ID: <57C3C944.2050902@gmail.com> (raw)
In-Reply-To: <CAJ3xEMh_oXucmESb3w9Mevnu7Pb+zHkozF=WqxoWMY3FijTnDg@mail.gmail.com>
On 16-08-27 10:55 PM, Or Gerlitz wrote:
> On Sat, Aug 27, 2016 at 10:11 AM, John Fastabend
> <john.fastabend@gmail.com> wrote:
>> From: Alexei Starovoitov <ast@fb.com>
>
>> This patch adds initial support for XDP on e1000 driver. Note e1000
>> driver does not support page recycling in general which could be
>> added as a further improvement. However for XDP_DROP and XDP_XMIT
>> the xdp code paths will recycle pages.
>
>> @@ -4188,15 +4305,57 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
>> prefetch(next_rxd);
>>
>> next_buffer = &rx_ring->buffer_info[i];
>> -
>
> nit, better to avoid random cleanups in a patch adding new (&& cool)
> functionality
>
Yep thanks.
[...]
>> + case XDP_TX:
>> + dma_sync_single_for_device(&pdev->dev,
>> + dma,
>> + length,
>> + DMA_TO_DEVICE);
>> + e1000_xmit_raw_frame(buffer_info, length,
>> + netdev, adapter);
>> + /* Fallthrough to re-use mappedg page after xmit */
>
> Did you want to say "mapped"? wasn't sure what's the role of "g" @ the end
Yep but see below...
>
>> + case XDP_DROP:
>> + default:
>> + /* re-use mapped page. keep buffer_info->dma
>> + * as-is, so that e1000_alloc_jumbo_rx_buffers
>> + * only needs to put it back into rx ring
>> + */
>
> if we're on the XDP_TX pass, don't we need to actually see that frame
> has been xmitted
> before re using the page?
>
Agreed this seems to be too ambitious in the XDP_TX case. Thanks for
the help. Unless Alexei has some reason why it works I'll go ahead and
consume the buffer here.
I think setting
+ bi->rxbuf.page = NULL;
at the end of the XDP_TX case should fix it but I'll test it again,
Thanks again I guess this is what I get for trying to push patches out
on Friday night.
>> + total_rx_bytes += length;
>> + total_rx_packets++;
>> + goto next_desc;
>> + }
>> + }
>> +
>> dma_unmap_page(&pdev->dev, buffer_info->dma,
>> adapter->rx_buffer_len, DMA_FROM_DEVICE);
>> buffer_info->dma = 0;
next prev parent reply other threads:[~2016-08-29 5:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-27 7:11 [net-next PATCH] e1000: add initial XDP support John Fastabend
2016-08-28 5:55 ` Or Gerlitz
2016-08-29 5:33 ` John Fastabend [this message]
2016-08-28 12:23 ` Jamal Hadi Salim
2016-08-29 8:30 ` Jesper Dangaard Brouer
2016-08-29 10:53 ` Jamal Hadi Salim
2016-08-29 13:39 ` Jesper Dangaard Brouer
2016-08-29 15:55 ` Jesper Dangaard Brouer
2016-08-30 12:13 ` Jamal Hadi Salim
2016-08-30 13:31 ` Jesper Dangaard Brouer
2016-09-01 21:35 ` John Fastabend
2016-09-01 19:33 ` John Fastabend
2016-08-28 15:56 ` William Tu
2016-08-29 5:36 ` John Fastabend
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=57C3C944.2050902@gmail.com \
--to=john.fastabend@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bblanco@plumgrid.com \
--cc=davem@davemloft.net \
--cc=gerlitz.or@gmail.com \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).