diff options
author | 2016-11-18 10:35:35 +0100 | |
---|---|---|
committer | 2016-11-18 10:35:35 +0100 | |
commit | 4fafa623de9ac35ec6256b3e3b2b61b63e58c675 (patch) | |
tree | f0ade88f0ab5d73338b34d171da0e533927b51f5 /vnet | |
parent | e48b828987a5d89094b141be3912c54e0e0bd733 (diff) |
dpdk: remove unused code
Change-Id: Iabb5a3b15e35fb062c04bbc076b19fe50910d412
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/devices/dpdk/format.c | 84 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/node.c | 30 |
2 files changed, 2 insertions, 112 deletions
diff --git a/vnet/vnet/devices/dpdk/format.c b/vnet/vnet/devices/dpdk/format.c index 4a4f8080..b0e624cd 100644 --- a/vnet/vnet/devices/dpdk/format.c +++ b/vnet/vnet/devices/dpdk/format.c @@ -136,20 +136,6 @@ foreach_dpdk_pkt_rx_offload_flag \ foreach_dpdk_pkt_tx_offload_flag -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS -#define foreach_dpdk_pkt_ext_rx_offload_flag \ - _ (PKT_EXT_RX_PKT_ERROR, "RX Packet Error") \ - _ (PKT_EXT_RX_BAD_FCS, "RX Bad FCS checksum") \ - _ (PKT_EXT_RX_UDP, "RX packet with UDP L4 header") \ - _ (PKT_EXT_RX_TCP, "RX packet with TCP L4 header") \ - _ (PKT_EXT_RX_IPV4_FRAGMENT, "RX packet IPv4 Fragment") - -#define foreach_dpdk_pkt_ext_offload_flag \ - foreach_dpdk_pkt_rx_offload_flag \ - foreach_dpdk_pkt_ext_rx_offload_flag - -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ - u8 * format_dpdk_device_name (u8 * s, va_list * args) { @@ -543,15 +529,10 @@ format_dpdk_rx_dma_trace (u8 * s, va_list * va) format_white_space, indent, t->buffer_index, format_vlib_buffer, &t->buffer); -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - s = format (s, "\n%U%U", - format_white_space, indent, - format_dpdk_rx_rte_mbuf, &t->mb, &t->data); -#else s = format (s, "\n%U%U", format_white_space, indent, format_dpdk_rte_mbuf, &t->mb, &t->data); -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ + if (vm->trace_main.verbose) { s = format (s, "\n%UPacket Dump%s", format_white_space, indent + 2, @@ -671,69 +652,6 @@ format_dpdk_rte_mbuf (u8 * s, va_list * va) return s; } -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - -static inline u8 * -format_dpdk_pkt_rx_offload_flags (u8 * s, va_list * va) -{ - u16 *ol_flags = va_arg (*va, u16 *); - uword indent = format_get_indent (s) + 2; - - if (!*ol_flags) - return s; - - s = format (s, "Packet RX Offload Flags"); - -#define _(F, S) \ - if (*ol_flags & F) \ - { \ - s = format (s, "\n%U%s (0x%04x) %s", \ - format_white_space, indent, #F, F, S); \ - } - - foreach_dpdk_pkt_ext_offload_flag -#undef _ - return s; -} - -u8 * -format_dpdk_rx_rte_mbuf (u8 * s, va_list * va) -{ - struct rte_mbuf *mb = va_arg (*va, struct rte_mbuf *); - ethernet_header_t *eth_hdr = va_arg (*args, ethernet_header_t *); - uword indent = format_get_indent (s) + 2; - - /* - * Note: Assumes mb is head of pkt chain -- port, nb_segs, & pkt_len - * are only valid for the 1st mbuf segment. - */ - s = format (s, "PKT MBUF: port %d, nb_segs %d, pkt_len %d" - "\n%Ubuf_len %d, data_len %d, ol_flags 0x%x" - "\n%Upacket_type 0x%x", - mb->port, mb->nb_segs, mb->pkt_len, - format_white_space, indent, - mb->buf_len, mb->data_len, mb->ol_flags, - format_white_space, indent, mb->packet_type); - - if (mb->ol_flags) - s = format (s, "\n%U%U", format_white_space, indent, - format_dpdk_pkt_rx_offload_flags, &mb->ol_flags); - - if (mb->ol_flags & PKT_RX_VLAN_PKT) - { - ethernet_vlan_header_tv_t *vlan_hdr = - ((ethernet_vlan_header_tv_t *) & (eth_hdr->type)); - s = format (s, " %U", format_dpdk_rte_mbuf_vlan, vlan_hdr); - } - - if (mb->packet_type) - s = format (s, "\n%U%U", format_white_space, indent, - format_dpdk_pkt_types, &mb->packet_type); - - return s; -} -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ - uword unformat_socket_mem (unformat_input_t * input, va_list * va) { diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c index 578a040b..ed92bdee 100644 --- a/vnet/vnet/devices/dpdk/node.c +++ b/vnet/vnet/devices/dpdk/node.c @@ -85,19 +85,11 @@ dpdk_rx_next_and_error_from_mb_flags_x1 (dpdk_device_t * xd, u8 n0; uint16_t mb_flags = mb->ol_flags; - if (PREDICT_FALSE (mb_flags & ( -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - PKT_EXT_RX_PKT_ERROR | PKT_EXT_RX_BAD_FCS | -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ - PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD))) + if (PREDICT_FALSE (mb_flags & (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD))) { /* some error was flagged. determine the drop reason */ n0 = VNET_DEVICE_INPUT_NEXT_DROP; *error0 = -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - (mb_flags & PKT_EXT_RX_PKT_ERROR) ? DPDK_ERROR_RX_PACKET_ERROR : - (mb_flags & PKT_EXT_RX_BAD_FCS) ? DPDK_ERROR_RX_BAD_FCS : -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ (mb_flags & PKT_RX_IP_CKSUM_BAD) ? DPDK_ERROR_IP_CHECKSUM_ERROR : (mb_flags & PKT_RX_L4_CKSUM_BAD) ? DPDK_ERROR_L4_CHECKSUM_ERROR : DPDK_ERROR_NONE; @@ -180,14 +172,6 @@ dpdk_rx_trace (dpdk_main_t * dm, sizeof (t0->buffer.pre_data)); clib_memcpy (&t0->data, mb->buf_addr + mb->data_off, sizeof (t0->data)); -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - /* - * Clear overloaded TX offload flags when a DPDK driver - * is using them for RX flags (e.g. Cisco VIC Ethernet driver) - */ - mb->ol_flags &= PKT_EXT_RX_CLR_TX_FLAGS_MASK; -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ - b += 1; } } @@ -311,18 +295,6 @@ dpdk_device_input (dpdk_main_t * dm, dpdk_rx_next_and_error_from_mb_flags_x1 (xd, mb, b0, &next0, &error0); -#ifdef RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS - /* - * Clear overloaded TX offload flags when a DPDK driver - * is using them for RX flags (e.g. Cisco VIC Ethernet driver) - */ - - if (PREDICT_TRUE (trace_cnt == 0)) - mb->ol_flags &= PKT_EXT_RX_CLR_TX_FLAGS_MASK; - else - trace_cnt--; -#endif /* RTE_LIBRTE_MBUF_EXT_RX_OLFLAGS */ - b0->error = node->errors[error0]; l3_offset0 = ((next0 == VNET_DEVICE_INPUT_NEXT_IP4_INPUT || |