Skip to content

Commit f41b2d6

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-pf: Do not modify number of rules
In the ETHTOOL_GRXCLSRLALL ioctl ethtool uses below structure to read number of rules from the driver. struct ethtool_rxnfc { __u32 cmd; __u32 flow_type; __u64 data; struct ethtool_rx_flow_spec fs; union { __u32 rule_cnt; __u32 rss_context; }; __u32 rule_locs[0]; }; Driver must not modify rule_cnt member. But currently driver modifies it by modifying rss_context. Hence fix it by using a local variable. Fixes: 81a4362 ("octeontx2-pf: Add RSS multi group support") Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 804741a commit f41b2d6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,19 @@ int otx2_get_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
257257
int otx2_get_all_flows(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
258258
u32 *rule_locs)
259259
{
260+
u32 rule_cnt = nfc->rule_cnt;
260261
u32 location = 0;
261262
int idx = 0;
262263
int err = 0;
263264

264265
nfc->data = pfvf->flow_cfg->ntuple_max_flows;
265-
while ((!err || err == -ENOENT) && idx < nfc->rule_cnt) {
266+
while ((!err || err == -ENOENT) && idx < rule_cnt) {
266267
err = otx2_get_flow(pfvf, nfc, location);
267268
if (!err)
268269
rule_locs[idx++] = location;
269270
location++;
270271
}
272+
nfc->rule_cnt = rule_cnt;
271273

272274
return err;
273275
}

0 commit comments

Comments
 (0)