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: <b6dbc792-da77-8fe1-3cf5-dc9d65e7857e@intel.com>
Date:   Mon, 10 Jul 2023 14:58:51 +0200
From:   Alexander Lobakin <aleksander.lobakin@...el.com>
To:     Wei Fang <wei.fang@....com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "hawk@...nel.org" <hawk@...nel.org>,
        "john.fastabend@...il.com" <john.fastabend@...il.com>,
        Shenwei Wang <shenwei.wang@....com>,
        Clark Wang <xiaoning.wang@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        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 V2 net 2/4] net: fec: recycle pages for transmitted XDP
 frames

From: Wei Fang <wei.fang@....com>
Date: Fri, 7 Jul 2023 01:54:04 +0000

>> -----Original Message-----
>> From: Alexander Lobakin <aleksander.lobakin@...el.com>
>> Sent: 2023年7月6日 19:59
>> To: Wei Fang <wei.fang@....com>
>> Cc: davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
>> pabeni@...hat.com; ast@...nel.org; daniel@...earbox.net;
>> hawk@...nel.org; john.fastabend@...il.com; Shenwei Wang
>> <shenwei.wang@....com>; Clark Wang <xiaoning.wang@....com>;
>> netdev@...r.kernel.org; dl-linux-imx <linux-imx@....com>;
>> linux-kernel@...r.kernel.org; bpf@...r.kernel.org
>> Subject: Re: [PATCH V2 net 2/4] net: fec: recycle pages for transmitted XDP
>> frames
>>
>> From: Wei Fang <wei.fang@....com>
>> Date: Thu,  6 Jul 2023 16:10:10 +0800
>>
>>> From: Wei Fang <wei.fang@....com>
>>>
>>> Once the XDP frames have been successfully transmitted through the
>>> ndo_xdp_xmit() interface, it's the driver responsibility to free the
>>> frames so that the page_pool can recycle the pages and reuse them.
>>> However, this action is not implemented in the fec driver.
>>> This leads to a user-visible problem that the console will print the
>>> following warning log.
>>
>> [...]
>>
>>> +				if (txq->tx_buf[i].xdp) {
>>> +					xdp_return_frame(txq->tx_buf[i].xdp);
>>> +					txq->tx_buf[i].xdp = NULL;
>>> +				}
>>> +
>>> +				/* restore default tx buffer type: FEC_TXBUF_T_SKB */
>>> +				txq->tx_buf[i].type = FEC_TXBUF_T_SKB;
>>
>> Here and in the related places below: maybe set ::type dynamically when
>> sending to either SKB or XDP instead of setting it only for XDP and then
>> restoring each time?
> I also considered this method. but when the skb has frags or needs to be TSO,
> only the last tx_buf of the skb needs to store the skb pointer, but all the tx_buf
> of the skb needs to set the type explicitly, I think it is a bit mess and not concise.
> So I restore the type to default when recycle the BDs. Anyway, it;s just a difference
> in implement, if you guys insist it's better to set the type explicitly, I will modify
> the patch. Thanks!

Just more of personal preference, no problems. Moreover, your
explanation makes sense to me.

>>
>>>  			}
>>> +
>>>  			bdp->cbd_bufaddr = cpu_to_fec32(0);
>>>  			bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
>>>  		}
>> [...]
>>
>> Thanks,
>> Olek

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ