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 a08beb4afc6b7da7786cd7c827643689c1ee86d0 (commit) via f14b2bb379065f70174cc46a3cb2f7577eaecf2c (commit) from bb09ee5afa739db4c6775e4d1481ecf7b2c6ee4d (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 a08beb4afc6b7da7786cd7c827643689c1ee86d0 Author: Petri Savolainen petri.savolainen@linaro.org Date: Mon Oct 1 17:21:10 2018 +0300
linux-gen: dpdk: prefetch packet data early
Prefetch packet data for pkt[i + 2], while working on pkt[i]. This improves performance when packet is parsed.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-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 941de963..f1ace71f 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -749,9 +749,11 @@ fail: static inline void prefetch_pkt(struct rte_mbuf *mbuf) { odp_packet_hdr_t *pkt_hdr = mbuf->userdata; + void *data = rte_pktmbuf_mtod(mbuf, char *);
odp_prefetch(pkt_hdr); odp_prefetch(&pkt_hdr->p); + odp_prefetch(data); }
static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, @@ -795,8 +797,6 @@ static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, }
data = rte_pktmbuf_mtod(mbuf, char *); - odp_prefetch(data); - pkt_len = rte_pktmbuf_pkt_len(mbuf);
pkt = (odp_packet_t)mbuf->userdata;
commit f14b2bb379065f70174cc46a3cb2f7577eaecf2c Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Sep 28 12:59:10 2018 +0300
linux-gen: dpdk: prefetch pkt_hdr before packet init
Two most often referenced packet header cachelines are prefetched. Improve effectiveness by prefetching pkt_hdr[i + 2], while working on pkt_hdr[i].
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-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 caebdfe8..941de963 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -746,6 +746,14 @@ fail: return i; }
+static inline void prefetch_pkt(struct rte_mbuf *mbuf) +{ + odp_packet_hdr_t *pkt_hdr = mbuf->userdata; + + odp_prefetch(pkt_hdr); + odp_prefetch(&pkt_hdr->p); +} + static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[], struct rte_mbuf *mbuf_table[], @@ -756,16 +764,29 @@ static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, uint16_t pkt_len; struct rte_mbuf *mbuf; void *data; - int i; - int nb_pkts = 0; - odp_pool_t pool = pkt_priv(pktio_entry)->pool; - odp_pktin_config_opt_t pktin_cfg = pktio_entry->s.config.pktin; - odp_proto_layer_t parse_layer = pktio_entry->s.config.parser.layer; - odp_pktio_t input = pktio_entry->s.handle; + int i, nb_pkts; + odp_pool_t pool; + odp_pktin_config_opt_t pktin_cfg; + odp_proto_layer_t parse_layer; + odp_pktio_t input; + + prefetch_pkt(mbuf_table[0]); + + nb_pkts = 0; + pool = pkt_priv(pktio_entry)->pool; + pktin_cfg = pktio_entry->s.config.pktin; + parse_layer = pktio_entry->s.config.parser.layer; + input = pktio_entry->s.handle; + + if (odp_likely(mbuf_num > 1)) + prefetch_pkt(mbuf_table[1]);
for (i = 0; i < mbuf_num; i++) { odp_packet_hdr_t parsed_hdr;
+ if (odp_likely((i + 2) < mbuf_num)) + prefetch_pkt(mbuf_table[i + 2]); + mbuf = mbuf_table[i]; if (odp_unlikely(mbuf->nb_segs != 1)) { ODP_ERR("Segmented buffers not supported\n");
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/pktio/dpdk.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-)
hooks/post-receive