From 36709620ea0dea74eb02e91333510e86eccbc8f6 Mon Sep 17 00:00:00 2001 From: Kiran Modukuri Date: Wed, 28 Jun 2023 15:59:11 -0700 Subject: [PATCH] GPUDirect Storage kernel driver (nvidia-fs) ver-2.17.0 commit --- ChangeLog | 4 ++++ src/configure | 33 +++++++++++++++++++++++++++++++++ src/nvfs-core.c | 4 ++++ src/nvfs-mmap.c | 6 +++++- src/nvfs-vers.h | 4 ++-- 5 files changed, 48 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 192e78d..4b7a8b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ +nvidia-fs (2.17.0) RELEASE; urgency=low + * fixed compilations issues wth linux ver 6.x kernels +-- June 2023 nvidia-fs (2.16.1) RELEASE; urgency=low * no changes +-- June 2023 nvidia-fs (2.15.3) RELEASE; urgency=low * fixed failures in nvme_queue_rqs API when nvfs_nvidia_p2p_dma_map_pages can suspend during dma_map_pages call * fix memory leak in shadow pages due to missing unpin_user_page call diff --git a/src/configure b/src/configure index e3b5039..7b1dd53 100755 --- a/src/configure +++ b/src/configure @@ -434,6 +434,39 @@ if compile_prog "Checking if pin_user_pages_fast symbol is present in kernel or output_sym "HAVE_PIN_USER_PAGES_FAST" fi +cat > $TEST_C < +#include "test.h" + +int test (void) +{ + unsigned int temp = prandom_u32(); + return 0; +} +EOF +if compile_prog "Checking if prandom_u32 symbol is present in kernel or not ..."; then + output_sym "HAVE_PRANDOM_U32" +fi + +cat > $TEST_C < +static char *temp_devnode(struct device *dev, umode_t *mode) +{ + return NULL; +} +int test (void) +{ + struct class *temp; + temp->devnode = temp_devnode; + return 0; +} +EOF +if compile_prog "Checking if devnode in class has doesn't have const device or not ..."; then + output_sym "HAVE_NO_CONST_DEVICE_IN_DEVNODE" +fi + echo "#endif" >> $config_host_h rm -rf build diff --git a/src/nvfs-core.c b/src/nvfs-core.c index 6cb4a84..a2abbf3 100644 --- a/src/nvfs-core.c +++ b/src/nvfs-core.c @@ -2378,7 +2378,11 @@ struct file_operations nvfs_dev_fops = { .owner = THIS_MODULE, }; +#ifdef HAVE_NO_CONST_DEVICE_IN_DEVNODE static char *nvfs_devnode(struct device *dev, umode_t *mode) +#else +static char *nvfs_devnode(const struct device *dev, umode_t *mode) +#endif { if (!mode) return NULL; diff --git a/src/nvfs-mmap.c b/src/nvfs-mmap.c index 24b9a7f..544846a 100644 --- a/src/nvfs-mmap.c +++ b/src/nvfs-mmap.c @@ -668,8 +668,12 @@ static int nvfs_mgroup_mmap_internal(struct file *filp, struct vm_area_struct *v spin_lock(&lock); tries = 10; do { +#ifdef HAVE_PRANDOM_U32 base_index = NVFS_MIN_BASE_INDEX + (unsigned long)prandom_u32(); - nvfs_mgroup = nvfs_mgroup_get_unlocked(base_index); +#else + base_index = NVFS_MIN_BASE_INDEX + (unsigned long)get_random_u32(); +#endif + nvfs_mgroup = nvfs_mgroup_get_unlocked(base_index); if (unlikely(nvfs_mgroup && tries--)) { nvfs_mgroup_put(nvfs_mgroup); continue; diff --git a/src/nvfs-vers.h b/src/nvfs-vers.h index 872e881..9145a41 100644 --- a/src/nvfs-vers.h +++ b/src/nvfs-vers.h @@ -26,10 +26,10 @@ #define NVFS_DRIVER_MAJOR_VERSION 2 //2-bytes -#define NVFS_DRIVER_MINOR_VERSION 15 //2-bytes +#define NVFS_DRIVER_MINOR_VERSION 17 //2-bytes // template for build version -#define NVFS_DRIVER_PATCH_VERSION 3 +#define NVFS_DRIVER_PATCH_VERSION 0 static inline unsigned int nvfs_driver_version(void) { return (NVFS_DRIVER_MAJOR_VERSION << 16) | NVFS_DRIVER_MINOR_VERSION;