Skip to content

Commit dcb479f

Browse files
Subbaraya SundeepPaolo Abeni
authored andcommitted
octeontx2-pf: Do not reallocate all ntuple filters
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: 39c4691 ("octeontx2-pf: Add ucast filter count configurability via devlink.") Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/1747054357-5850-1-git-send-email-sbhatta@marvell.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 09db7a4 commit dcb479f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ struct otx2_flow_config {
356356
struct list_head flow_list_tc;
357357
u8 ucast_flt_cnt;
358358
bool ntuple;
359+
u16 ntuple_cnt;
359360
};
360361

361362
struct dev_hw_ops {

drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id,
4141
if (!pfvf->flow_cfg)
4242
return 0;
4343

44+
pfvf->flow_cfg->ntuple_cnt = ctx->val.vu16;
4445
otx2_alloc_mcam_entries(pfvf, ctx->val.vu16);
4546

4647
return 0;

drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)
247247
mutex_unlock(&pfvf->mbox.lock);
248248

249249
/* Allocate entries for Ntuple filters */
250-
count = otx2_alloc_mcam_entries(pfvf, OTX2_DEFAULT_FLOWCOUNT);
250+
count = otx2_alloc_mcam_entries(pfvf, flow_cfg->ntuple_cnt);
251251
if (count <= 0) {
252252
otx2_clear_ntuple_flow_info(pfvf, flow_cfg);
253253
return 0;
@@ -307,6 +307,7 @@ int otx2_mcam_flow_init(struct otx2_nic *pf)
307307
INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc);
308308

309309
pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS;
310+
pf->flow_cfg->ntuple_cnt = OTX2_DEFAULT_FLOWCOUNT;
310311

311312
/* Allocate bare minimum number of MCAM entries needed for
312313
* unicast and ntuple filters.

0 commit comments

Comments
 (0)