Skip to content

Commit 4181b39

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-04-04 (ice) This series contains updates to ice driver only. Simei adjusts error path on adding VF Flow Director filters that were not releasing all resources. Lingyu adds setting/resetting of VF Flow Director filters counters during initialization. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Reset FDIR counter in FDIR init stage ice: fix wrong fallback logic for FDIR ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 3ce9345 + 83c911d commit 4181b39

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,21 @@ static void ice_vc_fdir_rem_prof_all(struct ice_vf *vf)
541541
}
542542
}
543543

544+
/**
545+
* ice_vc_fdir_reset_cnt_all - reset all FDIR counters for this VF FDIR
546+
* @fdir: pointer to the VF FDIR structure
547+
*/
548+
static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir)
549+
{
550+
enum ice_fltr_ptype flow;
551+
552+
for (flow = ICE_FLTR_PTYPE_NONF_NONE;
553+
flow < ICE_FLTR_PTYPE_MAX; flow++) {
554+
fdir->fdir_fltr_cnt[flow][0] = 0;
555+
fdir->fdir_fltr_cnt[flow][1] = 0;
556+
}
557+
}
558+
544559
/**
545560
* ice_vc_fdir_has_prof_conflict
546561
* @vf: pointer to the VF structure
@@ -1871,7 +1886,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
18711886
v_ret = VIRTCHNL_STATUS_SUCCESS;
18721887
stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE;
18731888
dev_dbg(dev, "VF %d: set FDIR context failed\n", vf->vf_id);
1874-
goto err_free_conf;
1889+
goto err_rem_entry;
18751890
}
18761891

18771892
ret = ice_vc_fdir_write_fltr(vf, conf, true, is_tun);
@@ -1880,15 +1895,16 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
18801895
stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE;
18811896
dev_err(dev, "VF %d: writing FDIR rule failed, ret:%d\n",
18821897
vf->vf_id, ret);
1883-
goto err_rem_entry;
1898+
goto err_clr_irq;
18841899
}
18851900

18861901
exit:
18871902
kfree(stat);
18881903
return ret;
18891904

1890-
err_rem_entry:
1905+
err_clr_irq:
18911906
ice_vc_fdir_clear_irq_ctx(vf);
1907+
err_rem_entry:
18921908
ice_vc_fdir_remove_entry(vf, conf, conf->flow_id);
18931909
err_free_conf:
18941910
devm_kfree(dev, conf);
@@ -1997,6 +2013,7 @@ void ice_vf_fdir_init(struct ice_vf *vf)
19972013
spin_lock_init(&fdir->ctx_lock);
19982014
fdir->ctx_irq.flags = 0;
19992015
fdir->ctx_done.flags = 0;
2016+
ice_vc_fdir_reset_cnt_all(fdir);
20002017
}
20012018

20022019
/**

0 commit comments

Comments
 (0)