Skip to content

Commit

Permalink
kni: fix build with Linux 6.5
Browse files Browse the repository at this point in the history
The get_user_pages_remote() API has been modified in Linux kernel v6.5
[1], "struct vm_area_struct **vmas" parameter removed from the API.

To fix KNI build with Linux kernel v6.5, version check added around the
get_user_pages_remote() API.

[1]
ca5e863233e8 ("mm/gup: remove vmas parameter from get_user_pages_remote()")

Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
ferruhy authored and tmonjalo committed Jul 12, 2023
1 parent 6db282f commit d00bcf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/linux/kni/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@
RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE))
#define HAVE_NETIF_RX_NI
#endif

#if KERNEL_VERSION(6, 5, 0) > LINUX_VERSION_CODE
#define HAVE_VMA_IN_GUP
#endif
4 changes: 4 additions & 0 deletions kernel/linux/kni/kni_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ static inline phys_addr_t iova_to_phys(struct task_struct *tsk,
#ifdef HAVE_TSK_IN_GUP
ret = get_user_pages_remote(tsk, tsk->mm, iova, 1, 0, &page, NULL, NULL);
#else
#ifdef HAVE_VMA_IN_GUP
ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL, NULL);
#else
ret = get_user_pages_remote(tsk->mm, iova, 1, 0, &page, NULL);
#endif
#endif
if (ret < 0)
return 0;
Expand Down

0 comments on commit d00bcf4

Please sign in to comment.