Skip to contentSkip to conversation

octeontx2-pf: AF_XDP: code clean up

PATCH Applied Hariprasad Kelam 2 participants 2 messages Apr 20, 2025 – Apr 24, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 octeontx2-pf: AF_XDP: code clean up

The current API, otx2_xdp_sq_append_pkt, verifies the number of available descriptors before sending packets to the hardware.

However, for AF_XDP, this check is unnecessary because the batch value is already determined based on the free descriptors.

This patch introduces a new API, "otx2_xsk_sq_append_pkt" to address this.

Remove the logic for releasing the TX buffers, as it is implicitly handled by xsk_tx_peek_release_desc_batch

---
 .../marvell/octeontx2/nic/otx2_common.h       |  2 +
 .../marvell/octeontx2/nic/otx2_txrx.c         |  5 +--
 .../ethernet/marvell/octeontx2/nic/otx2_xsk.c | 42 ++++++++++++++-----
 3 files changed, 35 insertions(+), 14 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +2 -0
index 1e88422825be..7e3ddb0bee12 100644
@@ -1107,6 +1107,8 @@ int otx2_enable_rxvlan(struct otx2_nic *pf, bool enable);
 int otx2_install_rxvlan_offload_flow(struct otx2_nic *pfvf);
 bool otx2_xdp_sq_append_pkt(struct otx2_nic *pfvf, struct xdp_frame *xdpf,
 			    u64 iova, int len, u16 qidx, u16 flags);
+void otx2_xdp_sqe_add_sg(struct otx2_snd_queue *sq, struct xdp_frame *xdpf,
+			 u64 dma_addr, int len, int *offset, u16 flags);
 u16 otx2_get_max_mtu(struct otx2_nic *pfvf);
 int otx2_handle_ntuple_tc_features(struct net_device *netdev,
 				   netdev_features_t features);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +2 -3
index 0a6bb346ba45..9593627b35a3 100644
@@ -1410,9 +1410,8 @@ void otx2_free_pending_sqe(struct otx2_nic *pfvf)
 	}
 }
 
-static void otx2_xdp_sqe_add_sg(struct otx2_snd_queue *sq,
-				struct xdp_frame *xdpf,
-				u64 dma_addr, int len, int *offset, u16 flags)
+void otx2_xdp_sqe_add_sg(struct otx2_snd_queue *sq, struct xdp_frame *xdpf,
+			 u64 dma_addr, int len, int *offset, u16 flags)
 {
 	struct nix_sqe_sg_s *sg = NULL;
 	u64 *iova = NULL;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_xsk.c +31 -11

63 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Sun, 20 Apr 2025 08:53:50 +0530 you wrote:

The current API, otx2_xdp_sq_append_pkt, verifies the number of available descriptors before sending packets to the hardware.

However, for AF_XDP, this check is unnecessary because the batch value is already determined based on the free descriptors.

This patch introduces a new API, "otx2_xsk_sq_append_pkt" to address this.

[...]

Here is the summary with links:
- [net-next] octeontx2-pf: AF_XDP: code clean up

    https://git.kernel.org/netdev/net-next/c/b5cdb9b3113e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html