From patchwork Wed Mar 25 10:34:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 4129 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 601F0568E; Wed, 25 Mar 2015 11:34:39 +0100 (CET) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 6203737A4 for ; Wed, 25 Mar 2015 11:34:37 +0100 (CET) Received: by wgs2 with SMTP id 2so22049803wgs.1 for ; Wed, 25 Mar 2015 03:34:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LO00Qk/X79xhAfOPuAghruTSAF7xoIBLTm98mJV9ua0=; b=OnlCTMB2bG3LxYLMaXzwodrQ2B/B//EY6qla75OFoe0iiSbOuPE7HjXTTGEnEhr85D 75ADzTPtLcNK7oFYK6qrTrsDDoIb0VBLgQN0AnvrVCdOfhpVPGrGms7IPD7nCXd3gT7x 86oIhUhfrIQoIczha+x7Eqp6+2L2SypC10TpzK9pHTf377Aze8t1Tkkok9SSfqJ4rwIi Pb2hfEZKnDphBBhSi6jtKWqauSCdvQTYRHZ+PkVip46HaP6QOlEuXbMkc92jIGeVM+uh VeKh0BlEjlcMUiXh2FPHKg+ikETWSAvS5rlcUxDjmRfVjEPhV2lM1e1YY9jKpSHaCVt8 DH9w== X-Gm-Message-State: ALoCoQkPvfKHySvlMwEGF5WvOJB2KF2VmNSmGk6uZoyGsPo9VHxdhzekZZmrlyfQA9HH6zvl/n/n X-Received: by 10.180.90.106 with SMTP id bv10mr35006091wib.4.1427279676777; Wed, 25 Mar 2015 03:34:36 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ch6sm3038050wjc.3.2015.03.25.03.34.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Mar 2015 03:34:36 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Wed, 25 Mar 2015 11:34:31 +0100 Message-Id: <1427279671-18243-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 Subject: [dpdk-dev] [PATCH] mlx4: remove old VMware compatibility code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Adrien Mazarguil Acked-by: Neil Horman --- config/common_bsdapp | 1 - config/common_linuxapp | 1 - doc/guides/prog_guide/mlx4_poll_mode_drv.rst | 11 ----- lib/librte_pmd_mlx4/Makefile | 4 -- lib/librte_pmd_mlx4/mlx4.c | 64 +--------------------------- lib/librte_pmd_mlx4/mlx4.h | 8 ---- 6 files changed, 1 insertion(+), 88 deletions(-) diff --git a/config/common_bsdapp b/config/common_bsdapp index 8ff4dc2..5c7ca43 100644 --- a/config/common_bsdapp +++ b/config/common_bsdapp @@ -208,7 +208,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_COMPAT_VMWARE=1 # # Compile burst-oriented Cisco ENIC PMD driver diff --git a/config/common_linuxapp b/config/common_linuxapp index 09a58ac..5cbb8c3 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -205,7 +205,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_COMPAT_VMWARE=1 # # Compile burst-oriented Cisco ENIC PMD driver diff --git a/doc/guides/prog_guide/mlx4_poll_mode_drv.rst b/doc/guides/prog_guide/mlx4_poll_mode_drv.rst index 35570c3..b26c219 100644 --- a/doc/guides/prog_guide/mlx4_poll_mode_drv.rst +++ b/doc/guides/prog_guide/mlx4_poll_mode_drv.rst @@ -125,11 +125,6 @@ Compilation options 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 ~~~~~~~~~~~~~~~~~~~~~ @@ -139,12 +134,6 @@ Environment variables 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 ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/librte_pmd_mlx4/Makefile b/lib/librte_pmd_mlx4/Makefile index 6666813..97b364a 100644 --- a/lib/librte_pmd_mlx4/Makefile +++ b/lib/librte_pmd_mlx4/Makefile @@ -87,10 +87,6 @@ ifdef CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS 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. diff --git a/lib/librte_pmd_mlx4/mlx4.c b/lib/librte_pmd_mlx4/mlx4.c index 3a45746..fa749f4 100644 --- a/lib/librte_pmd_mlx4/mlx4.c +++ b/lib/librte_pmd_mlx4/mlx4.c @@ -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. */ -#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 */ @@ -1825,7 +1822,7 @@ rxq_free_elts(struct rxq *rxq) 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]) @@ -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); -#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; @@ -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); -#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); @@ -2173,13 +2144,6 @@ rxq_allmulticast_enable(struct rxq *rxq) .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; @@ -2208,13 +2172,6 @@ rxq_allmulticast_enable(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; @@ -2243,13 +2200,6 @@ rxq_promiscuous_enable(struct rxq *rxq) .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); @@ -2280,13 +2230,6 @@ rxq_promiscuous_enable(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); @@ -4594,12 +4537,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) } #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; -#endif /* MLX4_COMPAT_VMWARE */ priv->vf = vf; if (ibv_query_gid(ctx, port, 0, &temp_gid)) { ERROR("ibv_query_gid() failure"); diff --git a/lib/librte_pmd_mlx4/mlx4.h b/lib/librte_pmd_mlx4/mlx4.h index af3683d..433aa3b 100644 --- a/lib/librte_pmd_mlx4/mlx4.h +++ b/lib/librte_pmd_mlx4/mlx4.h @@ -80,14 +80,6 @@ #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, };