mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
@ 2026-10-23 10:01 vmukunda
  2026-10-23 10:06 ` netdev-bot+sinfo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vmukunda @ 2026-10-23 10:01 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, vmukunda

From: Subbaraya Sundeep <sbhatta@marvell.com>

On cn20k, the MCAM match counter cannot be read from
NPC_AF_MATCH_STATX. Skip reading the counter value in
npc_delete_flow on cn20k. Counter support for cn20k is TBD.

Fixes: 5f83b4729440 ("octeontx2-af: Do not access match stats for cn20k")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: vmukunda <vmukunda@marvell.com>
---
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
index ea5d462a66ee..06916b38ae2c 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -1960,7 +1960,7 @@ int rvu_mbox_handler_npc_delete_flow(struct rvu *rvu,
 			/* single rule */
 			} else if (req->entry == iter->entry) {
 				blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
-				if (blkaddr)
+				if (blkaddr && !is_cn20k(rvu_pdev))
 					rsp->cntr_val = rvu_read64(rvu, blkaddr,
 								   NPC_AF_MATCH_STATX(iter->cntr));
 				list_move_tail(&iter->list, &del_list);
-- 
2.25.1


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

* Re: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
  2026-10-23 10:01 [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k vmukunda
@ 2026-10-23 10:06 ` netdev-bot+sinfo
  2026-10-24  0:03 ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: netdev-bot+sinfo @ 2026-10-23 10:06 UTC (permalink / raw)
  To: vmukunda
  Cc: netdev, linux-kernel, Sunil Goutham, Ratheesh Kannoth,
	Geetha sowjanya, Subbaraya Sundeep, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by code inspection). If it was triggered please include
   the symptoms, like the stack trace or error messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.

The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

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

* Re: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
  2026-10-23 10:01 [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k vmukunda
  2026-10-23 10:06 ` netdev-bot+sinfo
@ 2026-10-24  0:03 ` kernel test robot
  2026-10-24  0:58 ` kernel test robot
  2026-10-24 10:11 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-10-24  0:03 UTC (permalink / raw)
  To: vmukunda, netdev, linux-kernel
  Cc: llvm, oe-kbuild-all, Sunil Goutham, Ratheesh Kannoth,
	Geetha sowjanya, Subbaraya Sundeep, Andrew Lunn,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	vmukunda

Hi vmukunda,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/vmukunda/octeontx2-af-Fix-npc_delete_flow-counter-read-for-cn20k/20261023-100112
base:   net/main
patch link:    https://lore.kernel.org/r/20261023100112.3402726-1-vmukunda%40marvell.com
patch subject: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20261024/202610240701.QMuYCXhI-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 186e70f4e6a1521991d2340d3d49b23b1beff11f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261024/202610240701.QMuYCXhI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610240701.QMuYCXhI-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:30: error: use of undeclared identifier 'rvu_pdev'
    1962 |                                 if (blkaddr && !is_cn20k(rvu_pdev))
         |                                                          ^~~~~~~~
   1 error generated.


vim +/rvu_pdev +1962 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c

  1932	
  1933	int rvu_mbox_handler_npc_delete_flow(struct rvu *rvu,
  1934					     struct npc_delete_flow_req *req,
  1935					     struct npc_delete_flow_rsp *rsp)
  1936	{
  1937		struct npc_mcam *mcam = &rvu->hw->mcam;
  1938		struct rvu_npc_mcam_rule *iter, *tmp;
  1939		u16 pcifunc = req->hdr.pcifunc;
  1940		struct list_head del_list;
  1941		int blkaddr;
  1942	
  1943		req->entry = npc_cn20k_vidx2idx(req->entry);
  1944		req->start = npc_cn20k_vidx2idx(req->start);
  1945		req->end = npc_cn20k_vidx2idx(req->end);
  1946	
  1947		INIT_LIST_HEAD(&del_list);
  1948	
  1949		mutex_lock(&mcam->lock);
  1950		list_for_each_entry_safe(iter, tmp, &mcam->mcam_rules, list) {
  1951			if (iter->owner == pcifunc) {
  1952				/* All rules */
  1953				if (req->all) {
  1954					list_move_tail(&iter->list, &del_list);
  1955				/* Range of rules */
  1956				} else if (req->end && iter->entry >= req->start &&
  1957					   iter->entry <= req->end) {
  1958					list_move_tail(&iter->list, &del_list);
  1959				/* single rule */
  1960				} else if (req->entry == iter->entry) {
  1961					blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
> 1962					if (blkaddr && !is_cn20k(rvu_pdev))
  1963						rsp->cntr_val = rvu_read64(rvu, blkaddr,
  1964									   NPC_AF_MATCH_STATX(iter->cntr));
  1965					list_move_tail(&iter->list, &del_list);
  1966					break;
  1967				}
  1968			}
  1969		}
  1970		mutex_unlock(&mcam->lock);
  1971	
  1972		list_for_each_entry_safe(iter, tmp, &del_list, list) {
  1973			u16 entry = iter->entry;
  1974	
  1975			/* clear the mcam entry target pcifunc */
  1976			mcam->entry2target_pffunc[entry] = 0x0;
  1977			if (npc_delete_flow(rvu, iter, pcifunc))
  1978				dev_err(rvu->dev, "rule deletion failed for entry:%u",
  1979					entry);
  1980		}
  1981	
  1982		return 0;
  1983	}
  1984	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
  2026-10-23 10:01 [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k vmukunda
  2026-10-23 10:06 ` netdev-bot+sinfo
  2026-10-24  0:03 ` kernel test robot
@ 2026-10-24  0:58 ` kernel test robot
  2026-10-24 10:11 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-10-24  0:58 UTC (permalink / raw)
  To: vmukunda, netdev, linux-kernel
  Cc: oe-kbuild-all, Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, vmukunda

Hi vmukunda,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/vmukunda/octeontx2-af-Fix-npc_delete_flow-counter-read-for-cn20k/20261023-100112
base:   net/main
patch link:    https://lore.kernel.org/r/20261023100112.3402726-1-vmukunda%40marvell.com
patch subject: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20261024/202610240855.NijJJoJD-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261024/202610240855.NijJJoJD-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610240855.NijJJoJD-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/marvell/octeontx2/af/rvu.h:13,
                    from drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:11:
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c: In function 'rvu_mbox_handler_npc_delete_flow':
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:58: error: 'rvu_pdev' undeclared (first use in this function)
    1962 |                                 if (blkaddr && !is_cn20k(rvu_pdev))
         |                                                          ^~~~~~~~
   include/linux/soc/marvell/silicons.h:22:41: note: in definition of macro 'is_cn20k'
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                         ^~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:58: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/soc/marvell/silicons.h:22:41: note: in definition of macro 'is_cn20k'
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                         ^~~~
>> include/linux/soc/marvell/silicons.h:22:46: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                              ^
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:49: note: in expansion of macro 'is_cn20k'
    1962 |                                 if (blkaddr && !is_cn20k(rvu_pdev))
         |                                                 ^~~~~~~~


vim +22 include/linux/soc/marvell/silicons.h

25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  12  
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  13  #define CN20K_CHIPID	0x20
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  14  /*
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  15   * Silicon check for CN20K family
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  16   */
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  17  static inline bool is_cn20k(struct pci_dev *pdev)
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  18  {
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  19  	return (pdev->subsystem_device & 0xFF) == CN20K_CHIPID;
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  20  }
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  21  #else
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11 @22  #define is_cn20k(pdev)		((void)(pdev), 0)
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  23  #endif
25d51ebf0f54f9 Subbaraya Sundeep 2025-06-11  24  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
  2026-10-23 10:01 [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k vmukunda
                   ` (2 preceding siblings ...)
  2026-10-24  0:58 ` kernel test robot
@ 2026-10-24 10:11 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-10-24 10:11 UTC (permalink / raw)
  To: vmukunda, netdev, linux-kernel
  Cc: oe-kbuild-all, Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, vmukunda

Hi vmukunda,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/vmukunda/octeontx2-af-Fix-npc_delete_flow-counter-read-for-cn20k/20261023-100112
base:   net/main
patch link:    https://lore.kernel.org/r/20261023100112.3402726-1-vmukunda%40marvell.com
patch subject: [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20261024/202610241814.S7V8CsQq-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261024/202610241814.S7V8CsQq-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610241814.S7V8CsQq-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/net/ethernet/marvell/octeontx2/af/rvu.h:13,
                    from drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:11:
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c: In function 'rvu_mbox_handler_npc_delete_flow':
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:58: error: 'rvu_pdev' undeclared (first use in this function)
    1962 |                                 if (blkaddr && !is_cn20k(rvu_pdev))
         |                                                          ^~~~~~~~
   include/linux/soc/marvell/silicons.h:22:41: note: in definition of macro 'is_cn20k'
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                         ^~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:58: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/soc/marvell/silicons.h:22:41: note: in definition of macro 'is_cn20k'
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                         ^~~~
   include/linux/soc/marvell/silicons.h:22:46: warning: left-hand operand of comma expression has no effect [-Wunused-value]
      22 | #define is_cn20k(pdev)          ((void)(pdev), 0)
         |                                              ^
   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c:1962:49: note: in expansion of macro 'is_cn20k'
    1962 |                                 if (blkaddr && !is_cn20k(rvu_pdev))
         |                                                 ^~~~~~~~


vim +/rvu_pdev +1962 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c

  1932	
  1933	int rvu_mbox_handler_npc_delete_flow(struct rvu *rvu,
  1934					     struct npc_delete_flow_req *req,
  1935					     struct npc_delete_flow_rsp *rsp)
  1936	{
  1937		struct npc_mcam *mcam = &rvu->hw->mcam;
  1938		struct rvu_npc_mcam_rule *iter, *tmp;
  1939		u16 pcifunc = req->hdr.pcifunc;
  1940		struct list_head del_list;
  1941		int blkaddr;
  1942	
  1943		req->entry = npc_cn20k_vidx2idx(req->entry);
  1944		req->start = npc_cn20k_vidx2idx(req->start);
  1945		req->end = npc_cn20k_vidx2idx(req->end);
  1946	
  1947		INIT_LIST_HEAD(&del_list);
  1948	
  1949		mutex_lock(&mcam->lock);
  1950		list_for_each_entry_safe(iter, tmp, &mcam->mcam_rules, list) {
  1951			if (iter->owner == pcifunc) {
  1952				/* All rules */
  1953				if (req->all) {
  1954					list_move_tail(&iter->list, &del_list);
  1955				/* Range of rules */
  1956				} else if (req->end && iter->entry >= req->start &&
  1957					   iter->entry <= req->end) {
  1958					list_move_tail(&iter->list, &del_list);
  1959				/* single rule */
  1960				} else if (req->entry == iter->entry) {
  1961					blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
> 1962					if (blkaddr && !is_cn20k(rvu_pdev))
  1963						rsp->cntr_val = rvu_read64(rvu, blkaddr,
  1964									   NPC_AF_MATCH_STATX(iter->cntr));
  1965					list_move_tail(&iter->list, &del_list);
  1966					break;
  1967				}
  1968			}
  1969		}
  1970		mutex_unlock(&mcam->lock);
  1971	
  1972		list_for_each_entry_safe(iter, tmp, &del_list, list) {
  1973			u16 entry = iter->entry;
  1974	
  1975			/* clear the mcam entry target pcifunc */
  1976			mcam->entry2target_pffunc[entry] = 0x0;
  1977			if (npc_delete_flow(rvu, iter, pcifunc))
  1978				dev_err(rvu->dev, "rule deletion failed for entry:%u",
  1979					entry);
  1980		}
  1981	
  1982		return 0;
  1983	}
  1984	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2026-10-24 10:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 10:01 [PATCH net] octeontx2-af: Fix npc_delete_flow counter read for cn20k vmukunda
2026-10-23 10:06 ` netdev-bot+sinfo
2026-10-24  0:03 ` kernel test robot
2026-10-24  0:58 ` kernel test robot
2026-10-24 10:11 ` kernel test robot

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

all inboxes | Powered by JetHome®