Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions exanic.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions modules/exanic/exanic-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -390,15 +390,15 @@ 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
}
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
}
Expand Down Expand Up @@ -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);
Expand Down
18 changes: 4 additions & 14 deletions modules/exanic/exanic-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#include <linux/pci-aspm.h>
#endif
#include <linux/interrupt.h>
#if defined(CONFIG_PCIEAER)
#include <linux/aer.h>
#endif
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/if_arp.h>
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/exanic/exanic-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 4 additions & 2 deletions modules/exanic/exanic-ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions modules/exasock/exasock-bonding-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions modules/exasock/exasock-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down