This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via be6d2d4f3de94cc314d2367f76432306f4c88b94 (commit) via 95b2d51738e97067f2e2423a83dd077b34c51b8f (commit) via ffda91e73c9153d7a7b7d7948de2f902c261d36e (commit) from 40fb071be7c22776a190d1c7fa32b100510e2b82 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit be6d2d4f3de94cc314d2367f76432306f4c88b94 Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 31 17:24:08 2016 +0300
linux-gen: dpdk: move rx/tx locks
Protect only the required sections of rx/tx functions.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 99eb868..11f3509 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -912,6 +912,9 @@ static int dpdk_recv(pktio_entry_t *pktio_entry, int index, rx_mbufs, num); }
+ if (!pkt_dpdk->lockless_rx) + odp_ticketlock_unlock(&pkt_dpdk->rx_lock[index]); + if (nb_rx > 0) { if (pktio_entry->s.config.pktin.bit.ts_all || pktio_entry->s.config.pktin.bit.ts_ptp) { @@ -922,9 +925,6 @@ static int dpdk_recv(pktio_entry_t *pktio_entry, int index, ts); }
- if (!pktio_entry->s.pkt_dpdk.lockless_rx) - odp_ticketlock_unlock(&pkt_dpdk->rx_lock[index]); - return nb_rx; }
@@ -940,14 +940,17 @@ static int dpdk_send(pktio_entry_t *pktio_entry, int index, if (odp_unlikely(pktio_entry->s.state != PKTIO_STATE_STARTED)) return 0;
- if (!pktio_entry->s.pkt_dpdk.lockless_tx) - odp_ticketlock_lock(&pkt_dpdk->tx_lock[index]); - mbufs = pkt_to_mbuf(pktio_entry, tx_mbufs, pkt_table, num);
+ if (!pkt_dpdk->lockless_tx) + odp_ticketlock_lock(&pkt_dpdk->tx_lock[index]); + tx_pkts = rte_eth_tx_burst(pkt_dpdk->port_id, index, tx_mbufs, mbufs);
+ if (!pkt_dpdk->lockless_tx) + odp_ticketlock_unlock(&pkt_dpdk->tx_lock[index]); + if (odp_unlikely(tx_pkts < num)) { for (i = tx_pkts; i < mbufs; i++) rte_pktmbuf_free(tx_mbufs[i]); @@ -955,9 +958,6 @@ static int dpdk_send(pktio_entry_t *pktio_entry, int index,
odp_packet_free_multi(pkt_table, tx_pkts);
- if (!pktio_entry->s.pkt_dpdk.lockless_tx) - odp_ticketlock_unlock(&pkt_dpdk->tx_lock[index]); - if (odp_unlikely(tx_pkts == 0 && __odp_errno != 0)) return -1;
commit 95b2d51738e97067f2e2423a83dd077b34c51b8f Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 31 17:24:07 2016 +0300
linux-gen: dpdk: bulk alloc mbufs in tx
Bulk alloc mbufs in dpdk_send(). Combined with dpdk mempool cache size increase this improves odp_l2fwd throughput by 5-10 %.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h index 31e1ed7..c63685e 100644 --- a/platform/linux-generic/include/odp_packet_dpdk.h +++ b/platform/linux-generic/include/odp_packet_dpdk.h @@ -20,7 +20,7 @@ #define DPDK_MEMORY_MB 512 #define DPDK_NB_MBUF 16384 #define DPDK_MBUF_BUF_SIZE RTE_MBUF_DEFAULT_BUF_SIZE -#define DPDK_MEMPOOL_CACHE_SIZE 32 +#define DPDK_MEMPOOL_CACHE_SIZE 64 #define DPDK_NM_RX_DESC 128 #define DPDK_NM_TX_DESC 512
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 0a800b7..99eb868 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -826,36 +826,36 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, const odp_packet_t pkt_table[], uint16_t num) { pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; - int i; + int i, j; char *data; uint16_t pkt_len;
+ if (odp_unlikely((rte_pktmbuf_alloc_bulk(pkt_dpdk->pkt_pool, + mbuf_table, num)))) { + ODP_ERR("Failed to alloc mbuf\n"); + return 0; + } for (i = 0; i < num; i++) { pkt_len = odp_packet_len(pkt_table[i]);
if (pkt_len > pkt_dpdk->mtu) { if (i == 0) __odp_errno = EMSGSIZE; - break; - } - - mbuf_table[i] = rte_pktmbuf_alloc(pkt_dpdk->pkt_pool); - if (mbuf_table[i] == NULL) { - ODP_ERR("Failed to alloc mbuf\n"); - break; + goto fail; }
+ /* Packet always fits in mbuf */ data = rte_pktmbuf_append(mbuf_table[i], pkt_len);
- if (data == NULL) { - ODP_ERR("Failed to append mbuf\n"); - rte_pktmbuf_free(mbuf_table[i]); - break; - } - odp_packet_copy_to_mem(pkt_table[i], 0, pkt_len, data); } return i; + +fail: + for (j = i; j < num; j++) + rte_pktmbuf_free(mbuf_table[j]); + + return i; }
static int dpdk_recv(pktio_entry_t *pktio_entry, int index,
commit ffda91e73c9153d7a7b7d7948de2f902c261d36e Author: Matias Elo matias.elo@nokia.com Date: Wed Aug 31 17:24:06 2016 +0300
linux-gen: dpdk: fix buffer freeing in mbuf_to_pkt()
Free dpdk mbufs and odp packets correctly when packet_alloc_multi() isn't able to allocate all requested packets.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index b45c9a8..0a800b7 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -755,6 +755,12 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, alloc_len = pktio_entry->s.pkt_dpdk.data_room;
num = packet_alloc_multi(pool, alloc_len, pkt_table, mbuf_num); + if (num != mbuf_num) { + ODP_DBG("packet_alloc_multi() unable to allocate all packets: " + "%d/%" PRIu16 " allocated\n", num, mbuf_num); + for (i = num; i < mbuf_num; i++) + rte_pktmbuf_free(mbuf_table[i]); + }
for (i = 0; i < num; i++) { odp_packet_hdr_t parsed_hdr; @@ -807,9 +813,9 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, return nb_pkts;
fail: - odp_packet_free_multi(&pkt_table[i], mbuf_num - i); + odp_packet_free_multi(&pkt_table[i], num - i);
- for (j = i; j < mbuf_num; j++) + for (j = i; j < num; j++) rte_pktmbuf_free(mbuf_table[j]);
return (i > 0 ? i : -1);
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/include/odp_packet_dpdk.h | 2 +- platform/linux-generic/pktio/dpdk.c | 56 +++++++++++++----------- 2 files changed, 32 insertions(+), 26 deletions(-)
hooks/post-receive