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 e1a7644..0111172 100644 --- a/exanic.spec +++ b/exanic.spec @@ -1,6 +1,6 @@ Name: exanic -Version: 2.7.2-git -Release: 1%{?dist} +Version: 2.7.4 +Release: 3%{?dist} Summary: ExaNIC drivers and software Group: System Environment/Kernel 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 a5312f2..3d5cdbf 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 @@ -257,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 ); @@ -1058,9 +1056,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; @@ -1215,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 ); @@ -1883,9 +1879,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 +1995,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); } 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) { 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, 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) { 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