diff options
author | Akeem G Abodunrin <akeem.g.abodunrin@intel.com> | 2019-02-08 15:51:00 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-03-22 11:19:16 -0400 |
commit | cb93a9529de8428f4b0bc76f6e6dced382712bcd (patch) | |
tree | a22227d2b370f2fa54723b3bb7b20fd1a76d7060 /drivers/net/ethernet/intel/ice/ice_lib.c | |
parent | 3b0f31f2b8c9fb348e4530b88f6b64f9621f83d6 (diff) |
ice: Enable MAC anti-spoof by default
This patch enables MAC anti-spoof by default, with creation of VF VSIs or
when the VF VSIs are being re-initialized.
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_lib.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index d3061f243877..e3b44d413d5f 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c | |||
@@ -940,6 +940,7 @@ static int ice_vsi_init(struct ice_vsi *vsi) | |||
940 | if (!ctxt) | 940 | if (!ctxt) |
941 | return -ENOMEM; | 941 | return -ENOMEM; |
942 | 942 | ||
943 | ctxt->info = vsi->info; | ||
943 | switch (vsi->type) { | 944 | switch (vsi->type) { |
944 | case ICE_VSI_PF: | 945 | case ICE_VSI_PF: |
945 | ctxt->flags = ICE_AQ_VSI_TYPE_PF; | 946 | ctxt->flags = ICE_AQ_VSI_TYPE_PF; |
@@ -965,6 +966,14 @@ static int ice_vsi_init(struct ice_vsi *vsi) | |||
965 | ctxt->info.sw_id = vsi->port_info->sw_id; | 966 | ctxt->info.sw_id = vsi->port_info->sw_id; |
966 | ice_vsi_setup_q_map(vsi, ctxt); | 967 | ice_vsi_setup_q_map(vsi, ctxt); |
967 | 968 | ||
969 | /* Enable MAC Antispoof with new VSI being initialized or updated */ | ||
970 | if (vsi->type == ICE_VSI_VF && pf->vf[vsi->vf_id].spoofchk) { | ||
971 | ctxt->info.valid_sections |= | ||
972 | cpu_to_le16(ICE_AQ_VSI_PROP_SECURITY_VALID); | ||
973 | ctxt->info.sec_flags |= | ||
974 | ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF; | ||
975 | } | ||
976 | |||
968 | ret = ice_add_vsi(hw, vsi->idx, ctxt, NULL); | 977 | ret = ice_add_vsi(hw, vsi->idx, ctxt, NULL); |
969 | if (ret) { | 978 | if (ret) { |
970 | dev_err(&pf->pdev->dev, | 979 | dev_err(&pf->pdev->dev, |