From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: Sean Morrissey <sean.morrissey@intel.com>,
Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [PATCH v1] examples/l3fwd: fix core dump after packet match
Date: Wed, 21 Sep 2022 19:14:28 +0100 [thread overview]
Message-ID: <51e09ee2-2776-bfd8-ad7c-d658fe3f62cc@intel.com> (raw)
In-Reply-To: <20220907113354.1443744-1-sean.morrissey@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
On 07/09/2022 12:33, Sean Morrissey wrote:
> This patch fixes a core dump which occurs on 32-bit-builds
> after sending a matched packet due to overrunning an array.
>
> Fixes: 6de0ea50e9b9 ("examples/l3fwd: merge l3fwd-acl example")
> Cc: sean.morrissey@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
> examples/l3fwd/l3fwd_acl_scalar.h | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/examples/l3fwd/l3fwd_acl_scalar.h b/examples/l3fwd/l3fwd_acl_scalar.h
> index cd99f8594a..542c303d3b 100644
> --- a/examples/l3fwd/l3fwd_acl_scalar.h
> +++ b/examples/l3fwd/l3fwd_acl_scalar.h
> @@ -70,15 +70,12 @@ send_packets_single(struct lcore_conf *qconf, struct rte_mbuf *pkts[], uint16_t
>
> /* Set MAC addresses. */
> eth_hdr = rte_pktmbuf_mtod(pkts[j], struct rte_ether_hdr *);
> - *(uint64_t *)ð_hdr->dst_addr = dest_eth_addr[hops[j]];
> - rte_ether_addr_copy(&ports_eth_addr[hops[j]],
> - ð_hdr->src_addr);
> - }
> -
> - for (j = 0; j != nb_tx; j++) {
> - if (hops[j] != BAD_PORT)
> + if (hops[j] != BAD_PORT) {
> + *(uint64_t *)ð_hdr->dst_addr = dest_eth_addr[hops[j]];
> + rte_ether_addr_copy(&ports_eth_addr[hops[j]],
> + ð_hdr->src_addr);
> send_single_packet(qconf, pkts[j], hops[j]);
> - else
> + } else
> rte_pktmbuf_free(pkts[j]);
> }
> }
--
Regards,
Vladimir
next prev parent reply other threads:[~2022-09-21 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 11:33 Sean Morrissey
2022-09-21 18:14 ` Medvedkin, Vladimir [this message]
2022-10-08 3:11 ` Chen, LingliX
2022-10-10 21:51 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51e09ee2-2776-bfd8-ad7c-d658fe3f62cc@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=sean.morrissey@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).