lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc3d1319-d67e-3031-9351-95b45af797d4@kernel.org>
Date: Fri, 11 Aug 2023 17:08:55 +0200
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: Wei Fang <wei.fang@....com>, Jesper Dangaard Brouer <hawk@...nel.org>,
 "davem@...emloft.net" <davem@...emloft.net>,
 "edumazet@...gle.com" <edumazet@...gle.com>,
 "kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com"
 <pabeni@...hat.com>, Shenwei Wang <shenwei.wang@....com>,
 Clark Wang <xiaoning.wang@....com>, "ast@...nel.org" <ast@...nel.org>,
 "daniel@...earbox.net" <daniel@...earbox.net>,
 "john.fastabend@...il.com" <john.fastabend@...il.com>,
 "larysa.zaremba@...el.com" <larysa.zaremba@...el.com>,
 "aleksander.lobakin@...el.com" <aleksander.lobakin@...el.com>,
 "jbrouer@...hat.com" <jbrouer@...hat.com>,
 "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: dl-linux-imx <linux-imx@....com>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 "bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: Re: [PATCH V5 net-next 1/2] net: fec: add XDP_TX feature support



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@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ