diff mbox series

[net-next,v5,2/6] octeontx2-pf: Add AF_XDP non-zero copy support

Message ID 20250206085034.1978172-3-sumang@marvell.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add af_xdp support for cn10k | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 15 of 15 maintainers
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 5 this patch: 5
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Suman Ghosh Feb. 6, 2025, 8:50 a.m. UTC
Set xdp rx ring memory type as MEM_TYPE_PAGE_POOL for
af-xdp to work. This is needed since xdp_return_frame
internally will use page pools.

Fixes: 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF")
Signed-off-by: Suman Ghosh <sumang@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Simon Horman Feb. 10, 2025, 4:41 p.m. UTC | #1
On Thu, Feb 06, 2025 at 02:20:30PM +0530, Suman Ghosh wrote:
> Set xdp rx ring memory type as MEM_TYPE_PAGE_POOL for
> af-xdp to work. This is needed since xdp_return_frame
> internally will use page pools.
> 
> Fixes: 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF")
> Signed-off-by: Suman Ghosh <sumang@marvell.com>

Hi Suman,

If this is a bug fix then it should be targeted at net, which
implies splitting it out of this patch-set.

If, on the other hand, it is not a fix then it should not have a Fixes tag.
In that case you can cite a commit using this syntax:

commit 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF")

Unlike a Fixes tag it:
* Should be in the body of the patch description,
  rather than part of the tags at the bottom of the patch description
* May be line wrapped
* Can me included in a sentence
Suman Ghosh Feb. 11, 2025, 7:07 a.m. UTC | #2
>Hi Suman,
>
>If this is a bug fix then it should be targeted at net, which implies
>splitting it out of this patch-set.
>
>If, on the other hand, it is not a fix then it should not have a Fixes
>tag.
>In that case you can cite a commit using this syntax:
>
>commit 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF")
>
>Unlike a Fixes tag it:
>* Should be in the body of the patch description,
>  rather than part of the tags at the bottom of the patch description
>* May be line wrapped
>* Can me included in a sentence
[Suman] Hi Simon,
This was suggested the Paolo in v3. He suggested this to simplify the merging process but to add the fix tag.
Simon Horman Feb. 11, 2025, 10:09 a.m. UTC | #3
On Tue, Feb 11, 2025 at 07:07:02AM +0000, Suman Ghosh wrote:
> >Hi Suman,
> >
> >If this is a bug fix then it should be targeted at net, which implies
> >splitting it out of this patch-set.
> >
> >If, on the other hand, it is not a fix then it should not have a Fixes
> >tag.
> >In that case you can cite a commit using this syntax:
> >
> >commit 06059a1a9a4a ("octeontx2-pf: Add XDP support to netdev PF")
> >
> >Unlike a Fixes tag it:
> >* Should be in the body of the patch description,
> >  rather than part of the tags at the bottom of the patch description
> >* May be line wrapped
> >* Can me included in a sentence
> [Suman] Hi Simon,
> This was suggested the Paolo in v3. He suggested this to simplify the merging process but to add the fix tag.

Thanks Suman,

Sorry for missing Paolo's advice on v3 [1].

[1] https://lore.kernel.org/netdev/dddca9a4-9ee3-4da1-b68d-26f208566d5d@redhat.com/
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index 2b49bfec7869..161cf33ef89e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -1047,6 +1047,7 @@  static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)
 	int err, pool_id, non_xdp_queues;
 	struct nix_aq_enq_req *aq;
 	struct otx2_cq_queue *cq;
+	struct otx2_pool *pool;
 
 	cq = &qset->cq[qidx];
 	cq->cq_idx = qidx;
@@ -1055,8 +1056,13 @@  static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)
 		cq->cq_type = CQ_RX;
 		cq->cint_idx = qidx;
 		cq->cqe_cnt = qset->rqe_cnt;
-		if (pfvf->xdp_prog)
+		if (pfvf->xdp_prog) {
+			pool = &qset->pool[qidx];
 			xdp_rxq_info_reg(&cq->xdp_rxq, pfvf->netdev, qidx, 0);
+			xdp_rxq_info_reg_mem_model(&cq->xdp_rxq,
+						   MEM_TYPE_PAGE_POOL,
+						   pool->page_pool);
+		}
 	} else if (qidx < non_xdp_queues) {
 		cq->cq_type = CQ_TX;
 		cq->cint_idx = qidx - pfvf->hw.rx_queues;