Skip to content

fix: use __netmem_get_pp for kernel >= 6.17 in mt76_put_page_pool_buf#14

Open
georgettica wants to merge 1 commit into
hmtheboy154:backportfrom
georgettica:fix/pp-page-pool-api-kernel-617
Open

fix: use __netmem_get_pp for kernel >= 6.17 in mt76_put_page_pool_buf#14
georgettica wants to merge 1 commit into
hmtheboy154:backportfrom
georgettica:fix/pp-page-pool-api-kernel-617

Conversation

@georgettica
Copy link
Copy Markdown

pp_page_to_nmdesc() was introduced in kernel 6.13 as part of the netmem abstraction and removed in 6.17 in favour of __netmem_get_pp() + page_to_netmem(). The previous guard branched on >= 6.17 to use pp_page_to_nmdesc(), which is the exact version that removed the function, causing a build failure on 6.17+.

Replace the two-way guard with a three-way guard:

= 6.17 : __netmem_get_pp(page_to_netmem(page)) [new API]
= 6.13 : pp_page_to_nmdesc(page)->pp [transitional API]
< 6.13 : page->pp [original field]

Tested: builds and loads on Ubuntu kernel 6.17.0-23-generic (MT7902 ASIC rev 79020000, firmware loaded, wlp2s0 interface up).

pp_page_to_nmdesc() was introduced in kernel 6.13 as part of the netmem
abstraction and removed in 6.17 in favour of __netmem_get_pp() +
page_to_netmem().  The previous guard branched on >= 6.17 to use
pp_page_to_nmdesc(), which is the exact version that removed the
function, causing a build failure on 6.17+.

Replace the two-way guard with a three-way guard:
  >= 6.17 : __netmem_get_pp(page_to_netmem(page))   [new API]
  >= 6.13 : pp_page_to_nmdesc(page)->pp              [transitional API]
  < 6.13  : page->pp                                 [original field]

Tested: builds and loads on Ubuntu kernel 6.17.0-23-generic (MT7902
ASIC rev 79020000, firmware loaded, wlp2s0 interface up).

Co-Authored-By: Ron Green <11993626+georgettica@users.noreply.github.com>
@georgettica
Copy link
Copy Markdown
Author

based on OnlineLearningTutorials/mt7902_temp#23, I am posting the fix I made in OnlineLearningTutorials/mt7902_temp#36 here too

@georgettica
Copy link
Copy Markdown
Author

noticed there might be an official fix for these in the kernel. will wait for others to close / archive the repo and then remove the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant