mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Wei Fang <wei.fang@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	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 V2 net 2/4] net: fec: recycle pages for transmitted XDP frames
Date: Mon, 10 Jul 2023 14:58:51 +0200	[thread overview]
Message-ID: <b6dbc792-da77-8fe1-3cf5-dc9d65e7857e@intel.com> (raw)
In-Reply-To: <AM5PR04MB3139BAF71F71A7681E3D0D57882DA@AM5PR04MB3139.eurprd04.prod.outlook.com>

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

>> -----Original Message-----
>> From: Alexander Lobakin <aleksander.lobakin@intel.com>
>> Sent: 2023年7月6日 19:59
>> To: Wei Fang <wei.fang@nxp.com>
>> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
>> pabeni@redhat.com; ast@kernel.org; daniel@iogearbox.net;
>> hawk@kernel.org; john.fastabend@gmail.com; Shenwei Wang
>> <shenwei.wang@nxp.com>; Clark Wang <xiaoning.wang@nxp.com>;
>> netdev@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
>> linux-kernel@vger.kernel.org; bpf@vger.kernel.org
>> Subject: Re: [PATCH V2 net 2/4] net: fec: recycle pages for transmitted XDP
>> frames
>>
>> From: Wei Fang <wei.fang@nxp.com>
>> Date: Thu,  6 Jul 2023 16:10:10 +0800
>>
>>> From: Wei Fang <wei.fang@nxp.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

  reply	other threads:[~2023-07-10 13:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  8:10 [PATCH V2 net 0/4] net: fec: fix some issues of ndo_xdp_xmit() wei.fang
2023-07-06  8:10 ` [PATCH V2 net 1/4] net: fec: dynamically set the NETDEV_XDP_ACT_NDO_XMIT feature of XDP wei.fang
2023-07-06  8:10 ` [PATCH V2 net 2/4] net: fec: recycle pages for transmitted XDP frames wei.fang
2023-07-06 11:59   ` Alexander Lobakin
2023-07-07  1:54     ` Wei Fang
2023-07-10 12:58       ` Alexander Lobakin [this message]
2023-07-06  8:10 ` [PATCH V2 net 3/4] net: fec: increase the size of tx ring and update tx_wake_threshold wei.fang
2023-07-06  8:10 ` [PATCH V2 net 4/4] net: fec: use netdev_err_once() instead of netdev_err() wei.fang
2023-07-06 11:51 ` [PATCH V2 net 0/4] net: fec: fix some issues of ndo_xdp_xmit() Alexander Lobakin
2023-07-11  8:50 ` patchwork-bot+netdevbpf

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=b6dbc792-da77-8fe1-3cf5-dc9d65e7857e@intel.com \
    --to=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=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --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

all inboxes | Powered by JetHome®