mlx4: remove old VMware compatibility code
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Wed, 25 Mar 2015 10:34:31 +0000 (11:34 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 26 Mar 2015 21:33:41 +0000 (22:33 +0100)
CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE has no effect since this option enables
MLX4_PMD_COMPAT_VMWARE. This macro is not used by the PMD which expects
MLX4_COMPAT_VMWARE instead.

Because this option does not work and the related code is no longer useful
for VMware (as it actually supports the flow steering API), remove it
entirely.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
config/common_bsdapp
config/common_linuxapp
doc/guides/prog_guide/mlx4_poll_mode_drv.rst
lib/librte_pmd_mlx4/Makefile
lib/librte_pmd_mlx4/mlx4.c
lib/librte_pmd_mlx4/mlx4.h

index 93d2f9e..a8ba484 100644 (file)
@@ -209,7 +209,6 @@ CONFIG_RTE_LIBRTE_MLX4_SGE_WR_N=4
 CONFIG_RTE_LIBRTE_MLX4_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8
 CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
 CONFIG_RTE_LIBRTE_MLX4_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8
 CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
-CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE=1
 
 #
 # Compile burst-oriented Cisco ENIC PMD driver
 
 #
 # Compile burst-oriented Cisco ENIC PMD driver
index 19de75f..0b25f34 100644 (file)
@@ -206,7 +206,6 @@ CONFIG_RTE_LIBRTE_MLX4_SGE_WR_N=4
 CONFIG_RTE_LIBRTE_MLX4_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8
 CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
 CONFIG_RTE_LIBRTE_MLX4_MAX_INLINE=0
 CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8
 CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
-CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE=1
 
 #
 # Compile burst-oriented Cisco ENIC PMD driver
 
 #
 # Compile burst-oriented Cisco ENIC PMD driver
index 35570c3..b26c219 100644 (file)
@@ -125,11 +125,6 @@ Compilation options
   Toggle software counters. No counters are available if this option is
   disabled since hardware counters are not supported.
 
   Toggle software counters. No counters are available if this option is
   disabled since hardware counters are not supported.
 
-- ``CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE`` (default **1**)
-
-  Toggle VMware compatibility code. It also requires the environment
-  variable ``MLX4_COMPAT_VMWARE`` set to a nonzero value at runtime.
-
 Environment variables
 ~~~~~~~~~~~~~~~~~~~~~
 
 Environment variables
 ~~~~~~~~~~~~~~~~~~~~~
 
@@ -139,12 +134,6 @@ Environment variables
   significantly improve performance in some cases but lower it in
   others. Requires careful testing.
 
   significantly improve performance in some cases but lower it in
   others. Requires careful testing.
 
-- ``MLX4_COMPAT_VMWARE``
-
-  Only supported when compiled with
-  ``CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE=1``. Adds workarounds to run in
-  VMware systems that do not support the flows API properly.
-
 Run-time configuration
 ~~~~~~~~~~~~~~~~~~~~~~
 
 Run-time configuration
 ~~~~~~~~~~~~~~~~~~~~~~
 
index 6666813..97b364a 100644 (file)
@@ -87,10 +87,6 @@ ifdef CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS
 CFLAGS += -DMLX4_PMD_SOFT_COUNTERS=$(CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS)
 endif
 
 CFLAGS += -DMLX4_PMD_SOFT_COUNTERS=$(CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS)
 endif
 
-ifdef CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE
-CFLAGS += -DMLX4_PMD_COMPAT_VMWARE=$(CONFIG_RTE_LIBRTE_MLX4_COMPAT_VMWARE)
-endif
-
 include $(RTE_SDK)/mk/rte.lib.mk
 
 # Generate and clean-up mlx4_autoconf.h.
 include $(RTE_SDK)/mk/rte.lib.mk
 
 # Generate and clean-up mlx4_autoconf.h.
index 3a45746..fa749f4 100644 (file)
@@ -278,9 +278,6 @@ struct priv {
        unsigned int hw_tss:1; /* TSS is supported. */
        unsigned int hw_rss:1; /* RSS is supported. */
        unsigned int rss:1; /* RSS is enabled. */
        unsigned int hw_tss:1; /* TSS is supported. */
        unsigned int hw_rss:1; /* RSS is supported. */
        unsigned int rss:1; /* RSS is enabled. */
-#ifdef MLX4_COMPAT_VMWARE
-       unsigned int vmware:1; /* Use VMware compatibility. */
-#endif
        unsigned int vf:1; /* This is a VF device. */
 #ifdef INLINE_RECV
        unsigned int inl_recv_size; /* Inline recv size */
        unsigned int vf:1; /* This is a VF device. */
 #ifdef INLINE_RECV
        unsigned int inl_recv_size; /* Inline recv size */
@@ -1825,7 +1822,7 @@ rxq_free_elts(struct rxq *rxq)
 static void
 rxq_mac_addr_del(struct rxq *rxq, unsigned int mac_index)
 {
 static void
 rxq_mac_addr_del(struct rxq *rxq, unsigned int mac_index)
 {
-#if defined(NDEBUG) || defined(MLX4_COMPAT_VMWARE)
+#ifndef NDEBUG
        struct priv *priv = rxq->priv;
        const uint8_t (*mac)[ETHER_ADDR_LEN] =
                (const uint8_t (*)[ETHER_ADDR_LEN])
        struct priv *priv = rxq->priv;
        const uint8_t (*mac)[ETHER_ADDR_LEN] =
                (const uint8_t (*)[ETHER_ADDR_LEN])
@@ -1842,16 +1839,6 @@ rxq_mac_addr_del(struct rxq *rxq, unsigned int mac_index)
              (void *)rxq,
              (*mac)[0], (*mac)[1], (*mac)[2], (*mac)[3], (*mac)[4], (*mac)[5],
              mac_index);
              (void *)rxq,
              (*mac)[0], (*mac)[1], (*mac)[2], (*mac)[3], (*mac)[4], (*mac)[5],
              mac_index);
-#ifdef MLX4_COMPAT_VMWARE
-       if (priv->vmware) {
-               union ibv_gid gid = { .raw = { 0 } };
-
-               memcpy(&gid.raw[10], *mac, sizeof(*mac));
-               claim_zero(ibv_detach_mcast(rxq->qp, &gid, 0));
-               BITFIELD_RESET(rxq->mac_configured, mac_index);
-               return;
-       }
-#endif
        assert(rxq->mac_flow[mac_index] != NULL);
        claim_zero(ibv_exp_destroy_flow(rxq->mac_flow[mac_index]));
        rxq->mac_flow[mac_index] = NULL;
        assert(rxq->mac_flow[mac_index] != NULL);
        claim_zero(ibv_exp_destroy_flow(rxq->mac_flow[mac_index]));
        rxq->mac_flow[mac_index] = NULL;
@@ -1960,22 +1947,6 @@ rxq_mac_addr_add(struct rxq *rxq, unsigned int mac_index)
              (*mac)[0], (*mac)[1], (*mac)[2], (*mac)[3], (*mac)[4], (*mac)[5],
              mac_index,
              vlans);
              (*mac)[0], (*mac)[1], (*mac)[2], (*mac)[3], (*mac)[4], (*mac)[5],
              mac_index,
              vlans);
-#ifdef MLX4_COMPAT_VMWARE
-       if (priv->vmware) {
-               union ibv_gid gid = { .raw = { 0 } };
-
-               /* Call multicast attach with unicast mac to get traffic. */
-               memcpy(&gid.raw[10], *mac, sizeof(*mac));
-               errno = 0;
-               if (ibv_attach_mcast(rxq->qp, &gid, 0)) {
-                       if (errno)
-                               return errno;
-                       return EINVAL;
-               }
-               BITFIELD_SET(rxq->mac_configured, mac_index);
-               return 0;
-       }
-#endif
        /* Create related flow. */
        errno = 0;
        flow = ibv_exp_create_flow(rxq->qp, attr);
        /* Create related flow. */
        errno = 0;
        flow = ibv_exp_create_flow(rxq->qp, attr);
@@ -2173,13 +2144,6 @@ rxq_allmulticast_enable(struct rxq *rxq)
                .flags = 0
        };
 
                .flags = 0
        };
 
-#ifdef MLX4_COMPAT_VMWARE
-       if (rxq->priv->vmware) {
-               ERROR("%p: allmulticast mode is not supported in VMware",
-                     (void *)rxq);
-               return EINVAL;
-       }
-#endif
        DEBUG("%p: enabling allmulticast mode", (void *)rxq);
        if (rxq->allmulti_flow != NULL)
                return EBUSY;
        DEBUG("%p: enabling allmulticast mode", (void *)rxq);
        if (rxq->allmulti_flow != NULL)
                return EBUSY;
@@ -2208,13 +2172,6 @@ rxq_allmulticast_enable(struct rxq *rxq)
 static void
 rxq_allmulticast_disable(struct rxq *rxq)
 {
 static void
 rxq_allmulticast_disable(struct rxq *rxq)
 {
-#ifdef MLX4_COMPAT_VMWARE
-       if (rxq->priv->vmware) {
-               ERROR("%p: allmulticast mode is not supported in VMware",
-                     (void *)rxq);
-               return;
-       }
-#endif
        DEBUG("%p: disabling allmulticast mode", (void *)rxq);
        if (rxq->allmulti_flow == NULL)
                return;
        DEBUG("%p: disabling allmulticast mode", (void *)rxq);
        if (rxq->allmulti_flow == NULL)
                return;
@@ -2243,13 +2200,6 @@ rxq_promiscuous_enable(struct rxq *rxq)
                .flags = 0
        };
 
                .flags = 0
        };
 
-#ifdef MLX4_COMPAT_VMWARE
-       if (rxq->priv->vmware) {
-               ERROR("%p: promiscuous mode is not supported in VMware",
-                     (void *)rxq);
-               return EINVAL;
-       }
-#endif
        if (rxq->priv->vf)
                return 0;
        DEBUG("%p: enabling promiscuous mode", (void *)rxq);
        if (rxq->priv->vf)
                return 0;
        DEBUG("%p: enabling promiscuous mode", (void *)rxq);
@@ -2280,13 +2230,6 @@ rxq_promiscuous_enable(struct rxq *rxq)
 static void
 rxq_promiscuous_disable(struct rxq *rxq)
 {
 static void
 rxq_promiscuous_disable(struct rxq *rxq)
 {
-#ifdef MLX4_COMPAT_VMWARE
-       if (rxq->priv->vmware) {
-               ERROR("%p: promiscuous mode is not supported in VMware",
-                     (void *)rxq);
-               return;
-       }
-#endif
        if (rxq->priv->vf)
                return;
        DEBUG("%p: disabling promiscuous mode", (void *)rxq);
        if (rxq->priv->vf)
                return;
        DEBUG("%p: disabling promiscuous mode", (void *)rxq);
@@ -4594,12 +4537,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                }
 #endif /* INLINE_RECV */
 
                }
 #endif /* INLINE_RECV */
 
-#ifdef MLX4_COMPAT_VMWARE
-               if (mlx4_getenv_int("MLX4_COMPAT_VMWARE"))
-                       priv->vmware = 1;
-#else /* MLX4_COMPAT_VMWARE */
                (void)mlx4_getenv_int;
                (void)mlx4_getenv_int;
-#endif /* MLX4_COMPAT_VMWARE */
                priv->vf = vf;
                if (ibv_query_gid(ctx, port, 0, &temp_gid)) {
                        ERROR("ibv_query_gid() failure");
                priv->vf = vf;
                if (ibv_query_gid(ctx, port, 0, &temp_gid)) {
                        ERROR("ibv_query_gid() failure");
index af3683d..433aa3b 100644 (file)
 #define MLX4_PMD_SOFT_COUNTERS 1
 #endif
 
 #define MLX4_PMD_SOFT_COUNTERS 1
 #endif
 
-/*
- * If defined, enable VMware compatibility code. It also requires the
- * environment variable MLX4_COMPAT_VMWARE set to a nonzero value at runtime.
- */
-#ifndef MLX4_COMPAT_VMWARE
-#define MLX4_COMPAT_VMWARE 1
-#endif
-
 enum {
        PCI_VENDOR_ID_MELLANOX = 0x15b3,
 };
 enum {
        PCI_VENDOR_ID_MELLANOX = 0x15b3,
 };