* [net v2] octeontx2-pf: Do not reallocate all ntuple filters
@ 2025-05-12 12:52 Subbaraya Sundeep
2025-05-13 13:25 ` Simon Horman
2025-05-15 10:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-05-12 12:52 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni, horms, gakula,
hkelam, sgoutham, lcherian, bbhushan2, jerinj
Cc: netdev, Subbaraya Sundeep
If ntuple filters count is modified followed by
unicast filters count using devlink then the ntuple count
set by user is ignored and all the ntuple filters are
being reallocated. Fix this by storing the ntuple count
set by user. Without this patch, say if user tries
to modify ntuple count as 8 followed by ucast filter count as 4
using devlink commands then ntuple count is being reverted to
default value 16 i.e, not retaining user set value 8.
Fixes: 39c469188b6d ("octeontx2-pf: Add ucast filter count configurability via devlink.")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 1 +
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c | 1 +
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
index 1e88422..d6b4b74 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
@@ -356,6 +356,7 @@ struct otx2_flow_config {
struct list_head flow_list_tc;
u8 ucast_flt_cnt;
bool ntuple;
+ u16 ntuple_cnt;
};
struct dev_hw_ops {
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
index 33ec9a7..e13ae548 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
@@ -41,6 +41,7 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id,
if (!pfvf->flow_cfg)
return 0;
+ pfvf->flow_cfg->ntuple_cnt = ctx->val.vu16;
otx2_alloc_mcam_entries(pfvf, ctx->val.vu16);
return 0;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
index 47bfd1f..64c6d916 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
@@ -247,7 +247,7 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)
mutex_unlock(&pfvf->mbox.lock);
/* Allocate entries for Ntuple filters */
- count = otx2_alloc_mcam_entries(pfvf, OTX2_DEFAULT_FLOWCOUNT);
+ count = otx2_alloc_mcam_entries(pfvf, flow_cfg->ntuple_cnt);
if (count <= 0) {
otx2_clear_ntuple_flow_info(pfvf, flow_cfg);
return 0;
@@ -307,6 +307,7 @@ int otx2_mcam_flow_init(struct otx2_nic *pf)
INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc);
pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS;
+ pf->flow_cfg->ntuple_cnt = OTX2_DEFAULT_FLOWCOUNT;
/* Allocate bare minimum number of MCAM entries needed for
* unicast and ntuple filters.
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net v2] octeontx2-pf: Do not reallocate all ntuple filters
2025-05-12 12:52 [net v2] octeontx2-pf: Do not reallocate all ntuple filters Subbaraya Sundeep
@ 2025-05-13 13:25 ` Simon Horman
2025-05-15 10:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-05-13 13:25 UTC (permalink / raw)
To: Subbaraya Sundeep
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, gakula, hkelam,
sgoutham, lcherian, bbhushan2, jerinj, netdev
On Mon, May 12, 2025 at 06:22:37PM +0530, Subbaraya Sundeep wrote:
> If ntuple filters count is modified followed by
> unicast filters count using devlink then the ntuple count
> set by user is ignored and all the ntuple filters are
> being reallocated. Fix this by storing the ntuple count
> set by user. Without this patch, say if user tries
> to modify ntuple count as 8 followed by ucast filter count as 4
> using devlink commands then ntuple count is being reverted to
> default value 16 i.e, not retaining user set value 8.
>
> Fixes: 39c469188b6d ("octeontx2-pf: Add ucast filter count configurability via devlink.")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
I don't think there is any need to repost because of this, but for future
reference it is normal to include the PATCH keyword along with the net
keyword in the Subject.
e.g. Subject: [PATCH net v2] ...
Likewise for net-next.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net v2] octeontx2-pf: Do not reallocate all ntuple filters
2025-05-12 12:52 [net v2] octeontx2-pf: Do not reallocate all ntuple filters Subbaraya Sundeep
2025-05-13 13:25 ` Simon Horman
@ 2025-05-15 10:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-15 10:50 UTC (permalink / raw)
To: Subbaraya Sundeep
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, horms, gakula,
hkelam, sgoutham, lcherian, bbhushan2, jerinj, netdev
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 12 May 2025 18:22:37 +0530 you wrote:
> If ntuple filters count is modified followed by
> unicast filters count using devlink then the ntuple count
> set by user is ignored and all the ntuple filters are
> being reallocated. Fix this by storing the ntuple count
> set by user. Without this patch, say if user tries
> to modify ntuple count as 8 followed by ucast filter count as 4
> using devlink commands then ntuple count is being reverted to
> default value 16 i.e, not retaining user set value 8.
>
> [...]
Here is the summary with links:
- [net,v2] octeontx2-pf: Do not reallocate all ntuple filters
https://git.kernel.org/netdev/net/c/dcb479fde00b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-15 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 12:52 [net v2] octeontx2-pf: Do not reallocate all ntuple filters Subbaraya Sundeep
2025-05-13 13:25 ` Simon Horman
2025-05-15 10:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).