From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id 582E05953 for ; Mon, 19 May 2014 15:57:07 +0200 (CEST) Received: by mail-wi0-f176.google.com with SMTP id n15so4180717wiw.9 for ; Mon, 19 May 2014 06:57:15 -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:in-reply-to :references; bh=JutRIppnz4yHOQ87lxPXfNwZMgw2uN76NGnjkpG99Xo=; b=I199TLNgq24X7E0sajGiC/SBEW0hLoqyNfdk9APJudy1OM7dEcIQj3ELYCeRbwGZOq fViwSQFS7AhF6ZGqQ+oD1l1JGVsbCF1DmgMvEfbFLJd3e8XPhkkEIINTbv5/VlH0RzTE PBaJm99kvF72h9JbquneBKe6AN3Teok1JQgvidoWsDcEZ9M5Bf2nECWhTdNe6s8lbOUs OjoOezGC9GDnDDVmMLjEBfxVEmrD9yzsHOv4BklHC0/08C7b+l9GEMlJZMNB+RsEo2Wz Mc4YcGJmQTlsweFWW2wRsSuq5VyV0x4kcDR9TdagC+8TZyIryg85ZoKNVeXcqZPFAkhG qyOw== X-Gm-Message-State: ALoCoQmGxbmZU9WLXFyWtvphSbjOaaNzD366g4NkJtNXxSEfx+XOKY/mAZ5aX0goC5+U97tUMy6p X-Received: by 10.180.13.139 with SMTP id h11mr13163260wic.34.1400507835880; Mon, 19 May 2014 06:57:15 -0700 (PDT) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id t18sm15201828wiv.16.2014.05.19.06.57.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 May 2014 06:57:15 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Date: Mon, 19 May 2014 15:56:27 +0200 Message-Id: <1400507789-18453-16-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1400507789-18453-1-git-send-email-olivier.matz@6wind.com> References: <1400507789-18453-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [vmxnet3-usermap PATCH v2 15/17] pmd: remove support of old dpdk versions 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: , X-List-Received-Date: Mon, 19 May 2014 13:57:08 -0000 It's a pain to support many versions of DPDK for external drivers. Today, it's not required to keep this driver working on older DPDK versions. If it's required in the future, as the DPDK API is not stable enough, the correct approach will probably to have several maintenance branches instead of trying to have a driver that compiles with all DPDK versions. Signed-off-by: Olivier Matz --- pmd/vmxnet3.c | 68 ----------------------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/pmd/vmxnet3.c b/pmd/vmxnet3.c index a25ea41..3f3f715 100644 --- a/pmd/vmxnet3.c +++ b/pmd/vmxnet3.c @@ -47,26 +47,14 @@ /* Dependency over DPDK */ #include #include -#include - -#define DPDK_VERSION_BEFORE(x,y) RTE_VERSION < RTE_VERSION_NUM(x,y,0,0) -#define DPDK_VERSION_SINCE(x,y) RTE_VERSION >= RTE_VERSION_NUM(x,y,0,0) /* Local includes */ #include "vmxnet3_shm_shared.h" #include "vmx_user.h" -#if DPDK_VERSION_BEFORE(1,3) -/* until dpdk-1.3, queue structs are igb ones */ -typedef struct igb_tx_queue rte_txq_t; -typedef struct igb_rx_queue rte_rxq_t; -/* until dpdk-1.3, bit-fields vlan_macip are flat in rte_pktmbuf */ -#define RTE_MBUF_VLAN_MAC_IP(m) (m)->pkt.vlan_tci -#else /* since dpdk-1.3 */ typedef void rte_txq_t; typedef void rte_rxq_t; #define RTE_MBUF_VLAN_MAC_IP(m) (m)->pkt.vlan_macip.f.vlan_tci -#endif #define VMXNET3_MAX_MAC_ADDRS 1 @@ -747,11 +735,7 @@ vmxnet3_rss_configure(const struct rte_eth_dev *dev) * Clear VLAN Filter table and declare VLAN filtering capability, * so that we can enable VLAN filtering by simply adding entries in it. */ -#if DPDK_VERSION_SINCE(1,3) static int -#else -static void -#endif vmxnet3_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { const struct vmxnet3_adapter *priv; @@ -765,11 +749,7 @@ vmxnet3_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) if (!(devRead->misc.uptFeatures & UPT1_F_RXVLAN)) { RTE_LOG(WARNING, PMD, "%s(): No VLAN enabled for device\n", __func__); -#if DPDK_VERSION_SINCE(1,3) return -1; -#else - return; -#endif } if (on) { @@ -778,9 +758,7 @@ vmxnet3_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vlan_id); } -#if DPDK_VERSION_SINCE(1,3) return 0; -#endif } /* Exported Rx function after Rx Queue setup. */ @@ -1001,58 +979,14 @@ vmxnet3_dev_start(struct rte_eth_dev *dev) return ret; } -#if DPDK_VERSION_BEFORE(1,3) -/* Allocate array of pointers to register queues */ -static int -pointer_array_alloc(void **pointer_array, uint16_t *size, uint16_t new_size) -{ - if (*pointer_array == NULL) { - *pointer_array = malloc(sizeof(void*) * new_size); - if (*pointer_array == NULL) { - *size = 0; - return -ENOMEM; - } - } else if (new_size != *size) - rte_panic("%s(): cannot change queues number\n", __func__); - - *size = new_size; - return 0; -} - -/* Configure VLAN and Flow Director. Flow Director is not supported. */ -static int -vmxnet3_dev_configure(struct rte_eth_dev *dev, - uint16_t nb_rx_q, uint16_t nb_tx_q) -#else static int vmxnet3_dev_configure(struct rte_eth_dev *dev) -#endif { const struct vmxnet3_adapter* priv; struct Vmxnet3_DSDevRead *devRead; unsigned int i; u32 *vfTable; -#if DPDK_VERSION_BEFORE(1,3) - int ret; - - /* Allocate array of pointers to RX queues */ - ret = pointer_array_alloc((void**)&dev->data->rx_queues, - &dev->data->nb_rx_queues, nb_rx_q); - if (ret != 0) - rte_panic("%s(): port_id=%d: allocation of array " - "of %d pointers to RX queues failed\n", - __func__, dev->data->port_id, nb_rx_q); - - /* Allocate array of pointers to TX queues */ - ret = pointer_array_alloc((void**)&dev->data->tx_queues, - &dev->data->nb_tx_queues, nb_tx_q); - if (ret != 0) - rte_panic("%s(): port_id=%d: allocation of array " - "of %d pointers to TX queues failed\n", - __func__, dev->data->port_id, nb_tx_q); -#endif - priv = (struct vmxnet3_adapter*)dev->data->dev_private; devRead = &priv->shared->devRead; @@ -1424,11 +1358,9 @@ static struct eth_dev_ops vmxnet3_eth_dev_ops = { .vlan_filter_set = vmxnet3_vlan_filter_set, .rx_queue_setup = vmxnet3_dev_rx_queue_setup, .tx_queue_setup = vmxnet3_dev_tx_queue_setup, -#if DPDK_VERSION_SINCE(1,3) /* Reconfiguration not supported yet */ .rx_queue_release = NULL, .tx_queue_release = NULL, -#endif .dev_led_on = NULL, .dev_led_off = NULL, .flow_ctrl_set = NULL, -- 1.9.2