From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Suman Ghosh <sumang@marvell.com>
Cc: <horms@kernel.org>, <sgoutham@marvell.com>, <gakula@marvell.com>,
<sbhatta@marvell.com>, <hkelam@marvell.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <lcherian@marvell.com>,
<jerinj@marvell.com>, <john.fastabend@gmail.com>,
<bbhushan2@marvell.com>, <hawk@kernel.org>,
<andrew+netdev@lunn.ch>, <ast@kernel.org>, <daniel@iogearbox.net>,
<bpf@vger.kernel.org>, <larysa.zaremba@intel.com>
Subject: Re: [net-next PATCH v6 6/6] octeontx2-pf: AF_XDP zero copy transmit support
Date: Tue, 18 Feb 2025 14:01:09 +0100 [thread overview]
Message-ID: <Z7SEleIJ636O+XZI@boxer> (raw)
In-Reply-To: <20250213053141.2833254-7-sumang@marvell.com>
On Thu, Feb 13, 2025 at 11:01:41AM +0530, Suman Ghosh wrote:
> This patch implements below changes,
>
> 1. To avoid concurrency with normal traffic uses
> XDP queues.
> 2. Since there are chances that XDP and AF_XDP can
> fall under same queue uses separate flags to handle
> dma buffers.
>
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> ---
[...]
> +void otx2_zc_napi_handler(struct otx2_nic *pfvf, struct xsk_buff_pool *pool,
> + int queue, int budget)
> +{
> + struct xdp_desc *xdp_desc = pool->tx_descs;
> + int err, i, work_done = 0, batch;
> +
> + budget = min(budget, otx2_read_free_sqe(pfvf, queue));
> + batch = xsk_tx_peek_release_desc_batch(pool, budget);
> + if (!batch)
> + return;
> +
> + for (i = 0; i < batch; i++) {
> + dma_addr_t dma_addr;
> +
> + dma_addr = xsk_buff_raw_get_dma(pool, xdp_desc[i].addr);
> + err = otx2_xdp_sq_append_pkt(pfvf, NULL, dma_addr, xdp_desc[i].len,
> + queue, OTX2_AF_XDP_FRAME);
> + if (!err) {
> + netdev_err(pfvf->netdev, "AF_XDP: Unable to transfer packet err%d\n", err);
> + break;
> + }
> + work_done++;
> + }
> +
> + if (work_done)
> + xsk_tx_release(pool);
this is broken actually. the batch api you're using above is doing tx
release internally for you.
Sorry for not catching this earlier but i was never CCed in this series.
> +}
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.h
> index 022b3433edbb..8047fafee8fe 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.h
> @@ -17,5 +17,8 @@ int otx2_xsk_pool_disable(struct otx2_nic *pf, u16 qid);
> int otx2_xsk_pool_alloc_buf(struct otx2_nic *pfvf, struct otx2_pool *pool,
> dma_addr_t *dma, int idx);
> int otx2_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags);
> +void otx2_zc_napi_handler(struct otx2_nic *pfvf, struct xsk_buff_pool *pool,
> + int queue, int budget);
> +void otx2_attach_xsk_buff(struct otx2_nic *pfvf, struct otx2_snd_queue *sq, int qidx);
>
> #endif /* OTX2_XSK_H */
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2025-02-18 13:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 5:31 [net-next PATCH v6 0/6] Add af_xdp support for cn10k Suman Ghosh
2025-02-13 5:31 ` [net-next PATCH v6 1/6] octeontx2-pf: use xdp_return_frame() to free xdp buffers Suman Ghosh
2025-02-28 2:23 ` Yunsheng Lin
2025-02-13 5:31 ` [net-next PATCH v6 2/6] octeontx2-pf: Add AF_XDP non-zero copy support Suman Ghosh
2025-02-13 5:31 ` [net-next PATCH v6 3/6] octeontx2-pf: AF_XDP zero copy receive support Suman Ghosh
2025-02-18 14:57 ` Maciej Fijalkowski
2025-02-19 9:49 ` [EXTERNAL] " Suman Ghosh
2025-02-19 21:36 ` Kees Bakker
2025-02-13 5:31 ` [net-next PATCH v6 4/6] octeontx2-pf: Reconfigure RSS table after enabling AF_XDP zerocopy on rx queue Suman Ghosh
2025-02-13 5:31 ` [net-next PATCH v6 5/6] octeontx2-pf: Prepare for AF_XDP Suman Ghosh
2025-02-13 5:31 ` [net-next PATCH v6 6/6] octeontx2-pf: AF_XDP zero copy transmit support Suman Ghosh
2025-02-18 10:26 ` Paolo Abeni
2025-02-19 9:46 ` [EXTERNAL] " Suman Ghosh
2025-02-18 13:01 ` Maciej Fijalkowski [this message]
2025-02-19 9:47 ` Suman Ghosh
2025-02-18 10:50 ` [net-next PATCH v6 0/6] Add af_xdp support for cn10k patchwork-bot+netdevbpf
-- strict thread matches above, loose matches on Subject: below --
2025-02-12 19:24 Suman Ghosh
2025-02-12 19:24 ` [net-next PATCH v6 6/6] octeontx2-pf: AF_XDP zero copy transmit support Suman Ghosh
2025-02-12 9:47 [net-next PATCH v6 0/6] Add af_xdp support for cn10k Suman Ghosh
2025-02-12 9:47 ` [net-next PATCH v6 6/6] octeontx2-pf: AF_XDP zero copy transmit support Suman Ghosh
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=Z7SEleIJ636O+XZI@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bbhushan2@marvell.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hawk@kernel.org \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=jerinj@marvell.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=sumang@marvell.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).