From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [vmxnet3-usermap PATCH v2 15/17] pmd: remove support of old dpdk versions
Date: Mon, 19 May 2014 15:56:27 +0200 [thread overview]
Message-ID: <1400507789-18453-16-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <1400507789-18453-1-git-send-email-olivier.matz@6wind.com>
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 <olivier.matz@6wind.com>
---
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 <rte_byteorder.h>
#include <rte_ethdev.h>
-#include <rte_version.h>
-
-#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
next prev parent reply other threads:[~2014-05-19 13:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 13:56 [dpdk-dev] [PATCH v2 00/17] ixgbe/mbuf: add TSO support Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 01/17] igb/ixgbe: fix IP checksum calculation Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 02/17] mbuf: rename RTE_MBUF_SCATTER_GATHER into RTE_MBUF_REFCNT Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 03/17] mbuf: remove rte_ctrlmbuf Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 04/17] mbuf: remove the rte_pktmbuf structure Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 05/17] mbuf: merge physaddr and buf_len in a bitfield Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 06/17] mbuf: cosmetic changes in rte_mbuf structure Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 07/17] mbuf: replace data pointer by an offset Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 08/17] mbuf: add functions to get the name of an ol_flag Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 09/17] mbuf: change ol_flags to 32 bits Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 10/17] mbuf: rename vlan_macip_len in hw_offload and increase its size Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 11/17] testpmd: modify source address to validate checksum calculation Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 12/17] mbuf: generic support of TCP segmentation offload Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [PATCH v2 13/17] ixgbe: support " Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [virtio-net-pmd PATCH v2 14/17] pmd: adapt to new rte_mbuf structure Olivier Matz
2014-05-19 13:56 ` Olivier Matz [this message]
2014-05-19 13:56 ` [dpdk-dev] [vmxnet3-usermap PATCH v2 16/17] " Olivier Matz
2014-05-19 13:56 ` [dpdk-dev] [memnic PATCH v2 17/17] " Olivier Matz
2014-05-22 15:02 ` [dpdk-dev] [PATCH v2 00/17] add TSO support Thomas Monjalon
2014-05-22 16:09 ` Venkatesan, Venky
2014-05-23 14:22 ` Olivier MATZ
2014-05-23 14:43 ` Venkatesan, Venky
2014-05-26 11:59 ` Olivier MATZ
2014-05-23 12:47 ` Ananyev, Konstantin
2014-05-23 14:32 ` Olivier MATZ
2014-05-26 15:20 ` Ananyev, Konstantin
2014-11-03 7:32 ` [dpdk-dev] [PATCH v2 00/17] ixgbe/mbuf: " Liu, Jijiang
2014-11-03 10:12 ` Olivier MATZ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400507789-18453-16-git-send-email-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).