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

On Mon, 16 Nov 2026 20:20:37 +0300
Mark Bulatov <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.
> 
> 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.
> 
> Fix this by swapping the arguments.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: e6858e7e7cd3 ("net/nfp: move shared target logic to own file")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Mark Bulatov <ms.bulatov7@gmail.com>
> ---

AI complains about the commit message.


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

Warning: the first paragraph of the commit message is wrong and
contradicts the second.
  It says nfp_encode_basic_qdr() takes cpp_tgt second and
  dest_island third. The prototype is (addr, dest_island, cpp_tgt,
  ...), as the second paragraph correctly says. This looks like v1
  text that was left in. Drop the first paragraph:

    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.

    Fix this by swapping the arguments.

  The fix matches the Linux nfp driver, where all four callers in
  nfpcore/nfp_target.c already pass (*addr, dest_island, cpp_tgt,
  ...). Saying so in the commit message would help the NFP
  maintainers confirm it.

      reply	other threads:[~2026-11-17 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 17:20 [PATCH v2] net/nfp: fix wrong argument order in nfp_encode_basic Mark Bulatov
2026-11-17 18:55 ` 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=20261117105538.1a1adc56@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