diff options
author | Michal Swiatkowski <michal.swiatkowski@linux.intel.com> | 2021-08-20 03:08:51 +0300 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2021-10-07 20:41:42 +0300 |
commit | ac19e03ef7809a4e42062da476bd16320262a1de (patch) | |
tree | 130afaf1d9d628af6e16260c633e86fa0a24c12b /drivers/net/ethernet/intel/ice/ice_repr.c | |
parent | 37165e3f5664ee901e89ff9c13723c2743c5e47f (diff) | |
download | linux-ac19e03ef7809a4e42062da476bd16320262a1de.tar.xz |
ice: allow process VF opcodes in different ways
In switchdev driver shouldn't add MAC, VLAN and promisc
filters on iavf demand but should return success to not
break normal iavf flow.
Achieve that by creating table of functions pointer with
default functions used to parse iavf command. While parse
iavf command, call correct function from table instead of
calling function direct.
When port representors are being created change functions
in table to new one that behaves correctly for switchdev
puprose (ignoring new filters).
Change back to default ops when representors are being
removed.
Co-developed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_repr.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_repr.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c index 479da3d020a7..d7fa1ff487a5 100644 --- a/drivers/net/ethernet/intel/ice/ice_repr.c +++ b/drivers/net/ethernet/intel/ice/ice_repr.c @@ -228,15 +228,24 @@ int ice_repr_add_for_all_vfs(struct ice_pf *pf) int i; ice_for_each_vf(pf, i) { - err = ice_repr_add(&pf->vf[i]); + struct ice_vf *vf = &pf->vf[i]; + + err = ice_repr_add(vf); if (err) goto err; + + ice_vc_change_ops_to_repr(&vf->vc_ops); } + return 0; err: - for (i = i - 1; i >= 0; i--) - ice_repr_rem(&pf->vf[i]); + for (i = i - 1; i >= 0; i--) { + struct ice_vf *vf = &pf->vf[i]; + + ice_repr_rem(vf); + ice_vc_set_dflt_vf_ops(&vf->vc_ops); + } return err; } @@ -249,6 +258,10 @@ void ice_repr_rem_from_all_vfs(struct ice_pf *pf) { int i; - ice_for_each_vf(pf, i) - ice_repr_rem(&pf->vf[i]); + ice_for_each_vf(pf, i) { + struct ice_vf *vf = &pf->vf[i]; + + ice_repr_rem(vf); + ice_vc_set_dflt_vf_ops(&vf->vc_ops); + } } |