From 4cca6faec1fc92294c3c4d32e2a858156c539cb4 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 24 May 2024 00:01:19 +0000 Subject: [PATCH 1/9] Call napi_schedule instead of napi_reschedule --- modules/exanic/exanic-netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/exanic/exanic-netdev.c b/modules/exanic/exanic-netdev.c index c9cdf0f..e35484a 100644 --- a/modules/exanic/exanic-netdev.c +++ b/modules/exanic/exanic-netdev.c @@ -1888,7 +1888,7 @@ static int exanic_netdev_poll(struct napi_struct *napi, int budget) if (exanic_rx_ready(rx)) { /* Poll again as soon as possible */ - napi_reschedule(napi); + napi_schedule(napi); } else if (priv->rx_coalesce_timeout_ns > 0) { From 235b7caf6fb334129707734f7615090caf7e3804 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 24 May 2024 00:04:13 +0000 Subject: [PATCH 2/9] Remove PCIE AER el9 dropped support for it, as the mainline kernel also did, see: https://lore.kernel.org/lkml/20230307181940.868828-16-helgaas@kernel.org/ And git commit message saying: ``` pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. ``` --- modules/exanic/exanic-main.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/exanic/exanic-main.c b/modules/exanic/exanic-main.c index a5312f2..43e4d6a 100644 --- a/modules/exanic/exanic-main.c +++ b/modules/exanic/exanic-main.c @@ -18,9 +18,6 @@ #include #endif #include -#if defined(CONFIG_PCIEAER) -#include -#endif #include #include #include @@ -1058,9 +1055,6 @@ static int exanic_probe(struct pci_dev *pdev, goto err_req_regions; } -#if defined(CONFIG_PCIEAER) - pci_enable_pcie_error_reporting(pdev); -#endif pci_set_master(pdev); pci_set_drvdata(pdev, exanic); exanic->pci_dev = pdev; @@ -1883,9 +1877,6 @@ static int exanic_probe(struct pci_dev *pdev, err_regs_ioremap: err_regs_size: err_regs_bar_type: -#if defined(CONFIG_PCIEAER) - pci_disable_pcie_error_reporting(pdev); -#endif pci_release_regions(pdev); err_req_regions: pci_disable_device(pdev); @@ -2002,9 +1993,6 @@ static void exanic_remove(struct pci_dev *pdev) if (exanic->regs_virt != NULL) iounmap(exanic->regs_virt); -#if defined(CONFIG_PCIEAER) - pci_disable_pcie_error_reporting(pdev); -#endif pci_release_regions(pdev); pci_disable_device(pdev); } From 7d068bdd76b4347eb5a6efd11bb20f4cc1142bb0 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 24 May 2024 00:42:20 +0000 Subject: [PATCH 3/9] Fix signatures of exabond_masters_show/store --- modules/exasock/exasock-bonding-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/exasock/exasock-bonding-sysfs.c b/modules/exasock/exasock-bonding-sysfs.c index 685a0d6..3b33f2b 100644 --- a/modules/exasock/exasock-bonding-sysfs.c +++ b/modules/exasock/exasock-bonding-sysfs.c @@ -29,9 +29,9 @@ exabond_get_sysfs_namespace(struct class *cls, #endif static ssize_t -exabond_masters_show(struct class *c, +exabond_masters_show(const struct class *c, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) - struct class_attribute *cattr, + const struct class_attribute *cattr, #endif char *buf) { @@ -71,9 +71,9 @@ exabond_masters_show(struct class *c, } static ssize_t -exabond_masters_store(struct class *c, +exabond_masters_store(const struct class *c, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) - struct class_attribute *cattr, + const struct class_attribute *cattr, #endif const char *buf, size_t count) { From de5ae946de2db0f78bac7235d8c7551fedfa2d22 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 24 May 2024 00:16:43 +0000 Subject: [PATCH 4/9] Update spec file to version 2.7.4 --- exanic.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exanic.spec b/exanic.spec index e1a7644..8415601 100644 --- a/exanic.spec +++ b/exanic.spec @@ -1,5 +1,5 @@ Name: exanic -Version: 2.7.2-git +Version: 2.7.4 Release: 1%{?dist} Summary: ExaNIC drivers and software From 25da2e9c2f259a48bc56a3d7c2f20fb5e59c9b1b Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 24 May 2024 00:16:47 +0000 Subject: [PATCH 5/9] Instructions for building RPM --- README.md | 9 +++++++++ exanic.spec | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67b341a..4f3f0ea 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,15 @@ Installation ------------ To install from source please run ``make`` and ``sudo make install`` from the top level. +RPM Build +--------- +Run: +``` +$ export exanic_version=2.7.4 +$ (cd .. && tar -czf $HOME/rpmbuild/SOURCES/exanic-${exanic_version}.tar.gz exanic-software --transform=s#exanic-software/#exanic-${exanic_version}/#g) +$ rpmbuild -ba -D 'debug_package %{nil}' exanic.spec +``` + Support ------- Complete documentation is available from our [website](https://www.cisco.com/c/en/us/td/docs/dcn/nexus3550/smartnic/sw/user-guide/cisco-nexus-smartnic-user-guide/index.html). For other questions and comments, you can contact Cisco TAC support team. diff --git a/exanic.spec b/exanic.spec index 8415601..f711a33 100644 --- a/exanic.spec +++ b/exanic.spec @@ -1,6 +1,6 @@ Name: exanic Version: 2.7.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: ExaNIC drivers and software Group: System Environment/Kernel From c7a9f7ceb3f4e1a24c48aa2ceac37996ee665947 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Mon, 25 Nov 2024 02:42:39 +0000 Subject: [PATCH 6/9] Update DEFINE_SEMAPHORE to newer kernel (count=1) --- modules/exasock/exasock-tcp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/exasock/exasock-tcp.c b/modules/exasock/exasock-tcp.c index d97b08e..e5b8908 100644 --- a/modules/exasock/exasock-tcp.c +++ b/modules/exasock/exasock-tcp.c @@ -1426,6 +1426,8 @@ static void exasock_tcp_dead(struct kref *ref) /* need biglock for this one function to avoid race condition */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) static DECLARE_MUTEX(update_biglock); +#elif defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309 +static DEFINE_SEMAPHORE(update_biglock, 1); #else static DEFINE_SEMAPHORE(update_biglock); #endif From 5c971c626d822ffd4f649569d21c866546a23949 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Mon, 25 Nov 2024 02:47:23 +0000 Subject: [PATCH 7/9] Use adjfine instead of adjfreq for newer RHEL/Rocky 9.5 kernels Kernels 5.14.0-503.14.1 and beyond will use adjfine instead of adjtime, backported from 6.2.0 --- modules/exanic/exanic-ptp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/exanic/exanic-ptp.c b/modules/exanic/exanic-ptp.c index 300ebcc..2c2ceda 100644 --- a/modules/exanic/exanic-ptp.c +++ b/modules/exanic/exanic-ptp.c @@ -375,7 +375,8 @@ static bool exanic_ptp_adj_allowed(struct exanic *exanic) return true; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) +// Use adjfine for el9.5 (kernel 5.14.0-503.14.1 and beyond), and kernels 6.2.0 and beyond +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) static int exanic_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) { struct exanic *exanic = container_of(ptp, struct exanic, ptp_clock_info); @@ -649,7 +650,8 @@ static int exanic_phc_enable(struct ptp_clock_info *ptp, static const struct ptp_clock_info exanic_ptp_clock_info = { .owner = THIS_MODULE, .pps = 1, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) +// Use adjfine for el9.5 (kernel 5.14.0-503.14.1 and beyond), and kernels 6.2.0 and beyond +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) .adjfine = exanic_phc_adjfine, #else .adjfreq = exanic_phc_adjfreq, From 252be4e2a9f3e059833a3744cbb3b39296bfe6bc Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Tue, 26 Nov 2024 01:31:32 +0000 Subject: [PATCH 8/9] Adjustment for DMA allocation for RHEL/Rocky 9.5 (kernel 5.14.0-503.14.1) --- modules/exanic/exanic-dev.c | 10 +++++----- modules/exanic/exanic-main.c | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/exanic/exanic-dev.c b/modules/exanic/exanic-dev.c index 62821d7..74f2d19 100644 --- a/modules/exanic/exanic-dev.c +++ b/modules/exanic/exanic-dev.c @@ -333,7 +333,7 @@ static int exanic_map_tx_feedback(struct exanic *exanic, } /* Do the mapping */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) vma->vm_pgoff = 0; err = dma_mmap_coherent(dev, vma, exanic->tx_feedback_virt, exanic->tx_feedback_dma, map_size); @@ -378,7 +378,7 @@ static int exanic_map_rx_region(struct exanic *exanic, struct vm_area_struct *vm int err; struct device *dev = &exanic->pci_dev->dev; void *rx_region_virt; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) dma_addr_t rx_region_dma; #else size_t off; @@ -390,7 +390,7 @@ static int exanic_map_rx_region(struct exanic *exanic, struct vm_area_struct *vm { rx_region_virt = exanic->port[port_num].filter_buffers[buffer_num - 1].region_virt; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) rx_region_dma = exanic->port[port_num].filter_buffers[buffer_num - 1].region_dma; #endif @@ -398,7 +398,7 @@ static int exanic_map_rx_region(struct exanic *exanic, struct vm_area_struct *vm else { rx_region_virt = exanic->port[port_num].rx_region_virt; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) rx_region_dma = exanic->port[port_num].rx_region_dma; #endif } @@ -471,7 +471,7 @@ static int exanic_map_rx_region(struct exanic *exanic, struct vm_area_struct *vm } /* Do the mapping */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 2) || (defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309) vma->vm_pgoff = 0; err = dma_mmap_coherent(dev, vma, rx_region_virt, rx_region_dma, map_size); diff --git a/modules/exanic/exanic-main.c b/modules/exanic/exanic-main.c index 43e4d6a..3d5cdbf 100644 --- a/modules/exanic/exanic-main.c +++ b/modules/exanic/exanic-main.c @@ -254,7 +254,8 @@ void * exanic_alloc_dma(struct exanic *exanic, int *numa_node, /* Allocate DMA resources. */ virt_region = dma_alloc_coherent(dev, EXANIC_RX_DMA_NUM_PAGES * PAGE_SIZE, rx_region_dma, GFP_KERNEL -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 2) +#if defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309 // No __GFP_COMP for el9.5 (kernel 5.14.0-503.14.1 and beyond) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 2) | __GFP_COMP #endif ); @@ -1209,7 +1210,8 @@ static int exanic_probe(struct pci_dev *pdev, exanic->tx_feedback_virt = dma_alloc_coherent(&exanic->pci_dev->dev, EXANIC_TX_FEEDBACK_NUM_PAGES * PAGE_SIZE, &exanic->tx_feedback_dma, GFP_KERNEL -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 2) +#if defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 2309 // No __GFP_COMP for el9.5 (kernel 5.14.0-503.14.1 and beyond) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 2) | __GFP_COMP #endif ); From f1070e8feb20dc7d8f108a5997c91417ae48fc01 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Mon, 25 Nov 2024 02:47:43 +0000 Subject: [PATCH 9/9] Update version to 2.7.4-3 --- exanic.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exanic.spec b/exanic.spec index f711a33..0111172 100644 --- a/exanic.spec +++ b/exanic.spec @@ -1,6 +1,6 @@ Name: exanic Version: 2.7.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: ExaNIC drivers and software Group: System Environment/Kernel