Netdev List
 help / color / mirror / Atom feed
From: Mike Marciniszyn <mike.marciniszyn@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Alexander Duyck <alexanderduyck@fb.com>,
	Jakub Kicinski <kuba@kernel.org>,
	kernel-team@meta.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Mohsin Bashir <mohsin.bashr@gmail.com>,
	Lee Trager <lee@trager.us>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Pei Xiao <xiaopei01@kylinos.cn>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Samiullah Khawaja <skhawaja@google.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v12 3/5] eth fbnic: Add msix self test
Date: Tue, 10 Feb 2026 13:06:10 -0500	[thread overview]
Message-ID: <aYtzklT3p7lsnC1R@PF5YBGDS.localdomain> (raw)
In-Reply-To: <e806861b-acd4-4615-aada-577e0275bb5d@redhat.com>

On Tue, Feb 10, 2026 at 04:06:23PM +0100, Paolo Abeni wrote:
> On 2/6/26 4:42 PM, mike.marciniszyn@gmail.com wrote:
> > +/**
> > + * fbnic_msix_test - Verify behavior of NIC interrupts
> > + * @fbd: device to test
> > + *
> > + * This function is meant to test the global interrupt registers and the
> > + * PCIe IP MSI-X functionality. It essentially goes through and tests
> > + * test various combinations of the set, clear, and mask bits in order to
> > + * verify the behavior is as we expect it to be from the driver.
> > + *
> > + * Return: non-zero on failure.
> > + **/
> > +int fbnic_msix_test(struct fbnic_dev *fbd)
> > +{
> > +	struct pci_dev *pdev = to_pci_dev(fbd->dev);
> > +	struct fbnic_msix_test_data *test_data;
> > +	int result = 0;
> > +	u32 mask = 0;
> > +	int i;
> > +
> > +	/* Allocate bitmap and IRQ vector table */
> > +	test_data = kzalloc(sizeof(*test_data), GFP_KERNEL);
> > +
> > +	/* Result = 5 for memory allocation failure */
> > +	if (!test_data)
> > +		return 5;
>
> Instead of magic numbers you could define some macros, or simply return
> a boolean success/failures value (as the caller ignores the error code).
>
> /P
>

It is not ignored.

The returned u64 value for all the tests is assigned into a per
test array:

static int fbnic_ethtool_mbx_self_test(struct net_device *netdev, u64 *data)
{
        struct fbnic_net *fbn = netdev_priv(netdev);
        struct fbnic_dev *fbd = fbn->fbd;

        *data = fbnic_fw_mbx_self_test(fbd); <--- stored here

        return !!*data;
}

The rval could be a set of test specific define, but regardless, it is
meant to refer to a failure point in the test.

Mike

  reply	other threads:[~2026-02-10 18:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 15:42 [PATCH net-next v12 0/5] eth fbnic: Add fbnic self tests mike.marciniszyn
2026-02-06 15:42 ` [PATCH net-next v12 1/5] net: export netif_open for self_test usage mike.marciniszyn
2026-02-06 15:42 ` [PATCH net-next v12 2/5] eth fbnic: Add register self test mike.marciniszyn
2026-02-06 15:42 ` [PATCH net-next v12 3/5] eth fbnic: Add msix " mike.marciniszyn
2026-02-10 15:06   ` Paolo Abeni
2026-02-10 18:06     ` Mike Marciniszyn [this message]
2026-02-10 22:55     ` Keller, Jacob E
2026-02-06 15:42 ` [PATCH net-next v12 4/5] eth fbnic: TLV support for use by MBX " mike.marciniszyn
2026-02-06 15:42 ` [PATCH net-next v12 5/5] eth fbnic: Add mailbox " mike.marciniszyn
2026-02-06 15:48 ` [PATCH net-next v12 0/5] eth fbnic: Add fbnic self tests Mike Marciniszyn

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=aYtzklT3p7lsnC1R@PF5YBGDS.localdomain \
    --to=mike.marciniszyn@gmail.com \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alexanderduyck@fb.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=dan.carpenter@linaro.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=lee@trager.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mohsin.bashr@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=skhawaja@google.com \
    --cc=xiaopei01@kylinos.cn \
    /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