[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<SJ0PR18MB5216CC5ABBA7AFB8E7BAA4A8DBE02@SJ0PR18MB5216.namprd18.prod.outlook.com>
Date: Thu, 23 Jan 2025 09:17:24 +0000
From: Suman Ghosh <sumang@...vell.com>
To: Larysa Zaremba <larysa.zaremba@...el.com>
CC: "horms@...nel.org" <horms@...nel.org>,
Sunil Kovvuri Goutham
<sgoutham@...vell.com>,
Geethasowjanya Akula <gakula@...vell.com>,
Subbaraya
Sundeep Bhatta <sbhatta@...vell.com>,
Hariprasad Kelam <hkelam@...vell.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com"
<edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"netdev@...r.kernel.org"
<netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
Linu Cherian <lcherian@...vell.com>, Jerin
Jacob <jerinj@...vell.com>,
"john.fastabend@...il.com"
<john.fastabend@...il.com>,
Bharat Bhushan <bbhushan2@...vell.com>,
"hawk@...nel.org" <hawk@...nel.org>,
"andrew+netdev@...n.ch"
<andrew+netdev@...n.ch>,
"ast@...nel.org" <ast@...nel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"bpf@...r.kernel.org"
<bpf@...r.kernel.org>
Subject: RE: [EXTERNAL] Re: [net-next PATCH v4 1/6] octeontx2-pf: Don't unmap
page pool buffer
>
>Overall, the change makes sense. However, it would be better to consider
>using
>xdp_return_frame when handling the packets XDP_REDIRECTed from another
>interface, you can look up its implementation to see how much more cases
>it
>handles.
[Suman] Okay, we will check that and update in patch 5. I Will submit v5 once net-next is open again
>
>Also, a question below.
>
>> Signed-off-by: Geetha sowjanya <gakula@...vell.com>
>> Signed-off-by: Suman Ghosh <sumang@...vell.com>
>> ---
>> .../marvell/octeontx2/nic/otx2_common.h | 4 +-
>> .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 8 +++-
>> .../marvell/octeontx2/nic/otx2_txrx.c | 43 +++++++++++++-----
>-
>> .../marvell/octeontx2/nic/otx2_txrx.h | 1 +
>> 4 files changed, 41 insertions(+), 15 deletions(-)
>>
>
>[...]
>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> index 224cef938927..2859f397f99e 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
>> @@ -101,14 +101,20 @@ static void otx2_xdp_snd_pkt_handler(struct
>otx2_nic *pfvf,
>> struct nix_send_comp_s *snd_comp = &cqe->comp;
>> struct sg_list *sg;
>> struct page *page;
>> - u64 pa;
>> + u64 pa, iova;
>>
>> sg = &sq->sg[snd_comp->sqe_id];
>>
>> - pa = otx2_iova_to_phys(pfvf->iommu_domain, sg->dma_addr[0]);
>> - otx2_dma_unmap_page(pfvf, sg->dma_addr[0],
>> - sg->size[0], DMA_TO_DEVICE);
>> + iova = sg->dma_addr[0] - OTX2_HEAD_ROOM;
>> + pa = otx2_iova_to_phys(pfvf->iommu_domain, iova);
>
>Why change the address calculation? I would like the answer to be in the
>commit
>message.
[Suman] Ack, will submit v5 once net-next is open again.
>
>> page = virt_to_page(phys_to_virt(pa));
>> + if (sg->flags & XDP_REDIRECT)
>> + otx2_dma_unmap_page(pfvf, sg->dma_addr[0], sg->size[0],
>DMA_TO_DEVICE);
>> +
>> + if (page->pp) {
>> + page_pool_recycle_direct(page->pp, page);
>> + return;
>> + }
>> put_page(page);
>> }
>>
>> @@ -1360,7 +1366,7 @@ void otx2_free_pending_sqe(struct otx2_nic
>*pfvf)
>> }
>>
>> static void otx2_xdp_sqe_add_sg(struct otx2_snd_queue *sq, u64
>dma_addr,
>> - int len, int *offset)
>> + int len, int *offset, u16 flags)
>> {
>> struct nix_sqe_sg_s *sg = NULL;
>> u64 *iova = NULL;
>
>[...]
Powered by blists - more mailing lists