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] [day] [month] [year] [list]
Message-ID: <4cf65af4-4b86-47b2-bfd0-3dd5a15c91ff@ijzerbout.nl>
Date: Wed, 19 Feb 2025 22:36:55 +0100
From: Kees Bakker <kees@...erbout.nl>
To: Suman Ghosh <sumang@...vell.com>, horms@...nel.org, sgoutham@...vell.com,
 gakula@...vell.com, sbhatta@...vell.com, hkelam@...vell.com,
 davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 lcherian@...vell.com, jerinj@...vell.com, john.fastabend@...il.com,
 bbhushan2@...vell.com, hawk@...nel.org, andrew+netdev@...n.ch,
 ast@...nel.org, daniel@...earbox.net, bpf@...r.kernel.org,
 larysa.zaremba@...el.com
Subject: Re: [net-next PATCH v6 3/6] octeontx2-pf: AF_XDP zero copy receive
 support

Op 13-02-2025 om 06:31 schreef Suman Ghosh:
> This patch adds support to AF_XDP zero copy for CN10K.
> This patch specifically adds receive side support. In this approach once
> a xdp program with zero copy support on a specific rx queue is enabled,
> then that receive quse is disabled/detached from the existing kernel
> queue and re-assigned to the umem memory.
>
> Signed-off-by: Suman Ghosh <sumang@...vell.com>
> ---
>   .../ethernet/marvell/octeontx2/nic/Makefile   |   2 +-
>   .../ethernet/marvell/octeontx2/nic/cn10k.c    |   7 +-
>   .../marvell/octeontx2/nic/otx2_common.c       | 114 ++++++++---
>   .../marvell/octeontx2/nic/otx2_common.h       |   6 +-
>   .../ethernet/marvell/octeontx2/nic/otx2_pf.c  |  25 ++-
>   .../marvell/octeontx2/nic/otx2_txrx.c         |  73 +++++--
>   .../marvell/octeontx2/nic/otx2_txrx.h         |   6 +
>   .../ethernet/marvell/octeontx2/nic/otx2_vf.c  |  12 +-
>   .../ethernet/marvell/octeontx2/nic/otx2_xsk.c | 182 ++++++++++++++++++
>   .../ethernet/marvell/octeontx2/nic/otx2_xsk.h |  21 ++
>   .../ethernet/marvell/octeontx2/nic/qos_sq.c   |   2 +-
>   11 files changed, 389 insertions(+), 61 deletions(-)
>   create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c
>   create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.h
>
>
> [...]
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c
> new file mode 100644
> index 000000000000..894c1e0aea6f
> --- /dev/null
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c
>
> [...]
> +static void otx2_clean_up_rq(struct otx2_nic *pfvf, int qidx)
> +{
> +	struct otx2_qset *qset = &pfvf->qset;
> +	struct otx2_cq_queue *cq;
> +	struct otx2_pool *pool;
> +	u64 iova;
> +
> +	/* If the DOWN flag is set SQs are already freed */
> +	if (pfvf->flags & OTX2_FLAG_INTF_DOWN)
> +		return;
> +
> +	cq = &qset->cq[qidx];
> +	if (cq)
> +		otx2_cleanup_rx_cqes(pfvf, cq, qidx);
The if check makes no sense, cq is always != NULL
> +
> [...]
> +int otx2_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
> +{
> +	struct otx2_nic *pf = netdev_priv(dev);
> +	struct otx2_cq_poll *cq_poll = NULL;
> +	struct otx2_qset *qset = &pf->qset;
> +
> +	if (pf->flags & OTX2_FLAG_INTF_DOWN)
> +		return -ENETDOWN;
> +
> +	if (queue_id >= pf->hw.rx_queues)
> +		return -EINVAL;
> +
> +	cq_poll = &qset->napi[queue_id];
> +	if (!cq_poll)
> +		return -EINVAL;
cq_poll can never be NULL.
> [...]
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ