From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Wei Fang <wei.fang@nxp.com>,
Jesper Dangaard Brouer <hawk@kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
Shenwei Wang <shenwei.wang@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
"larysa.zaremba@intel.com" <larysa.zaremba@intel.com>,
"aleksander.lobakin@intel.com" <aleksander.lobakin@intel.com>,
"jbrouer@redhat.com" <jbrouer@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH V5 net-next 1/2] net: fec: add XDP_TX feature support
Date: Fri, 11 Aug 2023 17:08:55 +0200 [thread overview]
Message-ID: <cc3d1319-d67e-3031-9351-95b45af797d4@kernel.org> (raw)
In-Reply-To: <AM5PR04MB3139BB2A930C4D7297FDA3348810A@AM5PR04MB3139.eurprd04.prod.outlook.com>
On 11/08/2023 03.26, Wei Fang wrote:
>> If you add below code comment you can add my ACK in V6:
>>
> Okay, I will add the annotation to the code in V6. Thanks.
>
Great, one adjustment to my suggested comment below.
>> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
>>
>>> @@ -1482,7 +1488,13 @@ fec_enet_tx_queue(struct net_device *ndev,
>> u16 queue_id, int budget)
>>> /* Free the sk buffer associated with this last transmit */
>>> dev_kfree_skb_any(skb);
>>> } else {
>>> - xdp_return_frame(xdpf);
>>> + if (txq->tx_buf[index].type == FEC_TXBUF_T_XDP_NDO) {
>>> + xdp_return_frame_rx_napi(xdpf);
>>> + } else {
>>> + struct page *page = virt_to_head_page(xdpf->data);
>>> +
>>
>> I think this usage of page_pool_put_page() with dma_sync_size=0 requires a
>> comment, else we will forget why this okay...
>> I suggest:
>>
>> /* PP dma_sync_size=0 as xmit already synced DMA for_device */
>>
I update my suggestion to:
/* PP dma_sync_size=0 as XDP_TX already synced DMA for_device */
Reading code path there is an simple "else" to reach this spot, and it
will be good to hint to code-reader that this code path deals with
XDP_TX completion handling.
You are of-cause free to come up with a better comment yourself.
>>> + page_pool_put_page(page->pp, page, 0, true);
>>> + }
>>>
>>> txq->tx_buf[index].xdp = NULL;
>>> /* restore default tx buffer type: FEC_TXBUF_T_SKB */
>> @@ -1541,7
>
--Jesper
next prev parent reply other threads:[~2023-08-11 15:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 6:45 [PATCH V5 net-next 0/2] net: fec: add XDP_TX feature support Wei Fang
2023-08-10 6:45 ` [PATCH V5 net-next 1/2] " Wei Fang
2023-08-10 13:58 ` Jesper Dangaard Brouer
2023-08-11 1:26 ` Wei Fang
2023-08-11 15:08 ` Jesper Dangaard Brouer [this message]
2023-08-11 11:58 ` Simon Horman
2023-08-12 0:06 ` Wei Fang
2023-08-10 6:45 ` [PATCH V5 net-next 2/2] net: fec: improve XDP_TX performance Wei Fang
2023-08-10 14:11 ` Jesper Dangaard Brouer
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=cc3d1319-d67e-3031-9351-95b45af797d4@kernel.org \
--to=hawk@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jbrouer@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.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).