* [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() @ 2025-11-19 1:11 Byungchul Park 2025-11-19 1:32 ` Jakub Kicinski 0 siblings, 1 reply; 4+ messages in thread From: Byungchul Park @ 2025-11-19 1:11 UTC (permalink / raw) To: kuba, netdev Cc: linux-kernel, linux-mm, kernel_team, harry.yoo, hawk, andrew+netdev, david, lorenzo.stoakes, Liam.Howlett, vbabka, ziy, willy, toke, asml.silence, alexanderduyck, kernel-team, davem, edumazet, pabeni, mohsin.bashr, almasrymina, jdamato With the planned removal of @pp from struct page, we should access the page pool pointer through other means. Use @page_pool in struct fbnic_ring instead. Signed-off-by: Byungchul Park <byungchul@sk.com> --- I should admit I'm not used to the following code. So I'd like to ask how to alter page->pp to avoid accessing @pp through struct page directly. Does the following change work? Or can you suggest other ways to achieve it? Byungchul --- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index b1e8ce89870f..95f158ba6fa2 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -653,7 +653,7 @@ static void fbnic_clean_twq1(struct fbnic_napi_vector *nv, bool pp_allow_direct, FBNIC_TWD_TYPE_AL; total_bytes += FIELD_GET(FBNIC_TWD_LEN_MASK, twd); - page_pool_put_page(page->pp, page, -1, pp_allow_direct); + page_pool_put_page(ring->page_pool, page, -1, pp_allow_direct); next_desc: head++; head &= ring->size_mask; -- 2.17.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() 2025-11-19 1:11 [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() Byungchul Park @ 2025-11-19 1:32 ` Jakub Kicinski 2025-11-19 2:45 ` Byungchul Park 0 siblings, 1 reply; 4+ messages in thread From: Jakub Kicinski @ 2025-11-19 1:32 UTC (permalink / raw) To: Byungchul Park Cc: netdev, linux-kernel, linux-mm, kernel_team, harry.yoo, hawk, andrew+netdev, david, lorenzo.stoakes, Liam.Howlett, vbabka, ziy, willy, toke, asml.silence, alexanderduyck, kernel-team, davem, edumazet, pabeni, mohsin.bashr, almasrymina, jdamato On Wed, 19 Nov 2025 10:11:46 +0900 Byungchul Park wrote: > With the planned removal of @pp from struct page, we should access the > page pool pointer through other means. Use @page_pool in struct > fbnic_ring instead. > > Signed-off-by: Byungchul Park <byungchul@sk.com> > --- > I should admit I'm not used to the following code. So I'd like to ask > how to alter page->pp to avoid accessing @pp through struct page > directly. Does the following change work? Or can you suggest other > ways to achieve it? @ring in this context is the Tx ring, but it's the Rx ring that has the page_pool pointer. Each Rx+Tx queue pair has 6 rings in total. You need the sub0/sub1 ring of the Rx queue from which the page came here. > diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > index b1e8ce89870f..95f158ba6fa2 100644 > --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > @@ -653,7 +653,7 @@ static void fbnic_clean_twq1(struct fbnic_napi_vector *nv, bool pp_allow_direct, > FBNIC_TWD_TYPE_AL; > total_bytes += FIELD_GET(FBNIC_TWD_LEN_MASK, twd); > > - page_pool_put_page(page->pp, page, -1, pp_allow_direct); > + page_pool_put_page(ring->page_pool, page, -1, pp_allow_direct); > next_desc: > head++; > head &= ring->size_mask; ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() 2025-11-19 1:32 ` Jakub Kicinski @ 2025-11-19 2:45 ` Byungchul Park 2025-11-19 2:48 ` Jakub Kicinski 0 siblings, 1 reply; 4+ messages in thread From: Byungchul Park @ 2025-11-19 2:45 UTC (permalink / raw) To: Jakub Kicinski Cc: netdev, linux-kernel, linux-mm, kernel_team, harry.yoo, hawk, andrew+netdev, david, lorenzo.stoakes, Liam.Howlett, vbabka, ziy, willy, toke, asml.silence, alexanderduyck, kernel-team, davem, edumazet, pabeni, mohsin.bashr, almasrymina, jdamato On Tue, Nov 18, 2025 at 05:32:16PM -0800, Jakub Kicinski wrote: > On Wed, 19 Nov 2025 10:11:46 +0900 Byungchul Park wrote: > > With the planned removal of @pp from struct page, we should access the > > page pool pointer through other means. Use @page_pool in struct > > fbnic_ring instead. > > > > Signed-off-by: Byungchul Park <byungchul@sk.com> > > --- > > I should admit I'm not used to the following code. So I'd like to ask > > how to alter page->pp to avoid accessing @pp through struct page > > directly. Does the following change work? Or can you suggest other > > ways to achieve it? > > @ring in this context is the Tx ring, but it's the Rx ring that has the > page_pool pointer. Each Rx+Tx queue pair has 6 rings in total. You need > the sub0/sub1 ring of the Rx queue from which the page came here. Thank you for the explanation. I'd better make it in the following way rather than modifying the unfamiliar code. Looks fine? Byungchul --- diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index c2d7b67fec28..382573f35408 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -653,7 +653,7 @@ static void fbnic_clean_twq1(struct fbnic_napi_vector *nv, bool pp_allow_direct, FBNIC_TWD_TYPE_AL; total_bytes += FIELD_GET(FBNIC_TWD_LEN_MASK, twd); - page_pool_put_page(page->pp, page, -1, pp_allow_direct); + page_pool_put_page(pp_page_to_nmdesc(page)->pp, page, -1, pp_allow_direct); next_desc: head++; head &= ring->size_mask; > > diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > > index b1e8ce89870f..95f158ba6fa2 100644 > > --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > > +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c > > @@ -653,7 +653,7 @@ static void fbnic_clean_twq1(struct fbnic_napi_vector *nv, bool pp_allow_direct, > > FBNIC_TWD_TYPE_AL; > > total_bytes += FIELD_GET(FBNIC_TWD_LEN_MASK, twd); > > > > - page_pool_put_page(page->pp, page, -1, pp_allow_direct); > > + page_pool_put_page(ring->page_pool, page, -1, pp_allow_direct); > > next_desc: > > head++; > > head &= ring->size_mask; > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() 2025-11-19 2:45 ` Byungchul Park @ 2025-11-19 2:48 ` Jakub Kicinski 0 siblings, 0 replies; 4+ messages in thread From: Jakub Kicinski @ 2025-11-19 2:48 UTC (permalink / raw) To: Byungchul Park Cc: netdev, linux-kernel, linux-mm, kernel_team, harry.yoo, hawk, andrew+netdev, david, lorenzo.stoakes, Liam.Howlett, vbabka, ziy, willy, toke, asml.silence, alexanderduyck, kernel-team, davem, edumazet, pabeni, mohsin.bashr, almasrymina, jdamato On Wed, 19 Nov 2025 11:45:46 +0900 Byungchul Park wrote: > > @ring in this context is the Tx ring, but it's the Rx ring that has the > > page_pool pointer. Each Rx+Tx queue pair has 6 rings in total. You need > > the sub0/sub1 ring of the Rx queue from which the page came here. > > Thank you for the explanation. I'd better make it in the following way > rather than modifying the unfamiliar code. Looks fine? Yes, I think that's fine. Just please wrap the long lines at 80 chars in networking. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-19 2:48 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-11-19 1:11 [RFC net-next] eth: fbnic: use ring->page_pool instead of page->pp in fbnic_clean_twq1() Byungchul Park 2025-11-19 1:32 ` Jakub Kicinski 2025-11-19 2:45 ` Byungchul Park 2025-11-19 2:48 ` Jakub Kicinski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox