aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-07-06 23:13:39 +0200
committerDave Barach <openvpp@barachs.net>2016-07-07 12:35:10 +0000
commit3a94475e29f6b6efb7e6af30d5f171c6d3799b3d (patch)
tree2cb105f123225e3dbb5700cacf3cdff740ed2390
parent9770e20a9eded6f593dc71646ffa9f34940d794c (diff)
Retire support for DPDK 2.1.0 and older
Change-Id: I3c3427c61e32d4727360aa802950bb9ab44afd84 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/devices/dpdk/device.c2
-rw-r--r--vnet/vnet/devices/dpdk/dpdk.h13
-rw-r--r--vnet/vnet/devices/dpdk/dpdk_priv.h12
-rw-r--r--vnet/vnet/devices/dpdk/format.c57
-rw-r--r--vnet/vnet/devices/dpdk/init.c50
-rw-r--r--vnet/vnet/devices/dpdk/node.c8
-rw-r--r--vnet/vnet/devices/dpdk/vhost_user.c53
-rw-r--r--vnet/vnet/devices/virtio/vhost-user.h4
8 files changed, 2 insertions, 197 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c
index b248f40f80f..35cf87f0008 100644
--- a/vnet/vnet/devices/dpdk/device.c
+++ b/vnet/vnet/devices/dpdk/device.c
@@ -362,7 +362,6 @@ u32 tx_burst_vector_internal (vlib_main_t * vm,
queue_id = 0;
while (__sync_lock_test_and_set (xd->lockp[queue_id], 1));
}
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
else {
dpdk_device_and_queue_t * dq;
vec_foreach (dq, dm->devices_by_cpu[vm->cpu_index])
@@ -373,7 +372,6 @@ u32 tx_burst_vector_internal (vlib_main_t * vm,
assert (dq);
offset = dq->queue_id * VIRTIO_QNUM;
}
-#endif
if (PREDICT_TRUE(tx_head > tx_tail))
{
int i; u32 bytes = 0;
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index c44d9cc59c6..dee4625b82f 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -86,7 +86,6 @@ typedef enum {
_ ("rte_i40e_pmd", I40E) \
_ ("rte_i40evf_pmd", I40EVF) \
_ ("rte_virtio_pmd", VIRTIO) \
- _ ("rte_vice_pmd", VICE) \
_ ("rte_enic_pmd", ENIC) \
_ ("rte_vmxnet3_pmd", VMXNET3) \
_ ("AF_PACKET PMD", AF_PACKET) \
@@ -100,9 +99,6 @@ typedef enum {
#define _(s,f) VNET_DPDK_PMD_##f,
foreach_dpdk_pmd
#undef _
-#ifdef NETMAP
- VNET_DPDK_PMD_NETMAP,
-#endif
VNET_DPDK_PMD_UNKNOWN, /* must be last */
} dpdk_pmd_t;
@@ -112,9 +108,6 @@ typedef enum {
VNET_DPDK_PORT_TYPE_ETH_40G,
VNET_DPDK_PORT_TYPE_ETH_BOND,
VNET_DPDK_PORT_TYPE_ETH_SWITCH,
-#ifdef NETMAP
- VNET_DPDK_PORT_TYPE_NETMAP,
-#endif
VNET_DPDK_PORT_TYPE_AF_PACKET,
VNET_DPDK_PORT_TYPE_UNKNOWN,
} dpdk_port_type_t;
@@ -142,9 +135,7 @@ typedef struct {
int callfd;
int kickfd;
int errfd;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
int enabled;
-#endif
u32 callfd_idx;
u32 n_since_last_int;
f64 int_deadline;
@@ -164,11 +155,7 @@ typedef struct {
u64 feature_mask;
u32 num_vrings;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
dpdk_vu_vring vrings[VHOST_MAX_QUEUE_PAIRS * 2];
-#else
- dpdk_vu_vring vrings[2];
-#endif
u64 region_addr[VHOST_MEMORY_MAX_NREGIONS];
u32 region_fd[VHOST_MEMORY_MAX_NREGIONS];
u64 region_offset[VHOST_MEMORY_MAX_NREGIONS];
diff --git a/vnet/vnet/devices/dpdk/dpdk_priv.h b/vnet/vnet/devices/dpdk/dpdk_priv.h
index 24c91c6a9ca..c6be7e7f525 100644
--- a/vnet/vnet/devices/dpdk/dpdk_priv.h
+++ b/vnet/vnet/devices/dpdk/dpdk_priv.h
@@ -79,7 +79,6 @@ dpdk_rx_burst ( dpdk_main_t * dm, dpdk_device_t * xd, u16 queue_id)
unsigned socket_id = rte_socket_id();
u32 offset = 0;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
offset = queue_id * VIRTIO_QNUM;
struct vhost_virtqueue *vq =
@@ -87,10 +86,6 @@ dpdk_rx_burst ( dpdk_main_t * dm, dpdk_device_t * xd, u16 queue_id)
if (PREDICT_FALSE(!vq->enabled))
return 0;
-#else
- if (PREDICT_FALSE(!xd->vu_is_running))
- return 0;
-#endif
struct rte_mbuf **pkts = xd->rx_vectors[queue_id];
while (n_left) {
@@ -216,15 +211,8 @@ dpdk_update_counters (dpdk_device_t * xd, f64 now)
xd->stats.imissed -
xd->last_stats.imissed);
}
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
rxerrors = xd->stats.ierrors;
last_rxerrors = xd->last_stats.ierrors;
-#else
- rxerrors = xd->stats.ibadcrc
- + xd->stats.ibadlen + xd->stats.ierrors;
- last_rxerrors = xd->last_stats.ibadcrc
- + xd->last_stats.ibadlen + xd->last_stats.ierrors;
-#endif
if (PREDICT_FALSE (rxerrors != last_rxerrors))
{
diff --git a/vnet/vnet/devices/dpdk/format.c b/vnet/vnet/devices/dpdk/format.c
index aaafc90827c..c3ccc90a479 100644
--- a/vnet/vnet/devices/dpdk/format.c
+++ b/vnet/vnet/devices/dpdk/format.c
@@ -24,7 +24,6 @@
#include "dpdk_priv.h"
#include <vppinfra/error.h>
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
#define foreach_dpdk_counter \
_ (tx_frames_ok, opackets) \
_ (tx_bytes_ok, obytes) \
@@ -39,30 +38,6 @@
_ (rx_no_bufs, rx_nombuf) \
_ (rx_loopback_frames_ok, ilbpackets) \
_ (rx_loopback_bytes_ok, ilbbytes)
-#else
-#define foreach_dpdk_counter \
- _ (tx_frames_ok, opackets) \
- _ (tx_bytes_ok, obytes) \
- _ (tx_errors, oerrors) \
- _ (tx_loopback_frames_ok, olbpackets) \
- _ (tx_loopback_bytes_ok, olbbytes) \
- _ (rx_frames_ok, ipackets) \
- _ (rx_bytes_ok, ibytes) \
- _ (rx_errors, ierrors) \
- _ (rx_missed, imissed) \
- _ (rx_bad_crc, ibadcrc) \
- _ (rx_bad_length, ibadlen) \
- _ (rx_multicast_frames_ok, imcasts) \
- _ (rx_no_bufs, rx_nombuf) \
- _ (rx_filter_match, fdirmatch) \
- _ (rx_filter_miss, fdirmiss) \
- _ (tx_pause_xon, tx_pause_xon) \
- _ (rx_pause_xon, rx_pause_xon) \
- _ (tx_pause_xoff, tx_pause_xoff) \
- _ (rx_pause_xoff, rx_pause_xoff) \
- _ (rx_loopback_frames_ok, ilbpackets) \
- _ (rx_loopback_bytes_ok, ilbbytes)
-#endif
#define foreach_dpdk_q_counter \
_ (rx_frames_ok, q_ipackets) \
@@ -109,8 +84,6 @@
_(DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM, "outer-ipv4-cksum") \
_(DEV_TX_OFFLOAD_QINQ_INSERT, "qinq-insert")
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 1, 0, 0)
-
#define foreach_dpdk_pkt_rx_offload_flag \
_ (PKT_RX_VLAN_PKT, "RX packet is a 802.1q VLAN packet") \
_ (PKT_RX_RSS_HASH, "RX packet with RSS hash result") \
@@ -157,23 +130,6 @@
_ (INNER_L4, ICMP, "Inner ICMP packet") \
_ (INNER_L4, NONFRAG, "Inner non-fragmented IP packet")
-#else
-#define foreach_dpdk_pkt_rx_offload_flag \
- _ (PKT_RX_VLAN_PKT, "RX packet is a 802.1q VLAN packet") \
- _ (PKT_RX_RSS_HASH, "RX packet with RSS hash result") \
- _ (PKT_RX_FDIR, "RX packet with FDIR infos") \
- _ (PKT_RX_L4_CKSUM_BAD, "L4 cksum of RX pkt. is not OK") \
- _ (PKT_RX_IP_CKSUM_BAD, "IP cksum of RX pkt. is not OK") \
- _ (PKT_RX_IPV4_HDR, "RX packet with IPv4 header") \
- _ (PKT_RX_IPV4_HDR_EXT, "RX packet with extended IPv4 header") \
- _ (PKT_RX_IPV6_HDR, "RX packet with IPv6 header") \
- _ (PKT_RX_IPV6_HDR_EXT, "RX packet with extended IPv6 header") \
- _ (PKT_RX_IEEE1588_PTP, "RX IEEE1588 L2 Ethernet PT Packet") \
- _ (PKT_RX_IEEE1588_TMST, "RX IEEE1588 L2/L4 timestamped packet")
-
-#define foreach_dpdk_pkt_type /* Dummy */
-#endif /* RTE_VERSION */
-
#define foreach_dpdk_pkt_tx_offload_flag \
_ (PKT_TX_VLAN_PKT, "TX packet is a 802.1q VLAN packet") \
_ (PKT_TX_IP_CKSUM, "IP cksum of TX pkt. computed by NIC") \
@@ -242,12 +198,6 @@ u8 * format_dpdk_device_name (u8 * s, va_list * args)
device_name = "EthernetSwitch";
break;
- #ifdef NETMAP
- case VNET_DPDK_PORT_TYPE_NETMAP:
- rte_eth_dev_info_get(i, &dev_info);
- return format(s, "netmap:%s", dev_info.driver_name);
- #endif
-
case VNET_DPDK_PORT_TYPE_AF_PACKET:
rte_eth_dev_info_get(i, &dev_info);
return format(s, "af_packet%d", dm->devices[i].af_packet_port_id);
@@ -332,7 +282,6 @@ static u8 * format_dpdk_device_type (u8 * s, va_list * args)
dev_type = "Intel 82599";
break;
- case VNET_DPDK_PMD_VICE:
case VNET_DPDK_PMD_ENIC:
dev_type = "Cisco VIC";
break;
@@ -345,12 +294,6 @@ static u8 * format_dpdk_device_type (u8 * s, va_list * args)
dev_type = "VMware VMXNET3";
break;
-#ifdef NETMAP
- case VNET_DPDK_PMD_NETMAP:
- dev_type = "Netmap/Vale";
- break;
-#endif
-
case VNET_DPDK_PMD_AF_PACKET:
dev_type = "af_packet";
break;
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index 9054f5e2ea5..471d9015342 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -152,8 +152,7 @@ static u32 dpdk_flag_change (vnet_main_t * vnm,
* driver to dynamically change the mtu. If/when the
* VIC firmware gets fixed, then this should be removed.
*/
- if (xd->pmd == VNET_DPDK_PMD_VICE ||
- xd->pmd == VNET_DPDK_PMD_ENIC)
+ if (xd->pmd == VNET_DPDK_PMD_ENIC)
{
struct rte_eth_dev_info dev_info;
@@ -196,10 +195,6 @@ static u32 dpdk_flag_change (vnet_main_t * vnm,
return old;
}
-#ifdef NETMAP
-extern int rte_netmap_probe(void);
-#endif
-
void
dpdk_device_lock_init(dpdk_device_t * xd)
{
@@ -267,11 +262,6 @@ dpdk_lib_init (dpdk_main_t * dm)
vec_validate_aligned (dm->workers, tm->n_vlib_mains - 1,
CLIB_CACHE_LINE_BYTES);
-#ifdef NETMAP
- if(rte_netmap_probe() < 0)
- return clib_error_return (0, "rte netmap probe failed");
-#endif
-
nports = rte_eth_dev_count();
if (nports < 1)
{
@@ -404,7 +394,6 @@ dpdk_lib_init (dpdk_main_t * dm)
break;
/* Cisco VIC */
- case VNET_DPDK_PMD_VICE:
case VNET_DPDK_PMD_ENIC:
rte_eth_link_get_nowait(i, &l);
xd->nb_rx_desc = DPDK_NB_RX_DESC_ENIC;
@@ -494,14 +483,6 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_UNKNOWN;
}
- #ifdef NETMAP
- if(strncmp(dev_info.driver_name, "vale", 4) == 0
- || strncmp(dev_info.driver_name, "netmap", 6) == 0)
- {
- xd->pmd = VNET_DPDK_PMD_NETMAP;
- xd->port_type = VNET_DPDK_PORT_TYPE_NETMAP;
- }
- #endif
if (devconf->num_rx_desc)
xd->nb_rx_desc = devconf->num_rx_desc;
@@ -664,8 +645,7 @@ dpdk_lib_init (dpdk_main_t * dm)
* driver to dynamically change the mtu. If/when the
* VIC firmware gets fixed, then this should be removed.
*/
- if (xd->pmd == VNET_DPDK_PMD_VICE ||
- xd->pmd == VNET_DPDK_PMD_ENIC)
+ if (xd->pmd == VNET_DPDK_PMD_ENIC)
{
/*
* Initialize mtu to what has been set by CIMC in the firmware cfg.
@@ -941,10 +921,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
u32 log_level;
int ret, i;
int num_whitelisted = 0;
-#ifdef NETMAP
- int rxrings, txrings, rxslots, txslots, txburst;
- char * nmnam;
-#endif
u8 no_pci = 0;
u8 no_huge = 0;
u8 huge_dir = 0;
@@ -1001,28 +977,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
num_whitelisted++;
}
-
-#ifdef NETMAP
- else if (unformat(input, "netmap %s/%d:%d/%d:%d/%d",
- &nmname, &rxrings, &rxslots, &txrings, &txslots, &txburst)) {
- char * rv;
- rv = (char *)
- eth_nm_args(nmname, rxrings, rxslots, txrings, txslots, txburst);
- if (rv) {
- error = clib_error_return (0, "%s", rv);
- goto done;
- }
- }else if (unformat(input, "netmap %s", &nmname)) {
- char * rv;
- rv = (char *)
- eth_nm_args(nmname, 0, 0, 0, 0, 0);
- if (rv) {
- error = clib_error_return (0, "%s", rv);
- goto done;
- }
- }
-#endif
-
else if (unformat (input, "num-mbufs %d", &conf->num_mbufs))
;
else if (unformat (input, "kni %d", &conf->num_kni))
diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c
index dc2a60e4aa2..689e4f8709f 100644
--- a/vnet/vnet/devices/dpdk/node.c
+++ b/vnet/vnet/devices/dpdk/node.c
@@ -58,21 +58,13 @@ static char * dpdk_error_strings[] = {
always_inline int
dpdk_mbuf_is_ip4(struct rte_mbuf *mb)
{
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 1, 0, 0)
return RTE_ETH_IS_IPV4_HDR(mb->packet_type) != 0;
-#else
- return (mb_flags & (PKT_RX_IPV4_HDR | PKT_RX_IPV4_HDR_EXT)) != 0;
-#endif
}
always_inline int
dpdk_mbuf_is_ip6(struct rte_mbuf *mb)
{
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 1, 0, 0)
return RTE_ETH_IS_IPV6_HDR(mb->packet_type) != 0;
-#else
- return (mb_flags & (PKT_RX_IPV6_HDR | PKT_RX_IPV6_HDR_EXT)) != 0;
-#endif
}
always_inline int
diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c
index 1918a8fe634..2e7ecb18fb7 100644
--- a/vnet/vnet/devices/dpdk/vhost_user.c
+++ b/vnet/vnet/devices/dpdk/vhost_user.c
@@ -55,18 +55,14 @@ static const char *vhost_message_str[] __attribute__((unused)) = {
[VHOST_USER_SET_VRING_KICK] = "VHOST_USER_SET_VRING_KICK",
[VHOST_USER_SET_VRING_CALL] = "VHOST_USER_SET_VRING_CALL",
[VHOST_USER_SET_VRING_ERR] = "VHOST_USER_SET_VRING_ERR",
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
[VHOST_USER_GET_PROTOCOL_FEATURES] = "VHOST_USER_GET_PROTOCOL_FEATURES",
[VHOST_USER_SET_PROTOCOL_FEATURES] = "VHOST_USER_SET_PROTOCOL_FEATURES",
[VHOST_USER_GET_QUEUE_NUM] = "VHOST_USER_GET_QUEUE_NUM",
[VHOST_USER_SET_VRING_ENABLE] = "VHOST_USER_SET_VRING_ENABLE",
-#endif
};
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
static int dpdk_vhost_user_set_vring_enable(u32 hw_if_index,
u8 idx, int enable);
-#endif
/*
* DPDK vhost-user functions
@@ -157,21 +153,15 @@ static void stop_processing_packets(u32 hw_if_index, u8 idx)
dpdk_device_t *xd =
dpdk_vhost_user_device_from_hw_if_index(hw_if_index);
assert(xd);
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
xd->vu_vhost_dev.virtqueue[idx]->enabled = 0;
-#else
- xd->vu_is_running = 0;
-#endif
}
static void disable_interface(dpdk_device_t * xd)
{
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
u8 idx;
int numqs = xd->vu_vhost_dev.virt_qp_nb * VIRTIO_QNUM;
for (idx = 0; idx < numqs; idx++)
xd->vu_vhost_dev.virtqueue[idx]->enabled = 0;
-#endif
xd->vu_is_running = 0;
}
@@ -203,9 +193,7 @@ dpdk_create_vhost_user_if_internal (u32 * hw_if_index, u32 if_id, u8 *hwaddr)
int num_qpairs = 1;
dpdk_vu_intf_t *vui = NULL;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
num_qpairs = dm->use_rss < 1 ? 1 : tm->n_vlib_mains;
-#endif
dpdk_device_t * xd = NULL;
u8 addr[6];
@@ -274,9 +262,7 @@ dpdk_create_vhost_user_if_internal (u32 * hw_if_index, u32 if_id, u8 *hwaddr)
xd->dev_type = VNET_DPDK_DEV_VHOST_USER;
xd->rx_q_used = num_qpairs;
xd->tx_q_used = num_qpairs;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
xd->vu_vhost_dev.virt_qp_nb = num_qpairs;
-#endif
vec_validate_aligned (xd->rx_vectors, xd->rx_q_used, CLIB_CACHE_LINE_BYTES);
@@ -411,7 +397,6 @@ static long get_huge_page_size(int fd)
}
#endif
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
static clib_error_t *
dpdk_vhost_user_set_protocol_features(u32 hw_if_index, u64 prot_features)
{
@@ -421,7 +406,6 @@ dpdk_vhost_user_set_protocol_features(u32 hw_if_index, u64 prot_features)
xd->vu_vhost_dev.protocol_features = prot_features;
return 0;
}
-#endif
static clib_error_t *
dpdk_vhost_user_get_features(u32 hw_if_index, u64 * features)
@@ -466,14 +450,11 @@ dpdk_vhost_user_set_features(u32 hw_if_index, u64 features)
int numqs = VIRTIO_QNUM;
u8 idx;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
int prot_feature = features &
(1ULL << VHOST_USER_F_PROTOCOL_FEATURES);
numqs = xd->vu_vhost_dev.virt_qp_nb * VIRTIO_QNUM;
-#endif
for (idx = 0; idx < numqs; idx++) {
xd->vu_vhost_dev.virtqueue[idx]->vhost_hlen = hdr_len;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
/*
* Spec says, if F_PROTOCOL_FEATURE is not set by the
* slave, then all the vrings should start off as
@@ -482,7 +463,6 @@ dpdk_vhost_user_set_features(u32 hw_if_index, u64 features)
*/
if (! prot_feature)
dpdk_vhost_user_set_vring_enable(hw_if_index, idx, 1);
-#endif
}
return 0;
@@ -634,7 +614,6 @@ dpdk_vhost_user_get_vring_base(u32 hw_if_index, u8 idx, u32 * num)
* and stop ring upon receiving VHOST_USER_GET_VRING_BASE.
*/
DBG_SOCK("Stopping vring Q %u of device %d", idx, hw_if_index);
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
dpdk_vu_intf_t *vui = xd->vu_intf;
vui->vrings[idx].enabled = 0; /* Reset local copy */
vui->vrings[idx].callfd = -1; /* Reset FD */
@@ -658,12 +637,6 @@ dpdk_vhost_user_get_vring_base(u32 hw_if_index, u8 idx, u32 * num)
DBG_SOCK("Device %d disabled", hw_if_index);
xd->vu_is_running = 0;
}
-#else
- vq->desc = NULL;
- vq->used = NULL;
- vq->avail = NULL;
- xd->vu_is_running = 0;
-#endif
return 0;
}
@@ -695,9 +668,7 @@ dpdk_vhost_user_set_vring_kick(u32 hw_if_index, u8 idx, int fd)
{
dpdk_main_t * dm = &dpdk_main;
dpdk_device_t * xd;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
dpdk_vu_vring *vring;
-#endif
struct vhost_virtqueue *vq0, *vq1, *vq;
int index, vu_is_running = 0;
@@ -709,29 +680,20 @@ dpdk_vhost_user_set_vring_kick(u32 hw_if_index, u8 idx, int fd)
vq = xd->vu_vhost_dev.virtqueue[idx];
vq->kickfd = fd;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
vring = &xd->vu_intf->vrings[idx];
vq->enabled = (vq->desc && vq->avail && vq->used && vring->enabled) ? 1 : 0;
-#endif
/*
* Set xd->vu_is_running if at least one pair of
* RX/TX queues are enabled.
*/
int numqs = VIRTIO_QNUM;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
numqs = xd->vu_vhost_dev.virt_qp_nb * VIRTIO_QNUM;
-#endif
for (index = 0; index < numqs; index += 2) {
vq0 = xd->vu_vhost_dev.virtqueue[index]; /* RX */
vq1 = xd->vu_vhost_dev.virtqueue[index + 1]; /* TX */
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
if (vq0->enabled && vq1->enabled)
-#else
- if (vq0->desc && vq0->avail && vq0->used &&
- vq1->desc && vq1->avail && vq1->used)
-#endif
{
vu_is_running = 1;
break;
@@ -750,7 +712,6 @@ dpdk_vhost_user_set_vring_kick(u32 hw_if_index, u8 idx, int fd)
return 0;
}
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
static int
dpdk_vhost_user_set_vring_enable(u32 hw_if_index, u8 idx, int enable)
{
@@ -790,7 +751,6 @@ dpdk_vhost_user_set_vring_enable(u32 hw_if_index, u8 idx, int enable)
return 0;
}
-#endif
static clib_error_t * dpdk_vhost_user_callfd_read_ready (unix_file_t * uf)
{
@@ -886,11 +846,7 @@ dpdk_vhost_user_vui_init(vnet_main_t * vnm,
memset(vui, 0, sizeof(*vui));
vui->unix_fd = sockfd;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
vui->num_vrings = xd->vu_vhost_dev.virt_qp_nb * VIRTIO_QNUM;
-#else
- vui->num_vrings = VIRTIO_QNUM;
-#endif
DBG_SOCK("dpdk_vhost_user_vui_init VRINGS: %d", vui->num_vrings);
vui->sock_is_server = is_server;
strncpy(vui->sock_filename, sock_filename, ARRAY_LEN(vui->sock_filename)-1);
@@ -1245,7 +1201,6 @@ static clib_error_t * dpdk_vhost_user_socket_read (unix_file_t * uf)
xd->vlib_hw_if_index);
break;
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
case VHOST_USER_GET_PROTOCOL_FEATURES:
DBG_SOCK("if %d msg VHOST_USER_GET_PROTOCOL_FEATURES",
xd->vlib_hw_if_index);
@@ -1281,7 +1236,6 @@ static clib_error_t * dpdk_vhost_user_socket_read (unix_file_t * uf)
msg.u64 = xd->vu_vhost_dev.virt_qp_nb;
msg.size = sizeof(msg.u64);
break;
-#endif
default:
DBG_SOCK("unknown vhost-user message %d received. closing socket",
@@ -1918,17 +1872,10 @@ show_dpdk_vhost_user_command_fn (vlib_main_t * vm,
vlib_cli_output(vm, " avail.flags %x avail.idx %d used.flags %x used.idx %d\n",
vq->avail->flags, vq->avail->idx, vq->used->flags, vq->used->idx);
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
vlib_cli_output(vm, " kickfd %d callfd %d errfd %d enabled %d\n",
vq->kickfd, vq->callfd, vui->vrings[q].errfd, vq->enabled);
if (show_descr && vq->enabled) {
-#else
- vlib_cli_output(vm, " kickfd %d callfd %d errfd\n",
- vq->kickfd, vq->callfd, vui->vrings[q].errfd);
-
- if (show_descr) {
-#endif
vlib_cli_output(vm, "\n descriptor table:\n");
vlib_cli_output(vm, " id addr len flags next user_addr\n");
vlib_cli_output(vm, " ===== ================== ===== ====== ===== ==================\n");
diff --git a/vnet/vnet/devices/virtio/vhost-user.h b/vnet/vnet/devices/virtio/vhost-user.h
index 8675f871fd5..c0f6e6ff7af 100644
--- a/vnet/vnet/devices/virtio/vhost-user.h
+++ b/vnet/vnet/devices/virtio/vhost-user.h
@@ -30,7 +30,6 @@
#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
#define VHOST_VRING_F_LOG 0
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
#define VHOST_USER_F_PROTOCOL_FEATURES 30
#if RTE_VERSION >= RTE_VERSION_NUM(16, 4, 0, 0)
#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
@@ -44,7 +43,6 @@
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1
#define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000
-#endif
#define foreach_virtio_net_feature \
_ (VIRTIO_NET_F_MRG_RXBUF, 15) \
@@ -115,9 +113,7 @@ typedef enum vhost_user_req {
VHOST_USER_SET_VRING_ERR = 14,
VHOST_USER_GET_PROTOCOL_FEATURES = 15,
VHOST_USER_SET_PROTOCOL_FEATURES = 16,
-#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
VHOST_USER_GET_QUEUE_NUM = 17,
-#endif
VHOST_USER_SET_VRING_ENABLE = 18,
VHOST_USER_MAX
} vhost_user_req_t;