Message ID | 20250110093807.2451954-3-sumang@marvell.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Add af_xdp support for cn10k | expand |
On 1/10/25 10:38 AM, Suman Ghosh wrote: > For XDP, page_pool APIs are getting used now. But the memory type was > not getting set due to which XDP_REDIRECT and hence AF_XDP was not > working. This patch ads the memory type MEM_TYPE_PAGE_POOL as the memory > model of the XDP program. > > Signed-off-by: Suman Ghosh <sumang@marvell.com> This looks like a fixes that deserve its own fix tag and likely going trough the 'net' tree. I think you can still include in a net-next series to simplify the merging, but the fix tag should be added anyway. > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c > index 2859f397f99e..730f2b7742db 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c > @@ -96,7 +96,7 @@ static unsigned int frag_num(unsigned int i) > > static void otx2_xdp_snd_pkt_handler(struct otx2_nic *pfvf, > struct otx2_snd_queue *sq, > - struct nix_cqe_tx_s *cqe) > + struct nix_cqe_tx_s *cqe) > { > struct nix_send_comp_s *snd_comp = &cqe->comp; > struct sg_list *sg; For the same reasons, please move the white-space changes to a later patch. Thanks, Paolo
>> Signed-off-by: Suman Ghosh <sumang@marvell.com> > >This looks like a fixes that deserve its own fix tag and likely going >trough the 'net' tree. > >I think you can still include in a net-next series to simplify the >merging, but the fix tag should be added anyway. [Suman] Okay, will add in v4 > >> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c >> b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c >> index 2859f397f99e..730f2b7742db 100644 >> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c >> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c >> @@ -96,7 +96,7 @@ static unsigned int frag_num(unsigned int i) >> >> static void otx2_xdp_snd_pkt_handler(struct otx2_nic *pfvf, >> struct otx2_snd_queue *sq, >> - struct nix_cqe_tx_s *cqe) >> + struct nix_cqe_tx_s *cqe) >> { >> struct nix_send_comp_s *snd_comp = &cqe->comp; >> struct sg_list *sg; > >For the same reasons, please move the white-space changes to a later >patch. [Suman] ack > >Thanks, > >Paolo
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; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c index 2859f397f99e..730f2b7742db 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c @@ -96,7 +96,7 @@ static unsigned int frag_num(unsigned int i) static void otx2_xdp_snd_pkt_handler(struct otx2_nic *pfvf, struct otx2_snd_queue *sq, - struct nix_cqe_tx_s *cqe) + struct nix_cqe_tx_s *cqe) { struct nix_send_comp_s *snd_comp = &cqe->comp; struct sg_list *sg;
For XDP, page_pool APIs are getting used now. But the memory type was not getting set due to which XDP_REDIRECT and hence AF_XDP was not working. This patch ads the memory type MEM_TYPE_PAGE_POOL as the memory model of the XDP program. Signed-off-by: Suman Ghosh <sumang@marvell.com> --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +++++++- drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-)