Skip to content

Commit

Permalink
merge to dpdk 21.02
Browse files Browse the repository at this point in the history
Signed-off-by: Hanoch Haim <[email protected]>
  • Loading branch information
hhaim committed Feb 15, 2021
1 parent 0ccdcbb commit b351894
Show file tree
Hide file tree
Showing 618 changed files with 15,276 additions and 6,976 deletions.
3 changes: 3 additions & 0 deletions linux_dpdk/ws_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,9 +1389,12 @@ def getstatusoutput(cmd):
'drivers/net/memif/rte_eth_memif.c',

#virtio
'drivers/net/virtio/virtio.c',
'drivers/net/virtio/virtio_ethdev.c',
'drivers/net/virtio/virtio_pci.c',
'drivers/net/virtio/virtio_pci_ethdev.c',
'drivers/net/virtio/virtio_rxtx.c',


#'drivers/net/virtio/virtio_rxtx_packed.c',

Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/dpaa/dpaa_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/dpaa/include/fman.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <stdbool.h>
#include <net/if.h>

#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_ether.h>

#include <compat.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/fslmc/fslmc_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_mbuf_dyn.h>

#include <rte_fslmc.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/fslmc/fslmc_vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <eal_filesystem.h>
#include <rte_mbuf.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_mbuf_pool_ops.h>

#include <fslmc_logs.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>

#include <fslmc_logs.h>
#include <rte_fslmc.h>
Expand Down
2 changes: 1 addition & 1 deletion src/dpdk/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include<sys/eventfd.h>

#include <rte_mbuf.h>
#include <rte_ethdev_driver.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
Expand Down
6 changes: 6 additions & 0 deletions src/dpdk/drivers/bus/vdev/rte_bus_vdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ struct rte_vdev_device {
#define RTE_DEV_TO_VDEV_CONST(ptr) \
container_of(ptr, const struct rte_vdev_device, device)

#define RTE_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device)

static inline const char *
rte_vdev_device_name(const struct rte_vdev_device *dev)
{
Expand Down Expand Up @@ -111,8 +113,12 @@ struct rte_vdev_driver {
rte_vdev_remove_t *remove; /**< Virtual device remove function. */
rte_vdev_dma_map_t *dma_map; /**< Virtual device DMA map function. */
rte_vdev_dma_unmap_t *dma_unmap; /**< Virtual device DMA unmap function. */
uint32_t drv_flags; /**< Flags RTE_VDEV_DRV_*. */
};

/** Device driver needs IOVA as VA and cannot work with IOVA as PA */
#define RTE_VDEV_DRV_NEED_IOVA_AS_VA 0x0001

/**
* Register a virtual device driver.
*
Expand Down
29 changes: 29 additions & 0 deletions src/dpdk/drivers/bus/vdev/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)
{
const char *name;
struct rte_vdev_driver *driver;
enum rte_iova_mode iova_mode;
int ret;

if (rte_dev_is_probed(&dev->device))
Expand All @@ -199,6 +200,14 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev)

if (vdev_parse(name, &driver))
return -1;

iova_mode = rte_eal_iova_mode();
if ((driver->drv_flags & RTE_VDEV_DRV_NEED_IOVA_AS_VA) && (iova_mode == RTE_IOVA_PA)) {
VDEV_LOG(ERR, "%s requires VA IOVA mode but current mode is PA, not initializing",
name);
return -1;
}

ret = driver->probe(dev);
if (ret == 0)
dev->device.driver = &driver->driver;
Expand Down Expand Up @@ -594,6 +603,25 @@ vdev_unplug(struct rte_device *dev)
return rte_vdev_uninit(dev->name);
}

static enum rte_iova_mode
vdev_get_iommu_class(void)
{
const char *name;
struct rte_vdev_device *dev;
struct rte_vdev_driver *driver;

TAILQ_FOREACH(dev, &vdev_device_list, next) {
name = rte_vdev_device_name(dev);
if (vdev_parse(name, &driver))
continue;

if (driver->drv_flags & RTE_VDEV_DRV_NEED_IOVA_AS_VA)
return RTE_IOVA_VA;
}

return RTE_IOVA_DC;
}

static struct rte_bus rte_vdev_bus = {
.scan = vdev_scan,
.probe = vdev_probe,
Expand All @@ -603,6 +631,7 @@ static struct rte_bus rte_vdev_bus = {
.parse = vdev_parse,
.dma_map = vdev_dma_map,
.dma_unmap = vdev_dma_unmap,
.get_iommu_class = vdev_get_iommu_class,
.dev_iterate = rte_vdev_dev_iterate,
};

Expand Down
67 changes: 56 additions & 11 deletions src/dpdk/drivers/common/iavf/virtchnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ enum virtchnl_ops {
VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2 = 55,
VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 = 56,
VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2 = 57,
VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2 = 58,
VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 = 59,
VIRTCHNL_OP_ENABLE_QUEUES_V2 = 107,
VIRTCHNL_OP_DISABLE_QUEUES_V2 = 108,
VIRTCHNL_OP_MAP_QUEUE_VECTOR = 111,
Expand Down Expand Up @@ -258,6 +260,10 @@ static inline const char *virtchnl_op_str(enum virtchnl_ops v_opcode)
return "VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2";
case VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2:
return "VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2";
case VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2:
return "VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2";
case VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2:
return "VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2";
case VIRTCHNL_OP_MAX:
return "VIRTCHNL_OP_MAX";
default:
Expand Down Expand Up @@ -914,13 +920,13 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);
*
* In order to enable inner (again note that in this case inner is the outer
* most or single VLAN from the VF's perspective) VLAN stripping for 0x8100
* VLANs, the VF would populate the virtchnl_vlan_offload structure in the
* VLANs, the VF would populate the virtchnl_vlan_setting structure in the
* following manner and send the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 message.
*
* virtchnl_vlan_offload.inner_ethertype_setting =
* virtchnl_vlan_setting.inner_ethertype_setting =
* VIRTCHNL_VLAN_ETHERTYPE_8100;
*
* virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on
* virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on
* initialization.
*
* The reason that VLAN TPID(s) are not being used for the
Expand Down Expand Up @@ -952,11 +958,11 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);
* would populate the virthcnl_vlan_offload_structure in the following manner
* and send the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 message.
*
* virtchnl_vlan_offload.outer_ethertype_setting =
* virtchnl_vlan_setting.outer_ethertype_setting =
* VIRTHCNL_VLAN_ETHERTYPE_8100 |
* VIRTHCNL_VLAN_ETHERTYPE_88A8;
*
* virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on
* virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on
* initialization.
*
* There is also the case where a PF and the underlying hardware can support
Expand All @@ -981,24 +987,61 @@ VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_vlan_filter_list_v2);
* VIRTCHNL_ETHERTYPE_STRIPPING_MATCHES_INSERTION;
*
* In order to enable outer VLAN stripping for 0x88a8 VLANs, the VF would
* populate the virtchnl_vlan_offload_structure in the following manner and send
* populate the virtchnl_vlan_setting structure in the following manner and send
* the VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2. Also, this will change the
* ethertype for VLAN insertion if it's enabled. So, for completeness, a
* VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2 with the same ethertype should be sent.
*
* virtchnl_vlan_offload.outer_ethertype_setting = VIRTHCNL_VLAN_ETHERTYPE_88A8;
* virtchnl_vlan_setting.outer_ethertype_setting = VIRTHCNL_VLAN_ETHERTYPE_88A8;
*
* virtchnl_vlan_offload.vport_id = vport_id or vsi_id assigned to the VF on
* virtchnl_vlan_setting.vport_id = vport_id or vsi_id assigned to the VF on
* initialization.
*
* VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2
* VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2
*
* VF sends this message to enable or disable VLAN filtering. It also needs to
* specify an ethertype. The VF knows which VLAN ethertypes are allowed and
* whether or not it's allowed to enable/disable filtering via the
* VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS message. The VF needs to
* parse the virtchnl_vlan_caps.filtering fields to determine which, if any,
* filtering messages are allowed.
*
* For example, if the PF populates the virtchnl_vlan_caps.filtering in the
* following manner the VF will be allowed to enable/disable 0x8100 and 0x88a8
* outer VLAN filtering together. Note, that the VIRTCHNL_VLAN_ETHERTYPE_AND
* means that all filtering ethertypes will to be enabled and disabled together
* regardless of the request from the VF. This means that the underlying
* hardware only supports VLAN filtering for all VLAN the specified ethertypes
* or none of them.
*
* virtchnl_vlan_caps.filtering.filtering_support.outer =
* VIRTCHNL_VLAN_TOGGLE |
* VIRTCHNL_VLAN_ETHERTYPE_8100 |
* VIRTHCNL_VLAN_ETHERTYPE_88A8 |
* VIRTCHNL_VLAN_ETHERTYPE_9100 |
* VIRTCHNL_VLAN_ETHERTYPE_AND;
*
* In order to enable outer VLAN filtering for 0x88a8 and 0x8100 VLANs (0x9100
* VLANs aren't supported by the VF driver), the VF would populate the
* virtchnl_vlan_setting structure in the following manner and send the
* VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2. The same message format would be used
* to disable outer VLAN filtering for 0x88a8 and 0x8100 VLANs, but the
* VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2 opcode is used.
*
* virtchnl_vlan_setting.outer_ethertype_setting =
* VIRTCHNL_VLAN_ETHERTYPE_8100 |
* VIRTCHNL_VLAN_ETHERTYPE_88A8;
*
*/
struct virtchnl_vlan_offload {
struct virtchnl_vlan_setting {
u32 outer_ethertype_setting;
u32 inner_ethertype_setting;
u16 vport_id;
u8 pad[6];
};

VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vlan_offload);
VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vlan_setting);

/* VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE
* VF sends VSI id and flags.
Expand Down Expand Up @@ -2017,7 +2060,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,
case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2:
case VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2:
case VIRTCHNL_OP_DISABLE_VLAN_INSERTION_V2:
valid_len = sizeof(struct virtchnl_vlan_offload);
case VIRTCHNL_OP_ENABLE_VLAN_FILTERING_V2:
case VIRTCHNL_OP_DISABLE_VLAN_FILTERING_V2:
valid_len = sizeof(struct virtchnl_vlan_setting);
break;
case VIRTCHNL_OP_ENABLE_QUEUES_V2:
case VIRTCHNL_OP_DISABLE_QUEUES_V2:
Expand Down
3 changes: 2 additions & 1 deletion src/dpdk/drivers/common/mlx5/linux/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ endif
libnames = [ 'mlx5', 'ibverbs' ]
libs = []
foreach libname:libnames
lib = dependency('lib' + libname, static:static_ibverbs, required:false)
lib = dependency('lib' + libname, static:static_ibverbs,
required:false, method: 'pkg-config')
if not lib.found() and not static_ibverbs
lib = cc.find_library(libname, required:false)
endif
Expand Down
20 changes: 15 additions & 5 deletions src/dpdk/drivers/common/mlx5/linux/mlx5_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,21 @@ mlx5_nl_mac_addr_sync(int nlsk_fd, unsigned int iface_idx,
break;
if (j != n)
continue;
/* Find the first entry available. */
for (j = 0; j != n; ++j) {
if (rte_is_zero_ether_addr(&mac_addrs[j])) {
mac_addrs[j] = macs[i];
break;
if (rte_is_multicast_ether_addr(&macs[i])) {
/* Find the first entry available. */
for (j = MLX5_MAX_UC_MAC_ADDRESSES; j != n; ++j) {
if (rte_is_zero_ether_addr(&mac_addrs[j])) {
mac_addrs[j] = macs[i];
break;
}
}
} else {
/* Find the first entry available. */
for (j = 0; j != MLX5_MAX_UC_MAC_ADDRESSES; ++j) {
if (rte_is_zero_ether_addr(&mac_addrs[j])) {
mac_addrs[j] = macs[i];
break;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/dpdk/drivers/common/mlx5/mlx5_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ enum mlx5_class {
MLX5_CLASS_NET = RTE_BIT64(0),
MLX5_CLASS_VDPA = RTE_BIT64(1),
MLX5_CLASS_REGEX = RTE_BIT64(2),
MLX5_CLASS_COMPRESS = RTE_BIT64(3),
};

#define MLX5_DBR_SIZE RTE_CACHE_LINE_SIZE
Expand Down
7 changes: 7 additions & 0 deletions src/dpdk/drivers/common/mlx5/mlx5_common_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ static const struct {
{ .name = "vdpa", .driver_class = MLX5_CLASS_VDPA },
{ .name = "net", .driver_class = MLX5_CLASS_NET },
{ .name = "regex", .driver_class = MLX5_CLASS_REGEX },
{ .name = "compress", .driver_class = MLX5_CLASS_COMPRESS },
};

static const unsigned int mlx5_class_combinations[] = {
MLX5_CLASS_NET,
MLX5_CLASS_VDPA,
MLX5_CLASS_REGEX,
MLX5_CLASS_COMPRESS,
MLX5_CLASS_NET | MLX5_CLASS_REGEX,
MLX5_CLASS_VDPA | MLX5_CLASS_REGEX,
MLX5_CLASS_NET | MLX5_CLASS_COMPRESS,
MLX5_CLASS_VDPA | MLX5_CLASS_COMPRESS,
MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
MLX5_CLASS_NET | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
MLX5_CLASS_VDPA | MLX5_CLASS_REGEX | MLX5_CLASS_COMPRESS,
/* New class combination should be added here. */
};

Expand Down
36 changes: 18 additions & 18 deletions src/dpdk/drivers/common/mlx5/mlx5_common_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
* @file
*
* RTE Mellanox PCI Driver Interface
* Mellanox ConnectX PCI device supports multiple class (net/vdpa/regex)
* devices. This layer enables creating such multiple class of devices on a
* single PCI device by allowing to bind multiple class specific device
* Mellanox ConnectX PCI device supports multiple class: net,vdpa,regex and
* compress devices. This layer enables creating such multiple class of devices
* on a single PCI device by allowing to bind multiple class specific device
* driver to attach to mlx5_pci driver.
*
* ----------- ------------ -------------
* | mlx5 | | mlx5 | | mlx5 |
* | net pmd | | vdpa pmd | | regex pmd |
* ----------- ------------ -------------
* \ | /
* \ | /
* \ -------------- /
* \______| mlx5 |_____ /
* | pci common |
* --------------
* |
* -----------
* | mlx5 |
* | pci dev |
* -----------
* ----------- ------------ ------------- ----------------
* | mlx5 | | mlx5 | | mlx5 | | mlx5 |
* | net pmd | | vdpa pmd | | regex pmd | | compress pmd |
* ----------- ------------ ------------- ----------------
* \ \ / /
* \ \ / /
* \ \_--------------_/ /
* \_______________| mlx5 |_______________/
* | pci common |
* --------------
* |
* -----------
* | mlx5 |
* | pci dev |
* -----------
*
* - mlx5 pci driver binds to mlx5 PCI devices defined by PCI
* ID table of all related mlx5 PCI devices.
Expand Down
Loading

0 comments on commit b351894

Please sign in to comment.