DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bulatov Mark <ms.bulatov7@gmail.com>
Cc: "Niklas Söderlund" <niklas.soderlund@corigine.com>,
	"Chaoyong He" <chaoyong.he@corigine.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] net/nfp: fix wrong argument order in nfp_encode_basic
Date: Sun, 15 Nov 2026 13:48:22 -0800	[thread overview]
Message-ID: <20261115134822.7c82ac95@phoenix.local> (raw)
In-Reply-To: <20261113142823.5918-1-ms.bulatov7@gmail.com>

On Fri, 13 Nov 2026 17:28:23 +0300
Bulatov Mark <ms.bulatov7@gmail.com> wrote:

> The function nfp_encode_basic_qdr() takes cpp_tgt as its second argument
> and dest_island as its third. However, the implementation of this function
> implies the opposite: dest_island should be the second argument, and
> cpp_tgt the third.
> 
> Furthermore, the implementation compares the second argument against a
> negative value, whereas the cpp_tgt parameter — as defined in the
> nfp_target.h header file—consists of a set of values ​​that does not
> include any negative numbers. The situation is exactly the reverse for
> the nfp_decode_basic() function, which receives a value for which these
> definitions are not entirely appropriate.
> 
> Fix this by swapping the arguments.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: e6858e7e7c ("net/nfp: move shared target logic to own file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Mark Bulatov <ms.bulatov7@gmail.com>
> ---

Several issues need fixing from AI review.

[PATCH] net/nfp: fix wrong argument order in nfp_encode_basic

The fix is correct. nfp_encode_basic_qdr() is declared as
(addr, dest_island, cpp_tgt, ...) and all four callers pass
(addr, cpp_tgt, dest_island, ...). With the swap, decode skipped the
MU/CT_XPB guard on the real target and the final compare checked the
decoded island against NFP_CPP_TARGET_QDR (2) instead of dest_island,
so QDR encoding failed with -EINVAL unless the island happened to be 2.

Warning: Author does not match Signed-off-by.

  The patch has no "From: Mark Bulatov" line in the body, so git am
  records the author as "Bulatov Mark" while the Signed-off-by is
  "Mark Bulatov". The first patch has the body From: line; this one
  needs it too, or fix user.name so the header is right.

Warning: Commit message contains non-ASCII characters: two em-dashes
and two zero-width spaces (U+200B) in "values that". The second
paragraph is also hard to follow. Suggest:

	nfp_encode_basic_qdr() takes dest_island as its second argument
	and cpp_tgt as its third, but all callers in nfp_encode_basic()
	pass them in the opposite order. As a result nfp_decode_basic()
	gets the island ID as the target, and the island check compares
	against NFP_CPP_TARGET_QDR instead of the requested island.

	Swap the arguments.

Warning: Fixes tag needs a 12 character hash:

	Fixes: e6858e7e7cd3 ("net/nfp: move shared target logic to own file")

      reply	other threads:[~2026-11-15 21:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 14:28 [PATCH] net/nfp: fix wrong argument order in nfp_encode_basic Bulatov Mark
2026-11-15 21:48 ` Stephen Hemminger [this message]

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=20261115134822.7c82ac95@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=ms.bulatov7@gmail.com \
    --cc=niklas.soderlund@corigine.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