From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Andrew Lunn <andrew@lunn.ch>, 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@nxp.com,
xiaoning.wang@nxp.com, netdev@vger.kernel.org, linux-imx@nxp.com,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net 1/3] net: fec: dynamically set the NETDEV_XDP_ACT_NDO_XMIT feature of XDP
Date: Wed, 05 Jul 2023 01:54:17 +0200 [thread overview]
Message-ID: <87mt0bb5cm.fsf@toke.dk> (raw)
In-Reply-To: <5b1182d5-a147-4bfd-9ac8-b33462e97b10@lunn.ch>
Andrew Lunn <andrew@lunn.ch> writes:
> On Tue, Jul 04, 2023 at 04:29:14PM +0800, wei.fang@nxp.com wrote:
>> From: Wei Fang <wei.fang@nxp.com>
>>
>> When a XDP program is installed or uninstalled, fec_restart() will
>> be invoked to reset MAC and buffer descriptor rings. It's reasonable
>> not to transmit any packet during the process of reset. However, the
>> NETDEV_XDP_ACT_NDO_XMIT bit of xdp_features is enabled by default,
>> that is to say, it's possible that the fec_enet_xdp_xmit() will be
>> invoked even if the process of reset is not finished. In this case,
>> the redirected XDP frames might be dropped and available transmit BDs
>> may be incorrectly deemed insufficient. So this patch disable the
>> NETDEV_XDP_ACT_NDO_XMIT feature by default and dynamically configure
>> this feature when the bpf program is installed or uninstalled.
>
> I don't know much about XDP, so please excuse what might be a stupid
> question.
>
> Is this a generic issue? Should this
> xdp_features_clear_redirect_target(dev) /
> xdp_features_set_redirect_target(dev, false) be done in the core?
No, because not all drivers require an XDP program to be attached to
support being a redirect target (which is one of the reasons we
introduced these feature bits in the first place :)).
-Toke
next prev parent reply other threads:[~2023-07-04 23:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 8:29 [PATCH net 0/3] net: fec: fix some issues of ndo_xdp_xmit() wei.fang
2023-07-04 8:29 ` [PATCH net 1/3] net: fec: dynamically set the NETDEV_XDP_ACT_NDO_XMIT feature of XDP wei.fang
2023-07-04 23:41 ` Andrew Lunn
2023-07-04 23:54 ` Toke Høiland-Jørgensen [this message]
2023-07-05 6:31 ` Wei Fang
2023-07-04 8:29 ` [PATCH net 2/3] net: fec: recycle pages for transmitted XDP frames wei.fang
2023-07-04 23:48 ` Andrew Lunn
2023-07-05 1:56 ` Wei Fang
2023-07-04 8:29 ` [PATCH net 3/3] net: fec: increase the size of tx ring and update thresholds of tx ring wei.fang
2023-07-05 0:25 ` Andrew Lunn
2023-07-05 6:20 ` Wei Fang
2023-07-05 18:11 ` Jakub Kicinski
2023-07-06 1:44 ` Wei Fang
2023-07-06 3:11 ` Jakub Kicinski
2023-07-06 6:14 ` Wei Fang
2023-07-08 19:03 ` Andrew Lunn
2023-07-10 6:16 ` Wei Fang
2023-07-12 1:16 ` Andrew Lunn
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=87mt0bb5cm.fsf@toke.dk \
--to=toke@redhat.com \
--cc=andrew@lunn.ch \
--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;
as well as URLs for NNTP newsgroup(s).