aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Kiss <zoltan.kiss@linaro.org>2015-04-22 16:30:49 +0100
committerZoltan Kiss <zoltan.kiss@linaro.org>2015-04-23 21:08:32 +0100
commite856aa58da68ed6c76f6abed54772947b602f62e (patch)
tree927a0c0a4ef0999698dad2b0a304cab9822d2c11
parentb580725696bd2ce2cca2279e336160a2887dcb9e (diff)
pktio: remove send_pkt_dpdk()
Apart from calling rte_eth_tx_burst the only thing it does is to copy the pkt_table[] array into an another one. As far as I can determine DPDK doesn't touch this array of pointers, so it's not necessary to copy it. I've merged the rest of it into odp_pktio_send() Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r--platform/linux-dpdk/include/odp_packet_dpdk.h6
-rw-r--r--platform/linux-dpdk/odp_packet_dpdk.c13
-rw-r--r--platform/linux-dpdk/odp_packet_io.c6
3 files changed, 4 insertions, 21 deletions
diff --git a/platform/linux-dpdk/include/odp_packet_dpdk.h b/platform/linux-dpdk/include/odp_packet_dpdk.h
index 185a7e6a5..ced4f5b63 100644
--- a/platform/linux-dpdk/include/odp_packet_dpdk.h
+++ b/platform/linux-dpdk/include/odp_packet_dpdk.h
@@ -100,11 +100,5 @@ int close_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk);
int recv_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, odp_packet_t pkt_table[],
unsigned len);
-/**
- * Send packets using dpdk
- */
-int send_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, odp_packet_t pkt_table[],
- unsigned len);
-
int odp_init_dpdk(void);
#endif
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c
index 6184b2a77..c4c095b6b 100644
--- a/platform/linux-dpdk/odp_packet_dpdk.c
+++ b/platform/linux-dpdk/odp_packet_dpdk.c
@@ -182,16 +182,3 @@ int recv_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, odp_packet_t pkt_table[],
}
return nb_rx;
}
-
-int send_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, odp_packet_t pkt_table[],
- unsigned len)
-{
- struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
- uint16_t i;
-
- for (i = 0; i < len; i++)
- pkts_burst[i] = (struct rte_mbuf *)pkt_table[i];
- return rte_eth_tx_burst((uint8_t)pkt_dpdk->portid,
- (uint16_t)pkt_dpdk->queueid,
- (struct rte_mbuf **)pkts_burst, (uint16_t)len);
-}
diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c
index 35a56af13..4d5271376 100644
--- a/platform/linux-dpdk/odp_packet_io.c
+++ b/platform/linux-dpdk/odp_packet_io.c
@@ -250,14 +250,16 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], int len)
int odp_pktio_send(odp_pktio_t id, odp_packet_t pkt_table[], int len)
{
pktio_entry_t *pktio_entry = get_entry(id);
+ pkt_dpdk_t *pkt_dpdk;
int pkts;
if (pktio_entry == NULL)
return -1;
+ pkt_dpdk = &pktio_entry->s.pkt_dpdk;
lock_entry(pktio_entry);
- pkts = send_pkt_dpdk(&pktio_entry->s.pkt_dpdk,
- pkt_table, len);
+ pkts = rte_eth_tx_burst(pkt_dpdk->portid, pkt_dpdk->queueid,
+ (struct rte_mbuf **)pkt_table, len);
unlock_entry(pktio_entry);
return pkts;