aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/odp/odp_packet.c
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2017-11-26 19:28:55 +0100
committerMichal Mazur <mkm@semihalf.com>2017-12-18 18:21:00 +0100
commit945f7e8ebe39ffa80dfb38b950406a7dd4935f1f (patch)
tree815c85288b34ccb3058d8b2b46a65bff846f256d /src/plugins/odp/odp_packet.c
parent4c34d6c16947c5e1465319d9d44dbdaaa2f04c4e (diff)
More optimizations for Tx and Rx loops
1) Parse multiple output packets in loop. 2) Remove checking for error flags, they are never set because ODP parser is disabled. 3) Do not call vlib_buffer_advance if not necessary. 4) Remove lock in TX path. Queues are synchronized by ODP. 5) Optimize detection of packet type. 6) Create a wrapper for call to odp_packet_user_area. Change-Id: Ib50c9be9a62d67824b58ef2cd443b7fc59471655 Signed-off-by: Michal Mazur <mkm@semihalf.com>
Diffstat (limited to 'src/plugins/odp/odp_packet.c')
-rwxr-xr-xsrc/plugins/odp/odp_packet.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/plugins/odp/odp_packet.c b/src/plugins/odp/odp_packet.c
index 86992c67..271e7a3e 100755
--- a/src/plugins/odp/odp_packet.c
+++ b/src/plugins/odp/odp_packet.c
@@ -30,42 +30,6 @@ odp_packet_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi,
return 0;
}
-/**
- * Drop packets which input parsing marked as containing errors.
- *
- * Frees packets with error and modifies pkt_tbl[] to only contain packets with
- * no detected errors.
- *
- * @param pkt_tbl Array of packet
- * @param len Length of pkt_tbl[]
- *
- * @return Number of packets with no detected error
- */
-u32
-drop_err_pkts (odp_packet_t pkt_tbl[], unsigned len)
-{
- odp_packet_t pkt;
- unsigned pkt_cnt = len;
- unsigned i, j;
-
- for (i = 0, j = 0; i < len; ++i)
- {
- pkt = pkt_tbl[i];
-
- if (odp_unlikely (odp_packet_has_error (pkt)))
- {
- odp_packet_free (pkt); /* Drop */
- pkt_cnt--;
- }
- else if (odp_unlikely (i != j++))
- {
- pkt_tbl[j - 1] = pkt;
- }
- }
-
- return pkt_cnt;
-}
-
static odp_pktio_t
create_pktio (const char *dev, odp_pool_t pool, odp_packet_if_t * oif)
{
@@ -227,13 +191,6 @@ odp_packet_create_if (vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
om->if_count++;
- if (tm->n_vlib_mains > 1)
- {
- oif->lockp = clib_mem_alloc_aligned (CLIB_CACHE_LINE_BYTES,
- CLIB_CACHE_LINE_BYTES);
- memset ((void *) oif->lockp, 0, CLIB_CACHE_LINE_BYTES);
- }
-
if (mode->rx_mode == APPL_MODE_PKT_BURST)
odp_pktin_queue (oif->pktio, oif->inq, oif->m.num_rx_queues);
else if (mode->rx_mode == APPL_MODE_PKT_QUEUE)