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, api-next has been updated via 4cb02e1caccb9179575e95448fd46979e17d0905 (commit) from 90f2fe4ce26e7a2b66bb5eb13e372ccf3dec0d1c (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 4cb02e1caccb9179575e95448fd46979e17d0905 Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Nov 22 13:58:31 2017 +0200
linux-gen: dpdk: check L3 offset validity
Application is required to set L3 offset when it requests checksum offload. It caused segfault to assume that L3 offset is always set. Minimize the number of if-clauses in non-checksum path by first checking L3 offset.
This fixes https://bugs.linaro.org/show_bug.cgi?id=3491
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bogdan Pricope bogdan.pricope@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 5032b8df..ccccc0a8 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -567,7 +567,10 @@ static inline void pkt_set_ol_tx(odp_pktout_config_opt_t *pktout_cfg, pkt_p->output_flags.l4_chksum);
if (!ipv4_chksum_pkt && !udp_chksum_pkt && !tcp_chksum_pkt) - return; + return; + + if (pkt_p->l4_offset == ODP_PACKET_OFFSET_INVALID) + return;
mbuf->l2_len = pkt_p->l3_offset - pkt_p->l2_offset; mbuf->l3_len = pkt_p->l4_offset - pkt_p->l3_offset; @@ -607,8 +610,6 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, char *data; uint16_t pkt_len; odp_pktout_config_opt_t *pktout_cfg = &pktio_entry->s.config.pktout; - odp_pktout_config_opt_t *pktout_capa = - &pktio_entry->s.capa.config.pktout;
if (odp_unlikely((rte_pktmbuf_alloc_bulk(pkt_dpdk->pkt_pool, mbuf_table, num)))) { @@ -616,7 +617,9 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, return 0; } for (i = 0; i < num; i++) { - pkt_len = _odp_packet_len(pkt_table[i]); + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt_table[i]); + + pkt_len = packet_len(pkt_hdr);
if (pkt_len > pkt_dpdk->mtu) { if (i == 0) @@ -629,10 +632,13 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry,
odp_packet_copy_to_mem(pkt_table[i], 0, pkt_len, data);
- if (pktout_capa->all_bits) - pkt_set_ol_tx(pktout_cfg, pktout_capa, - odp_packet_hdr(pkt_table[i]), + if (pkt_hdr->p.l3_offset != ODP_PACKET_OFFSET_INVALID) { + odp_pktout_config_opt_t *pktout_capa = + &pktio_entry->s.capa.config.pktout; + + pkt_set_ol_tx(pktout_cfg, pktout_capa, pkt_hdr, mbuf_table[i], data); + } } return i;
@@ -741,9 +747,9 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, pkt_hdr->extra_type == PKT_EXTRA_TYPE_DPDK)) { mbuf_update(mbuf, pkt_hdr, pkt_len);
- if (pktout_capa->all_bits) + if (pkt_hdr->p.l3_offset != ODP_PACKET_OFFSET_INVALID) pkt_set_ol_tx(pktout_cfg, pktout_capa, pkt_hdr, - mbuf, odp_packet_data(pkt)); + mbuf, _odp_packet_data(pkt)); } else { pool_t *pool_entry = pkt_hdr->buf_hdr.pool_ptr;
@@ -764,11 +770,11 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, mbuf_init((struct rte_mempool *) pool_entry->ext_desc, mbuf, pkt_hdr); mbuf_update(mbuf, pkt_hdr, pkt_len); - if (pktout_capa->all_bits) + if (pkt_hdr->p.l3_offset != + ODP_PACKET_OFFSET_INVALID) pkt_set_ol_tx(pktout_cfg, pktout_capa, - pkt_hdr, - mbuf, - odp_packet_data(pkt)); + pkt_hdr, mbuf, + _odp_packet_data(pkt)); } } mbuf_table[i] = mbuf;
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/pktio/dpdk.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
hooks/post-receive