diff --git a/SOURCES/0001-net-bnxt-fix-set-MTU.patch b/SOURCES/0001-net-bnxt-fix-set-MTU.patch new file mode 100644 index 0000000..aa424b2 --- /dev/null +++ b/SOURCES/0001-net-bnxt-fix-set-MTU.patch @@ -0,0 +1,50 @@ +From 19a1808003af3e87f903a053b2207a59f6bb3456 Mon Sep 17 00:00:00 2001 +From: Ajit Khaparde +Date: Thu, 28 Jun 2018 13:15:43 -0700 +Subject: [PATCH] net/bnxt: fix set MTU + +There is no need to update bnxt_hwrm_vnic_plcmode_cfg if new MTU is +not greater than the max data the mbuf can accommodate. + +Fixes: daef48efe5e5 ("net/bnxt: support set MTU") +Cc: stable@dpdk.org + +Signed-off-by: Ajit Khaparde +(cherry picked from commit 42e4af421e80ee4a07730a83fd9a7a6b9a1fbe26) +--- + drivers/net/bnxt/bnxt_ethdev.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c +index 9a6209d6c..775b99cab 100644 +--- a/drivers/net/bnxt/bnxt_ethdev.c ++++ b/drivers/net/bnxt/bnxt_ethdev.c +@@ -1537,6 +1537,7 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) + + for (i = 0; i < bp->nr_vnics; i++) { + struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; ++ uint16_t size = 0; + + vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN + + ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; +@@ -1544,9 +1545,14 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) + if (rc) + break; + +- rc = bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); +- if (rc) +- return rc; ++ size = rte_pktmbuf_data_room_size(bp->rx_queues[0]->mb_pool); ++ size -= RTE_PKTMBUF_HEADROOM; ++ ++ if (size < new_mtu) { ++ rc = bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); ++ if (rc) ++ return rc; ++ } + } + + return rc; +-- +2.17.1 + diff --git a/SOURCES/0001-net-i40e-fix-port-segmentation-fault-when-restart.patch b/SOURCES/0001-net-i40e-fix-port-segmentation-fault-when-restart.patch new file mode 100644 index 0000000..26f5b6d --- /dev/null +++ b/SOURCES/0001-net-i40e-fix-port-segmentation-fault-when-restart.patch @@ -0,0 +1,77 @@ +From aca851c907f7450672fe2b5fecfcbcc3d602bf9c Mon Sep 17 00:00:00 2001 +From: Wei Zhao +Date: Fri, 12 Jan 2018 14:59:19 +0800 +Subject: [PATCH] net/i40e: fix port segmentation fault when restart + +[ upstream commit 37b68eacfc9901f9c30f2127c68ef806e2bd2a61 ] + +This patch will go into the process of clear all queue region +related configuration when dev stop even if there is no queue region +command before, so this is a bug, it may cause error. So add code +to check if there is queue configuration exist when flush queue +region config and remove this process when device stop. Queue region +clear only do when device initialization or PMD get flush command. + +Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush") + +Signed-off-by: Wei Zhao +Acked-by: Qi Zhang +--- + drivers/net/i40e/i40e_ethdev.c | 3 --- + drivers/net/i40e/rte_pmd_i40e.c | 27 ++++++++++++++------------- + 2 files changed, 14 insertions(+), 16 deletions(-) + +diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c +index 5f1faf1..bd83e7b 100644 +--- a/drivers/net/i40e/i40e_ethdev.c ++++ b/drivers/net/i40e/i40e_ethdev.c +@@ -2155,7 +2155,4 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw) + pf->tm_conf.committed = false; + +- /* Remove all the queue region configuration */ +- i40e_flush_queue_region_all_conf(dev, hw, pf, 0); +- + hw->adapter_stopped = 1; + } +diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c +index aeb92af..c2e2466 100644 +--- a/drivers/net/i40e/rte_pmd_i40e.c ++++ b/drivers/net/i40e/rte_pmd_i40e.c +@@ -2846,20 +2846,21 @@ int rte_pmd_i40e_flow_type_mapping_get( + } + +- info->queue_region_number = 1; +- info->region[0].queue_num = main_vsi->nb_used_qps; +- info->region[0].queue_start_index = 0; ++ if (info->queue_region_number) { ++ info->queue_region_number = 1; ++ info->region[0].queue_num = main_vsi->nb_used_qps; ++ info->region[0].queue_start_index = 0; + +- ret = i40e_vsi_update_queue_region_mapping(hw, pf); +- if (ret != I40E_SUCCESS) +- PMD_DRV_LOG(INFO, "Failed to flush queue region mapping."); ++ ret = i40e_vsi_update_queue_region_mapping(hw, pf); ++ if (ret != I40E_SUCCESS) ++ PMD_DRV_LOG(INFO, "Failed to flush queue region mapping."); + +- ret = i40e_dcb_init_configure(dev, TRUE); +- if (ret != I40E_SUCCESS) { +- PMD_DRV_LOG(INFO, "Failed to flush dcb."); +- pf->flags &= ~I40E_FLAG_DCB; ++ ret = i40e_dcb_init_configure(dev, TRUE); ++ if (ret != I40E_SUCCESS) { ++ PMD_DRV_LOG(INFO, "Failed to flush dcb."); ++ pf->flags &= ~I40E_FLAG_DCB; ++ } ++ ++ i40e_init_queue_region_conf(dev); + } +- +- i40e_init_queue_region_conf(dev); +- + return 0; + } +-- +1.8.3.1 + diff --git a/SOURCES/0001-net-nfp-avoid-sysfs-resource-file-access.patch b/SOURCES/0001-net-nfp-avoid-sysfs-resource-file-access.patch new file mode 100644 index 0000000..4685289 --- /dev/null +++ b/SOURCES/0001-net-nfp-avoid-sysfs-resource-file-access.patch @@ -0,0 +1,69 @@ +From b742910272bb95daf42ab449c1077afa4aa79142 Mon Sep 17 00:00:00 2001 +From: Alejandro Lucero +Date: Tue, 26 Jun 2018 14:25:40 +0100 +Subject: [PATCH 1/2] net/nfp: avoid sysfs resource file access + +Getting the bar size is required for NFP CPP interface configuration. +However, this information can be obtained from the VFIO or UIO driver +instead of accessing the sysfs resource file. + +Signed-off-by: Alejandro Lucero +(cherry picked from commit e3cfaf02dcd88635ac614a1e1a8efe45d38ea4c9) +--- + drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 28 +++++----------------- + 1 file changed, 6 insertions(+), 22 deletions(-) + +diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +index 7d132baa9..9accc89cf 100644 +--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c ++++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +@@ -761,32 +761,16 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp) + } + + static int +-nfp6000_set_barsz(struct nfp_pcie_user *desc) ++nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc) + { +- char tmp_str[80]; +- unsigned long start, end, flags, tmp; +- int i; +- FILE *fp; +- +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/resource", PCI_DEVICES, +- desc->busdev); +- +- fp = fopen(tmp_str, "r"); +- if (!fp) +- return -1; ++ unsigned long tmp; ++ int i = 0; + +- if (fscanf(fp, "0x%lx 0x%lx 0x%lx", &start, &end, &flags) == 0) { +- printf("error reading resource file for bar size\n"); +- return -1; +- } ++ tmp = dev->mem_resource[0].len; + +- if (fclose(fp) == -1) +- return -1; +- +- tmp = (end - start) + 1; +- i = 0; + while (tmp >>= 1) + i++; ++ + desc->barsz = i; + return 0; + } +@@ -839,7 +823,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) + return -1; + if (nfp6000_set_serial(dev, cpp) < 0) + return -1; +- if (nfp6000_set_barsz(desc) < 0) ++ if (nfp6000_set_barsz(dev, desc) < 0) + return -1; + + desc->cfg = (char *)mmap(0, 1 << (desc->barsz - 3), +-- +2.17.1 + diff --git a/SOURCES/0001-net-nfp-use-generic-PCI-config-access-functions.patch b/SOURCES/0001-net-nfp-use-generic-PCI-config-access-functions.patch new file mode 100644 index 0000000..e496a48 --- /dev/null +++ b/SOURCES/0001-net-nfp-use-generic-PCI-config-access-functions.patch @@ -0,0 +1,336 @@ +From b419d9b1803882a15cf1448448720daaf568f21b Mon Sep 17 00:00:00 2001 +From: Alejandro Lucero +Date: Mon, 18 Jun 2018 21:06:12 +0100 +Subject: [PATCH] net/nfp: use generic PCI config access functions + +This patch avoids direct access to device config sysfs file using +rte_pci_read_config instead. + +Apart from replicating code, it turns out this direct access does +not always work if non-root users execute DPDK apps. In those cases +it is mandatory to go through VFIO specific function for reading pci +config space. + +Signed-off-by: Alejandro Lucero +(cherry picked from commit caab11ea33f02d9a0869890b48e371f928090279) +--- + drivers/net/nfp/nfp_net.c | 4 +- + drivers/net/nfp/nfpcore/nfp_cpp.h | 6 +- + drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 111 +++++++-------------- + drivers/net/nfp/nfpcore/nfp_cppcore.c | 9 +- + 4 files changed, 47 insertions(+), 83 deletions(-) + +diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c +index 71249572d..62db54d8b 100644 +--- a/drivers/net/nfp/nfp_net.c ++++ b/drivers/net/nfp/nfp_net.c +@@ -3154,9 +3154,9 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + * use a lock file if UIO is being used. + */ + if (dev->kdrv == RTE_KDRV_VFIO) +- cpp = nfp_cpp_from_device_name(dev->device.name, 0); ++ cpp = nfp_cpp_from_device_name(dev, 0); + else +- cpp = nfp_cpp_from_device_name(dev->device.name, 1); ++ cpp = nfp_cpp_from_device_name(dev, 1); + + if (!cpp) { + RTE_LOG(ERR, PMD, "A CPP handle can not be obtained"); +diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h +index de2ff84e9..1427954c1 100644 +--- a/drivers/net/nfp/nfpcore/nfp_cpp.h ++++ b/drivers/net/nfp/nfpcore/nfp_cpp.h +@@ -6,6 +6,8 @@ + #ifndef __NFP_CPP_H__ + #define __NFP_CPP_H__ + ++#include ++ + #include "nfp-common/nfp_platform.h" + #include "nfp-common/nfp_resid.h" + +@@ -54,7 +56,7 @@ struct nfp_cpp_operations { + size_t area_priv_size; + + /* Instance an NFP CPP */ +- int (*init)(struct nfp_cpp *cpp, const char *devname); ++ int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev); + + /* + * Free the bus. +@@ -181,7 +183,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp); + * + * @return NFP CPP handle, or NULL on failure (and set errno accordingly). + */ +-struct nfp_cpp *nfp_cpp_from_device_name(const char *devname, ++struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev, + int driver_lock_needed); + + /* +diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +index e46dbc7d7..7d132baa9 100644 +--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c ++++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +@@ -32,6 +32,7 @@ + #include + #include + ++#include + #include "nfp_cpp.h" + #include "nfp_target.h" + #include "nfp6000/nfp6000.h" +@@ -638,61 +639,32 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc) + } + + static int +-nfp6000_set_model(struct nfp_pcie_user *desc, struct nfp_cpp *cpp) ++nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp) + { +- char tmp_str[80]; +- uint32_t tmp; +- int fp; +- +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/config", PCI_DEVICES, +- desc->busdev); +- +- fp = open(tmp_str, O_RDONLY); +- if (!fp) +- return -1; +- +- lseek(fp, 0x2e, SEEK_SET); ++ uint32_t model; + +- if (read(fp, &tmp, sizeof(tmp)) != sizeof(tmp)) { +- printf("Error reading config file for model\n"); ++ if (rte_pci_read_config(dev, &model, 4, 0x2e) < 0) { ++ printf("nfp set model failed\n"); + return -1; + } + +- tmp = tmp << 16; +- +- if (close(fp) == -1) +- return -1; +- +- nfp_cpp_model_set(cpp, tmp); ++ model = model << 16; ++ nfp_cpp_model_set(cpp, model); + + return 0; + } + + static int +-nfp6000_set_interface(struct nfp_pcie_user *desc, struct nfp_cpp *cpp) ++nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp) + { +- char tmp_str[80]; +- uint16_t tmp; +- int fp; +- +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/config", PCI_DEVICES, +- desc->busdev); ++ uint16_t interface; + +- fp = open(tmp_str, O_RDONLY); +- if (!fp) +- return -1; +- +- lseek(fp, 0x154, SEEK_SET); +- +- if (read(fp, &tmp, sizeof(tmp)) != sizeof(tmp)) { +- printf("error reading config file for interface\n"); ++ if (rte_pci_read_config(dev, &interface, 2, 0x154) < 0) { ++ printf("nfp set interface failed\n"); + return -1; + } + +- if (close(fp) == -1) +- return -1; +- +- nfp_cpp_interface_set(cpp, tmp); ++ nfp_cpp_interface_set(cpp, interface); + + return 0; + } +@@ -703,7 +675,7 @@ nfp6000_set_interface(struct nfp_pcie_user *desc, struct nfp_cpp *cpp) + #define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) + #define PCI_EXT_CAP_ID_DSN 0x03 + static int +-nfp_pci_find_next_ext_capability(int fp, int cap) ++nfp_pci_find_next_ext_capability(struct rte_pci_device *dev, int cap) + { + uint32_t header; + int ttl; +@@ -712,9 +684,8 @@ nfp_pci_find_next_ext_capability(int fp, int cap) + /* minimum 8 bytes per capability */ + ttl = (PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) / 8; + +- lseek(fp, pos, SEEK_SET); +- if (read(fp, &header, sizeof(header)) != sizeof(header)) { +- printf("error reading config file for serial\n"); ++ if (rte_pci_read_config(dev, &header, 4, pos) < 0) { ++ printf("nfp error reading extended capabilities\n"); + return -1; + } + +@@ -733,9 +704,8 @@ nfp_pci_find_next_ext_capability(int fp, int cap) + if (pos < PCI_CFG_SPACE_SIZE) + break; + +- lseek(fp, pos, SEEK_SET); +- if (read(fp, &header, sizeof(header)) != sizeof(header)) { +- printf("error reading config file for serial\n"); ++ if (rte_pci_read_config(dev, &header, 4, pos) < 0) { ++ printf("nfp error reading extended capabilities\n"); + return -1; + } + } +@@ -744,56 +714,47 @@ nfp_pci_find_next_ext_capability(int fp, int cap) + } + + static int +-nfp6000_set_serial(struct nfp_pcie_user *desc, struct nfp_cpp *cpp) ++nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp) + { +- char tmp_str[80]; + uint16_t tmp; + uint8_t serial[6]; + int serial_len = 6; +- int fp, pos; ++ int pos; + +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/config", PCI_DEVICES, +- desc->busdev); +- +- fp = open(tmp_str, O_RDONLY); +- if (!fp) +- return -1; +- +- pos = nfp_pci_find_next_ext_capability(fp, PCI_EXT_CAP_ID_DSN); ++ pos = nfp_pci_find_next_ext_capability(dev, PCI_EXT_CAP_ID_DSN); + if (pos <= 0) { +- printf("PCI_EXT_CAP_ID_DSN not found. Using default offset\n"); +- lseek(fp, 0x156, SEEK_SET); ++ printf("PCI_EXT_CAP_ID_DSN not found. nfp set serial failed\n"); ++ return -1; + } else { +- lseek(fp, pos + 6, SEEK_SET); ++ pos += 6; + } + +- if (read(fp, &tmp, sizeof(tmp)) != sizeof(tmp)) { +- printf("error reading config file for serial\n"); ++ if (rte_pci_read_config(dev, &tmp, 2, pos) < 0) { ++ printf("nfp set serial failed\n"); + return -1; + } + + serial[4] = (uint8_t)((tmp >> 8) & 0xff); + serial[5] = (uint8_t)(tmp & 0xff); + +- if (read(fp, &tmp, sizeof(tmp)) != sizeof(tmp)) { +- printf("error reading config file for serial\n"); ++ pos += 2; ++ if (rte_pci_read_config(dev, &tmp, 2, pos) < 0) { ++ printf("nfp set serial failed\n"); + return -1; + } + + serial[2] = (uint8_t)((tmp >> 8) & 0xff); + serial[3] = (uint8_t)(tmp & 0xff); + +- if (read(fp, &tmp, sizeof(tmp)) != sizeof(tmp)) { +- printf("error reading config file for serial\n"); ++ pos += 2; ++ if (rte_pci_read_config(dev, &tmp, 2, pos) < 0) { ++ printf("nfp set serial failed\n"); + return -1; + } + + serial[0] = (uint8_t)((tmp >> 8) & 0xff); + serial[1] = (uint8_t)(tmp & 0xff); + +- if (close(fp) == -1) +- return -1; +- + nfp_cpp_serial_set(cpp, serial, serial_len); + + return 0; +@@ -831,7 +792,7 @@ nfp6000_set_barsz(struct nfp_pcie_user *desc) + } + + static int +-nfp6000_init(struct nfp_cpp *cpp, const char *devname) ++nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) + { + char link[120]; + char tmp_str[80]; +@@ -846,7 +807,7 @@ nfp6000_init(struct nfp_cpp *cpp, const char *devname) + + + memset(desc->busdev, 0, BUSDEV_SZ); +- strncpy(desc->busdev, devname, strlen(devname)); ++ strncpy(desc->busdev, dev->device.name, sizeof(desc->busdev)); + + if (cpp->driver_lock_needed) { + ret = nfp_acquire_process_lock(desc); +@@ -872,11 +833,11 @@ nfp6000_init(struct nfp_cpp *cpp, const char *devname) + if (desc->device == -1) + return -1; + +- if (nfp6000_set_model(desc, cpp) < 0) ++ if (nfp6000_set_model(dev, cpp) < 0) + return -1; +- if (nfp6000_set_interface(desc, cpp) < 0) ++ if (nfp6000_set_interface(dev, cpp) < 0) + return -1; +- if (nfp6000_set_serial(desc, cpp) < 0) ++ if (nfp6000_set_serial(dev, cpp) < 0) + return -1; + if (nfp6000_set_barsz(desc) < 0) + return -1; +diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c +index f61143f7e..75d3c9748 100644 +--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c ++++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c +@@ -12,6 +12,7 @@ + #include + + #include ++#include + + #include "nfp_cpp.h" + #include "nfp_target.h" +@@ -542,7 +543,7 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value) + } + + static struct nfp_cpp * +-nfp_cpp_alloc(const char *devname, int driver_lock_needed) ++nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed) + { + const struct nfp_cpp_operations *ops; + struct nfp_cpp *cpp; +@@ -561,7 +562,7 @@ nfp_cpp_alloc(const char *devname, int driver_lock_needed) + cpp->driver_lock_needed = driver_lock_needed; + + if (cpp->op->init) { +- err = cpp->op->init(cpp, devname); ++ err = cpp->op->init(cpp, dev); + if (err < 0) { + free(cpp); + return NULL; +@@ -604,9 +605,9 @@ nfp_cpp_free(struct nfp_cpp *cpp) + } + + struct nfp_cpp * +-nfp_cpp_from_device_name(const char *devname, int driver_lock_needed) ++nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed) + { +- return nfp_cpp_alloc(devname, driver_lock_needed); ++ return nfp_cpp_alloc(dev, driver_lock_needed); + } + + /* +-- +2.17.1 + diff --git a/SOURCES/0001-net-qede-fix-memory-alloc-for-multiple-port-reconfig.patch b/SOURCES/0001-net-qede-fix-memory-alloc-for-multiple-port-reconfig.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-vhost-fix-missing-increment-of-log-cache-count.patch b/SOURCES/0001-vhost-fix-missing-increment-of-log-cache-count.patch new file mode 100644 index 0000000..44a1d7a --- /dev/null +++ b/SOURCES/0001-vhost-fix-missing-increment-of-log-cache-count.patch @@ -0,0 +1,35 @@ +From ed06ea24dc419a55fd5e9a1601f1144434360eda Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Fri, 15 Jun 2018 15:48:46 +0200 +Subject: [PATCH] vhost: fix missing increment of log cache count + +The log_cache_nb_elem was never incremented, resulting +in all dirty pages to be missed during live migration. + +Fixes: c16915b87109 ("vhost: improve dirty pages logging performance") +Cc: stable@dpdk.org + +Reported-by: Peng He +Signed-off-by: Maxime Coquelin +Acked-by: Ilya Maximets +Reviewed-by: Tiwei Bie +(cherry picked from commit 511b413bbcbd711dcf582485a72213fa90595cbe) +--- + lib/librte_vhost/vhost.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h +index e0ab65e0c..429b974db 100644 +--- a/lib/librte_vhost/vhost.h ++++ b/lib/librte_vhost/vhost.h +@@ -387,6 +387,7 @@ vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq, + + vq->log_cache[i].offset = offset; + vq->log_cache[i].val = (1UL << bit_nr); ++ vq->log_cache_nb_elem++; + } + + static __rte_always_inline void +-- +2.17.1 + diff --git a/SOURCES/0002-net-nfp-avoid-access-to-sysfs-resource0-file.patch b/SOURCES/0002-net-nfp-avoid-access-to-sysfs-resource0-file.patch new file mode 100644 index 0000000..b82b0fe --- /dev/null +++ b/SOURCES/0002-net-nfp-avoid-access-to-sysfs-resource0-file.patch @@ -0,0 +1,116 @@ +From 7ecfd061afed55cbbd5c82802bc288ed67bf2cb3 Mon Sep 17 00:00:00 2001 +From: Alejandro Lucero +Date: Tue, 26 Jun 2018 14:29:21 +0100 +Subject: [PATCH 2/2] net/nfp: avoid access to sysfs resource0 file + +NFP CPP interface dinamically configures NFP CPP BARs for accessing +any NFP chip component from user space. This requires to map PCI BAR +regions specifically. However, this does not require to do such map +over the usual map done by VFIO or UIO drivers with the device PCI +BARs. + +This patch avoids this remapping and therefore also avoids to access +the device sysfs resource0 file for doing that remapping. + +Signed-off-by: Alejandro Lucero +(cherry picked from commit a28fb7bef424d3b96ff13b996de7ed8775c67542) +--- + drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 44 +--------------------- + 1 file changed, 2 insertions(+), 42 deletions(-) + +diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +index 9accc89cf..73124487a 100644 +--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c ++++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +@@ -309,13 +309,8 @@ nfp_enable_bars(struct nfp_pcie_user *nfp) + bar->csr = nfp->cfg + + NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(bar->index >> 3, + bar->index & 7); +- bar->iomem = +- (char *)mmap(0, 1 << bar->bitsize, PROT_READ | PROT_WRITE, +- MAP_SHARED, nfp->device, +- bar->index << bar->bitsize); + +- if (bar->iomem == MAP_FAILED) +- return (-ENOMEM); ++ bar->iomem = nfp->cfg + (bar->index << bar->bitsize); + } + return 0; + } +@@ -345,7 +340,6 @@ nfp_disable_bars(struct nfp_pcie_user *nfp) + for (x = ARRAY_SIZE(nfp->bar); x > 0; x--) { + bar = &nfp->bar[x - 1]; + if (bar->iomem) { +- munmap(bar->iomem, 1 << (nfp->barsz - 3)); + bar->iomem = NULL; + bar->lock = 0; + } +@@ -778,9 +772,6 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc) + static int + nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) + { +- char link[120]; +- char tmp_str[80]; +- ssize_t size; + int ret = 0; + uint32_t model; + struct nfp_pcie_user *desc; +@@ -799,24 +790,6 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) + return -1; + } + +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/driver", PCI_DEVICES, +- desc->busdev); +- +- size = readlink(tmp_str, link, sizeof(link)); +- +- if (size == -1) +- tmp_str[0] = '\0'; +- +- if (size == sizeof(link)) +- tmp_str[0] = '\0'; +- +- snprintf(tmp_str, sizeof(tmp_str), "%s/%s/resource0", PCI_DEVICES, +- desc->busdev); +- +- desc->device = open(tmp_str, O_RDWR); +- if (desc->device == -1) +- return -1; +- + if (nfp6000_set_model(dev, cpp) < 0) + return -1; + if (nfp6000_set_interface(dev, cpp) < 0) +@@ -826,12 +799,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) + if (nfp6000_set_barsz(dev, desc) < 0) + return -1; + +- desc->cfg = (char *)mmap(0, 1 << (desc->barsz - 3), +- PROT_READ | PROT_WRITE, +- MAP_SHARED, desc->device, 0); +- +- if (desc->cfg == MAP_FAILED) +- return -1; ++ desc->cfg = (char *)dev->mem_resource[0].addr; + + nfp_enable_bars(desc); + +@@ -847,16 +815,8 @@ static void + nfp6000_free(struct nfp_cpp *cpp) + { + struct nfp_pcie_user *desc = nfp_cpp_priv(cpp); +- int x; + +- /* Unmap may cause if there are any pending transaxctions */ + nfp_disable_bars(desc); +- munmap(desc->cfg, 1 << (desc->barsz - 3)); +- +- for (x = ARRAY_SIZE(desc->bar); x > 0; x--) { +- if (desc->bar[x - 1].iomem) +- munmap(desc->bar[x - 1].iomem, 1 << (desc->barsz - 3)); +- } + if (cpp->driver_lock_needed) + close(desc->lock); + close(desc->device); +-- +2.17.1 + diff --git a/SPECS/dpdk.spec b/SPECS/dpdk.spec index cc52ff4..f20d505 100644 --- a/SPECS/dpdk.spec +++ b/SPECS/dpdk.spec @@ -5,7 +5,7 @@ # Dont edit Version: and Release: directly, only these: %define ver 17.11 -%define rel 11 +%define rel 13 %define srcname dpdk # Define when building git snapshots @@ -115,12 +115,20 @@ Patch522: 0002-eal-fix-build-on-FreeBSD.patch # Bug 1552465 Patch530: 0001-vhost-improve-dirty-pages-logging-performance.patch +# Bug 1598752 +Patch532: 0001-vhost-fix-missing-increment-of-log-cache-count.patch # Bug 1583161 Patch540: 0001-net-nfp-configure-default-RSS-reta-table.patch -# Bug 1583670 +# Bug 1568301 +## Bug 1583670 Patch545: 0001-net-nfp-fix-lock-file-usage.patch +## Bug 1594740 +Patch547: 0001-net-nfp-use-generic-PCI-config-access-functions.patch +## Bug 1596324 +Patch548: 0001-net-nfp-avoid-sysfs-resource-file-access.patch +Patch549: 0002-net-nfp-avoid-access-to-sysfs-resource0-file.patch # Bug 1578981 Patch550: 0001-net-qede-fix-L2-handles-used-for-RSS-hash-update.patch @@ -135,6 +143,12 @@ Patch560: 0001-net-qede-fix-memory-alloc-for-multiple-port-reconfig.patch Patch570: 0001-net-mlx5-fix-memory-region-cache-lookup.patch Patch571: 0001-net-mlx5-fix-memory-region-boundary-checks.patch +# Bug 1589264 +Patch575: 0001-net-bnxt-fix-set-MTU.patch + +# Bug 1610481 +Patch580: 0001-net-i40e-fix-port-segmentation-fault-when-restart.patch + # Patches only in dpdk package Patch700: 0001-net-mlx-fix-rdma-core-glue-path-with-EAL-plugins.patch @@ -284,8 +298,9 @@ rm -rf %{buildroot}%{sdkdir}/usertools rm -rf %{buildroot}%{_sbindir}/dpdk-devbind %endif rm -f %{buildroot}%{sdkdir}/usertools/dpdk-setup.sh +rm -f %{buildroot}%{_bindir}/dpdk-pmdinfo rm -f %{buildroot}%{_bindir}/dpdk-test-crypto-perf -rm -rf %{buildroot}%{_bindir}/dpdk-test-eventdev +rm -f %{buildroot}%{_bindir}/dpdk-test-eventdev %if %{with examples} find %{target}/examples/ -name "*.map" | xargs rm -f @@ -352,7 +367,6 @@ sed -i -e 's:-%{machine_tmpl}-:-%{machine}-:g' %{buildroot}/%{_sysconfdir}/profi %files examples %exclude %{_bindir}/dpdk-procinfo %exclude %{_bindir}/dpdk-pdump -%exclude %{_bindir}/dpdk-pmdinfo %{_bindir}/dpdk-* %doc %{sdkdir}/examples/ %endif @@ -361,10 +375,16 @@ sed -i -e 's:-%{machine_tmpl}-:-%{machine}-:g' %{buildroot}/%{_sysconfdir}/profi %files tools %{sdkdir}/usertools/ %{_sbindir}/dpdk-devbind -%{_bindir}/dpdk-pmdinfo %endif %changelog +* Tue Jul 31 2018 Timothy Redaelli - 17.11-13 +- Re-align with DPDK patches inside OVS FDP 18.08 (#1610407) +- Backport "net/i40e: fix port segmentation fault when restart" (#1610481) + +* Mon Jul 23 2018 Timothy Redaelli - 17.11-12 +- Remove dpdk-pmdinfo (#1494462) + * Thu Jun 14 2018 Timothy Redaelli - 17.11-11 - Re-align with DPDK patches inside OVS FDP 18.06 (#1591198)