diff --git a/drivers/net/ethernet/marvell/oak/oak_net.c b/drivers/net/ethernet/marvell/oak/oak_net.c index f76a2306..cbe9ab73 100644 --- a/drivers/net/ethernet/marvell/oak/oak_net.c +++ b/drivers/net/ethernet/marvell/oak/oak_net.c @@ -991,7 +991,11 @@ static void oak_net_rbr_unmap(oak_rx_chan_t *rxp, struct page *page, ++rxp->stat.rx_unmap_pages; /* Reset index, mapping and page_phys */ rxp->rba[rxp->rbr_ridx].page_phys = 0; +#if defined(NV_PAGE_STRUCT_HAS___FOLIO_INDEX) /* Linux v6.16 */ + page->__folio_index = 0; +#else page->index = 0; +#endif page->mapping = NULL; __free_page(page); } @@ -1454,7 +1458,11 @@ static void oak_net_unmap_and_free_page(oak_t *np, oak_rxa_t *rba, rba->page_virt, rba->page_phys); /* Reset index, mapping and page_phys */ rba->page_phys = 0; +#if defined(NV_PAGE_STRUCT_HAS___FOLIO_INDEX) /* Linux v6.16 */ + page->__folio_index = 0; +#else page->index = 0; +#endif page->mapping = NULL; if (good_frame == 0) __free_page(page); diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 22bee9ae..b9903f84 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -184,6 +184,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_chip_struct_has_of_node_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_find NV_CONFTEST_FUNCTION_COMPILE_TESTS += gpio_device_get_chip NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_property_for_each_u32_removed_internal_args +NV_CONFTEST_FUNCTION_COMPILE_TESTS += page_struct_has___folio_index NV_CONFTEST_FUNCTION_COMPILE_TESTS += pde_data NV_CONFTEST_FUNCTION_COMPILE_TESTS += platform_msi_domain_alloc_irqs NV_CONFTEST_FUNCTION_COMPILE_TESTS += platform_msi_domain_free_irqs diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index e4e13fd3..a463b386 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -8060,6 +8060,22 @@ compile_test() { compile_check_conftest "$CODE" "NV_PLATFORM_MSI_DOMAIN_ALLOC_IRQS_PRESENT" "" "functions" ;; + page_struct_has___folio_index) + # + # Determine if the 'page' structure has '__folio_index' member. + # + # This change was made in Linux v6.16 by commit ("acc53a0b4c15 mm: + # rename page->index to page->__folio_index"). + # + CODE=" + #include + int conftest_page_struct_has___folio_index(void) { + return offsetof(struct page, __folio_index); + }" + + compile_check_conftest "$CODE" "NV_PAGE_STRUCT_HAS___FOLIO_INDEX" "" "types" + ;; + platform_msi_domain_free_irqs) # # Determine if the platform_msi_domain_free_irqs() API available or not.