All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <matan@nvidia.com>, <rasland@nvidia.com>,
	<stable@dpdk.org>, Aman Singh <aman.deep.singh@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ori Kam <orika@nvidia.com>, Yuying Zhang <yuying.zhang@intel.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH v2] app/testpmd: fix GTP PSC raw processing
Date: Wed, 6 Jul 2022 19:11:50 +0300	[thread overview]
Message-ID: <20220706161150.25447-1-getelson@nvidia.com> (raw)
In-Reply-To: <20220630125055.19719-1-getelson@nvidia.com>

Fix GTP PSP extension size initialization.
Clear input buffer.

Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
v2: fix comment tags order. 
---
 app/test-pmd/cmdline_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 6cb1173385..7f50028eb7 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer *in)
 				const struct rte_flow_item_gtp_psc
 					*opt = item->spec;
 				struct rte_gtp_psc_generic_hdr *hdr;
-
-				*total_size += RTE_ALIGN(sizeof(hdr),
+				size_t hdr_size = RTE_ALIGN(sizeof(*hdr),
 							 sizeof(int32_t));
+
+				*total_size += hdr_size;
 				hdr = (typeof(hdr))(data_tail - (*total_size));
+				memset(hdr, 0, hdr_size);
 				*hdr = opt->hdr;
 				hdr->ext_hdr_len = 1;
 				gtp_psc = i;
-- 
2.34.1


  parent reply	other threads:[~2022-07-06 16:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 12:50 [PATCH] app/testpmd: fix GTP PSC raw processing Gregory Etelson
2022-07-01 13:42 ` Singh, Aman Deep
2022-07-01 15:23   ` Gregory Etelson
2022-07-04  9:08 ` Singh, Aman Deep
2022-07-06 14:28   ` Andrew Rybchenko
2022-07-06 16:11 ` Gregory Etelson [this message]
2022-07-07 12:35   ` [PATCH v2] " Andrew Rybchenko

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=20220706161150.25447-1-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=yuying.zhang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.