From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Paolo Valerio" <pvalerio@redhat.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
netdev@vger.kernel.org
Cc: "Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Lorenzo Bianconi" <lorenzo@kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Grégory Clement" <gregory.clement@bootlin.com>
Subject: Re: [PATCH RFC net-next 6/6] cadence: macb/gem: introduce xmit support
Date: Mon, 08 Dec 2025 12:01:09 +0100 [thread overview]
Message-ID: <DESS825O67J6.1XU39G8BM2YEJ@bootlin.com> (raw)
In-Reply-To: <878qfkzt2h.fsf@redhat.com>
On Tue Dec 2, 2025 at 6:34 PM CET, Paolo Valerio wrote:
> On 27 Nov 2025 at 04:07:52 PM, Théo Lebrun <theo.lebrun@bootlin.com> wrote:
>> On Wed Nov 19, 2025 at 2:53 PM CET, Paolo Valerio wrote:
>>> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
>>> index eeda1a3871a6..bd62d3febeb1 100644
>>> --- a/drivers/net/ethernet/cadence/macb_main.c
>>> +++ b/drivers/net/ethernet/cadence/macb_main.c
>>> +static int macb_xdp_submit_frame(struct macb *bp, struct xdp_frame *xdpf,
>>> + struct net_device *dev, dma_addr_t addr)
>>> +{
>>> + enum macb_tx_buff_type buff_type;
>>> + struct macb_tx_buff *tx_buff;
>>> + int cpu = smp_processor_id();
>>> + struct macb_dma_desc *desc;
>>> + struct macb_queue *queue;
>>> + unsigned long flags;
>>> + dma_addr_t mapping;
>>> + u16 queue_index;
>>> + int err = 0;
>>> + u32 ctrl;
>>> +
>>> + queue_index = cpu % bp->num_queues;
>>> + queue = &bp->queues[queue_index];
>>> + buff_type = !addr ? MACB_TYPE_XDP_NDO : MACB_TYPE_XDP_TX;
>>
>> I am not the biggest fan of piggy-backing on !!addr to know which
>> codepath called us. If the macb_xdp_submit_frame() call in gem_xdp_run()
>> ever gives an addr=0 coming from macb_get_addr(bp, desc), then we will
>> be submitting NDO typed frames and creating additional DMA mappings
>> which would be a really hard to debug bug.
>
> I guess we can add a separate boolean, WDYT?
I agree!
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-12-08 11:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 13:53 [PATCH RFC net-next 0/6] net: macb: Add XDP support and page pool integration Paolo Valerio
2025-11-19 13:53 ` [PATCH RFC net-next 1/6] cadence: macb/gem: Add page pool support Paolo Valerio
2025-11-27 13:21 ` Théo Lebrun
2025-12-02 17:30 ` Paolo Valerio
2025-11-19 13:53 ` [PATCH RFC net-next 2/6] cadence: macb/gem: handle multi-descriptor frame reception Paolo Valerio
2025-11-27 13:38 ` Théo Lebrun
2025-12-02 17:32 ` Paolo Valerio
2025-12-08 10:21 ` Théo Lebrun
2025-12-08 10:22 ` [PATCH 1/8] net: macb: move Rx buffers alloc from link up to open Théo Lebrun
2025-12-08 12:53 ` [PATCH RFC net-next 2/6] cadence: macb/gem: handle multi-descriptor frame reception Paolo Valerio
2025-12-09 9:01 ` Théo Lebrun
2025-11-19 13:53 ` [PATCH RFC net-next 3/6] cadence: macb/gem: use the current queue number for stats Paolo Valerio
2025-11-19 13:53 ` [PATCH RFC net-next 4/6] cadence: macb/gem: add XDP support for gem Paolo Valerio
2025-11-27 14:41 ` Théo Lebrun
2025-12-02 17:32 ` Paolo Valerio
2025-12-08 10:59 ` Théo Lebrun
2025-11-19 13:53 ` [PATCH RFC net-next 5/6] cadence: macb/gem: make tx path skb agnostic Paolo Valerio
2025-11-27 14:49 ` Théo Lebrun
2025-12-02 17:33 ` Paolo Valerio
2025-11-19 13:53 ` [PATCH RFC net-next 6/6] cadence: macb/gem: introduce xmit support Paolo Valerio
2025-11-27 15:07 ` Théo Lebrun
2025-12-02 17:34 ` Paolo Valerio
2025-12-08 11:01 ` Théo Lebrun [this message]
2025-11-25 16:50 ` [PATCH RFC net-next 0/6] net: macb: Add XDP support and page pool integration Théo Lebrun
2025-11-25 23:11 ` Paolo Valerio
2025-11-26 18:08 ` Théo Lebrun
2025-12-02 17:24 ` Paolo Valerio
2025-12-03 14:28 ` Théo Lebrun
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=DESS825O67J6.1XU39G8BM2YEJ@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregory.clement@bootlin.com \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=pvalerio@redhat.com \
--cc=thomas.petazzoni@bootlin.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).