RE: [PATCH net-next v12 3/5] eth fbnic: Add msix self test

From: Keller, Jacob E

Date: Tue Feb 10 2026 - 17:56:05 EST




> -----Original Message-----
> From: Paolo Abeni <pabeni@xxxxxxxxxx>
> Sent: Tuesday, February 10, 2026 7:06 AM
> To: mike.marciniszyn@xxxxxxxxx; Alexander Duyck
> <alexanderduyck@xxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; kernel-
> team@xxxxxxxx; Andrew Lunn <andrew+netdev@xxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Simon
> Horman <horms@xxxxxxxxxx>; Russell King <linux@xxxxxxxxxxxxxxx>; Keller,
> Jacob E <jacob.e.keller@xxxxxxxxx>; Mohsin Bashir
> <mohsin.bashr@xxxxxxxxx>; Lee Trager <lee@xxxxxxxxx>; Dan Carpenter
> <dan.carpenter@xxxxxxxxxx>; Pei Xiao <xiaopei01@xxxxxxxxxx>; Stanislav
> Fomichev <sdf@xxxxxxxxxxx>; Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>;
> Samiullah Khawaja <skhawaja@xxxxxxxxxx>; Ahmed Zaki
> <ahmed.zaki@xxxxxxxxx>; Lobakin, Aleksander
> <aleksander.lobakin@xxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next v12 3/5] eth fbnic: Add msix self test
>
> On 2/6/26 4:42 PM, mike.marciniszyn@xxxxxxxxx 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

At least use -ENOMEM or something....