Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions
@ 2026-09-08  9:40 Jiangshan Yi
  2026-09-08  9:51 ` Ratheesh Kannoth
  2026-09-10  9:42 ` netdev-bot+sashiko
  0 siblings, 2 replies; 4+ messages in thread
From: Jiangshan Yi @ 2026-09-08  9:40 UTC (permalink / raw)
  To: sgoutham, rkannoth, gakula, sbhatta, andrew+netdev, davem,
	edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, 13667453960, Jiangshan Yi

commit f695390ea639 ("octeontx2-af: Fix limiting SRIOV VF count logic")
added a local PCI_DEVID_OCTEONTX2_RVU_AFVF define in rvu.c, duplicating
RVU_LBK_VF_DEVID in rvu.h.  Move the definition into the "PCI device
IDs" block in rvu.h, rename RVU_LBK_VF_DEVID to match the PCI_DEVID_*
naming convention of its peers, and drop the local define.

No functional change.

Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 2 --
 drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index 937b085582b5..65e08ad9d82e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -3468,8 +3468,6 @@ int rvu_get_num_lbk_chans(void)
 	return ret;
 }
 
-#define PCI_DEVID_OCTEONTX2_RVU_AFVF	0xA0F8
-
 static int rvu_enable_sriov(struct rvu *rvu)
 {
 	struct pci_dev *pdev = rvu->pdev;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index 094227404ef9..16846eeb793d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -22,6 +22,7 @@
 
 /* PCI device IDs */
 #define	PCI_DEVID_OCTEONTX2_RVU_AF		0xA065
+#define	PCI_DEVID_OCTEONTX2_RVU_AFVF		0xA0F8
 #define	PCI_DEVID_OCTEONTX2_LBK			0xA061
 
 /* Subsystem Device ID */
@@ -882,11 +883,10 @@ static inline bool is_rvu_supports_nix1(struct rvu *rvu)
 /* Function Prototypes
  * RVU
  */
-#define	RVU_LBK_VF_DEVID	0xA0F8
 static inline bool is_lbk_vf(struct rvu *rvu, u16 pcifunc)
 {
 	return (!(pcifunc & ~RVU_PFVF_FUNC_MASK) &&
-		(rvu->vf_devid == RVU_LBK_VF_DEVID));
+		(rvu->vf_devid == PCI_DEVID_OCTEONTX2_RVU_AFVF));
 }
 
 static inline bool is_vf(u16 pcifunc)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions
  2026-09-08  9:40 [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions Jiangshan Yi
@ 2026-09-08  9:51 ` Ratheesh Kannoth
  2026-09-08 10:31   ` Jiangshan Yi
  2026-09-10  9:42 ` netdev-bot+sashiko
  1 sibling, 1 reply; 4+ messages in thread
From: Ratheesh Kannoth @ 2026-09-08  9:51 UTC (permalink / raw)
  To: Jiangshan Yi
  Cc: sgoutham, gakula, sbhatta, andrew+netdev, davem, edumazet, kuba,
	pabeni, netdev, linux-kernel, 13667453960

On 2026-09-08 at 15:10:51, Jiangshan Yi (yijiangshan@kylinos.cn) wrote:
> commit f695390ea639 ("octeontx2-af: Fix limiting SRIOV VF count logic")
> added a local PCI_DEVID_OCTEONTX2_RVU_AFVF define in rvu.c, duplicating
> RVU_LBK_VF_DEVID in rvu.h.  Move the definition into the "PCI device
> IDs" block in rvu.h, rename RVU_LBK_VF_DEVID to match the PCI_DEVID_*
> naming convention of its peers, and drop the local define.
>
> No functional change.
>

has the code been compile-tested?
Acked-by: Ratheesh Kannoth <rkannoth@marvell.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions
  2026-09-08  9:51 ` Ratheesh Kannoth
@ 2026-09-08 10:31   ` Jiangshan Yi
  0 siblings, 0 replies; 4+ messages in thread
From: Jiangshan Yi @ 2026-09-08 10:31 UTC (permalink / raw)
  To: rkannoth
  Cc: 13667453960, andrew+netdev, davem, edumazet, gakula, kuba,
	linux-kernel, netdev, pabeni, sbhatta, sgoutham, yijiangshan

Hi Ratheesh,

Yes.  The patch was compile-tested against net-next with
CONFIG_OCTEONTX2_AF=y, and I also verified that no other users of
RVU_LBK_VF_DEVID were missed.

Thanks for the review and the Ack.

Jiangshan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions
  2026-09-08  9:40 [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions Jiangshan Yi
  2026-09-08  9:51 ` Ratheesh Kannoth
@ 2026-09-10  9:42 ` netdev-bot+sashiko
  1 sibling, 0 replies; 4+ messages in thread
From: netdev-bot+sashiko @ 2026-09-10  9:42 UTC (permalink / raw)
  To: yijiangshan
  Cc: sgoutham, rkannoth, gakula, sbhatta, andrew+netdev, davem,
	edumazet, kuba, pabeni, netdev, linux-kernel, 13667453960

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 1 · Low: 0

- [Medium] Incomplete consolidation: the patch's stated goal
  ("octeontx2-af: consolidate RVU AFVF device id definitions") is only…

--

octeontx2-af: consolidate RVU AFVF device id definitions

This moves the local PCI_DEVID_OCTEONTX2_RVU_AFVF define from af/rvu.c into
the "PCI device IDs" block in af/rvu.h, and renames RVU_LBK_VF_DEVID to the
same name so both users share one definition.  The change is documented as
having no functional impact.

> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> index 9afb7ac8969b5..fb4870cd18e9e 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> @@ -22,6 +22,7 @@
>  
>  /* PCI device IDs */
>  #define	PCI_DEVID_OCTEONTX2_RVU_AF		0xA065
> +#define	PCI_DEVID_OCTEONTX2_RVU_AFVF		0xA0F8
>  #define	PCI_DEVID_OCTEONTX2_LBK			0xA061

[Severity: Medium]
Is the consolidation complete here?  There is still a third definition of
the same macro in nic/otx2_common.h:

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h:
    #include <rvu.h>
    ...
    #define PCI_DEVID_OCTEONTX2_RVU_AFVF		0xA0F8

Since nic/Makefile adds:

    ccflags-y += -I$(srctree)/drivers/net/ethernet/marvell/octeontx2/af

the <rvu.h> included by nic/otx2_common.h is the header modified by this
patch, so after this change every object built from nic/ (otx2_pf.o,
otx2_common.o, otx2_vf.o, rep.o) sees PCI_DEVID_OCTEONTX2_RVU_AFVF defined
twice within one translation unit.

Both replacement lists are the identical token 0xA0F8, so this is a benign
redefinition and no warning or build failure results.  Would it make sense
to also drop the copy in nic/otx2_common.h, so that its users
(is_..._vf() in nic/otx2_common.h and the PCI id table in nic/otx2_vf.c)
pick up the definition through the included af/rvu.h?

As it stands, does the commit message claim more than the diff does when it
says the goal is to "consolidate RVU AFVF device id definitions" and
"drop the local define", given that two live definitions remain?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260908094051.666769-1-yijiangshan%40kylinos.cn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-10  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08  9:40 [PATCH net-next] octeontx2-af: consolidate RVU AFVF device id definitions Jiangshan Yi
2026-09-08  9:51 ` Ratheesh Kannoth
2026-09-08 10:31   ` Jiangshan Yi
2026-09-10  9:42 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox