From: Jakub Kicinski <kuba@kernel.org>
To: rkannoth@marvell.com
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next,v3,11/13] octeontx2-pf: cn20k: Add TC rules support
Date: Sat, 10 Jan 2026 14:59:36 -0800 [thread overview]
Message-ID: <20260110225936.3900883-1-kuba@kernel.org> (raw)
In-Reply-To: <20260109054828.1822307-12-rkannoth@marvell.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least pausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
octeontx2-pf: cn20k: Add TC rules support
This patch implements dynamic MCAM entry allocation for CN20K TC rules.
The PF driver requests entries from AF driver on the fly and shifts
entries based on rule priority, rejecting rules when X2/X4 mixing
prevents proper shifting.
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
> index a60f8cf53feb..cd2c9a95ee22 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn20k.c
[ ... ]
> +void cn20k_tc_update_mcam_table_del_req(struct otx2_nic *nic,
> + struct otx2_flow_config *flow_cfg,
> + struct otx2_tc_flow *node)
> +{
> + struct otx2_tc_flow *first, *tmp, *n;
> + int i = 0, index;
> + u16 cntr_val = 0;
> + u16 entry;
> +
> + index = cn20k_tc_get_entry_index(flow_cfg, node);
> + first = list_first_entry(&flow_cfg->flow_list_tc, struct otx2_tc_flow,
> + list);
> + entry = first->entry;
> +
> + /* If entries cannot be shifted then delete given entry
> + * and free it to AF too.
> + */
> + if (!cn20k_tc_check_entry_shiftable(nic, flow_cfg, node,
> + index, false)) {
> + list_del(&node->list);
> + entry = node->entry;
> + goto free_mcam_entry;
> + }
[ ... ]
> +free_mcam_entry:
> + if (cn20k_tc_free_mcam_entry(nic, entry))
> + netdev_err(nic->netdev, "Freeing entry %d to AF failed\n",
> + first->entry);
^^^^^^^^^^^^
Should this error message print 'entry' instead of 'first->entry'? When
the code takes the "not shiftable" path, it sets entry = node->entry and
jumps to free_mcam_entry. At that point, first->entry may be different
from the entry value that was actually passed to cn20k_tc_free_mcam_entry().
> +}
next prev parent reply other threads:[~2026-01-10 22:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 5:48 [PATCH net-next v3 00/13] NPC HW block support for cn20k Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 01/13] octeontx2-af: npc: cn20k: Index management Ratheesh Kannoth
2026-01-10 22:51 ` Jakub Kicinski
2026-01-13 10:08 ` Ratheesh Kannoth
2026-01-10 22:58 ` Jakub Kicinski
2026-01-13 10:29 ` Ratheesh Kannoth
2026-01-13 15:07 ` Jakub Kicinski
2026-01-14 5:52 ` Ratheesh Kannoth
2026-01-15 3:14 ` Jakub Kicinski
2026-01-10 22:59 ` [net-next,v3,01/13] " Jakub Kicinski
2026-01-13 10:08 ` Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 02/13] octeontx2-af: npc: cn20k: KPM profile changes Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 03/13] octeontx2-af: npc: cn20k: Add default profile Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 04/13] ocetontx2-af: npc: cn20k: MKEX profile support Ratheesh Kannoth
2026-01-10 22:59 ` [net-next,v3,04/13] " Jakub Kicinski
2026-01-13 10:02 ` Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes Ratheesh Kannoth
2026-01-10 22:52 ` Jakub Kicinski
2026-01-13 9:58 ` Ratheesh Kannoth
2026-01-10 22:59 ` [net-next,v3,05/13] " Jakub Kicinski
2026-01-13 9:56 ` Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 06/13] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 08/13] octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 09/13] octeontx2-af: npc: cn20k: virtual index support Ratheesh Kannoth
2026-01-10 22:52 ` Jakub Kicinski
2026-01-13 10:09 ` Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 10/13] octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 11/13] octeontx2-pf: cn20k: Add TC rules support Ratheesh Kannoth
2026-01-10 22:59 ` Jakub Kicinski [this message]
2026-01-13 9:54 ` [net-next,v3,11/13] " Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 12/13] octeontx2-af: npc: cn20k: add debugfs support Ratheesh Kannoth
2026-01-09 5:48 ` [PATCH net-next v3 13/13] octeontx2-af: npc: Use common structures Ratheesh Kannoth
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=20260110225936.3900883-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rkannoth@marvell.com \
/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