Thread (16 messages) flat view 16 messages, 6 authors, 2025-02-28

Re: [net-next PATCH v6 3/6] octeontx2-pf: AF_XDP zero copy receive support

From: Kees Bakker <hidden>
Date: 2025-02-19 21:37:19
Also in: bpf, lkml

Op 13-02-2025 om 06:31 schreef Suman Ghosh:
quoted hunk ↗ jump to hunk
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 <redacted>
---
  .../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.
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help