net/qede/base: enable control frame filtering
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 29 Sep 2018 08:14:34 +0000 (08:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:48 +0000 (18:53 +0200)
Enable control frame filtering for non-trusted VFs.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore_l2.c
drivers/net/qede/base/ecore_l2_api.h
drivers/net/qede/base/ecore_sriov.c

index d87ffda..c17082e 100644 (file)
@@ -786,6 +786,11 @@ ecore_sp_vport_update(struct ecore_hwfn *p_hwfn,
                return rc;
        }
 
+       if (p_params->update_ctl_frame_check) {
+               p_cmn->ctl_frame_mac_check_en = p_params->mac_chk_en;
+               p_cmn->ctl_frame_ethtype_check_en = p_params->ethtype_chk_en;
+       }
+
        /* Update mcast bins for VFs, PF doesn't use this functionality */
        ecore_sp_update_mcast_bin(p_ramrod, p_params);
 
index 21595f3..004fb61 100644 (file)
@@ -347,7 +347,10 @@ struct ecore_sp_vport_update_params {
        /* MTU change - notice this requires the vport to be disabled.
         * If non-zero, value would be used.
         */
-       u16 mtu;
+       u16                     mtu;
+       u8                      update_ctl_frame_check;
+       u8                      mac_chk_en;
+       u8                      ethtype_chk_en;
 };
 
 /**
index 9da4e41..3ac1085 100644 (file)
@@ -2158,7 +2158,9 @@ static void ecore_iov_vf_mbx_start_vport(struct ecore_hwfn *p_hwfn,
        params.vport_id = vf->vport_id;
        params.max_buffers_per_cqe = start->max_buffers_per_cqe;
        params.mtu = vf->mtu;
-       params.check_mac = true;
+
+       /* Non trusted VFs should enable control frame filtering */
+       params.check_mac = !vf->p_vf_info.is_trusted_configured;
 
        rc = ecore_sp_eth_vport_start(p_hwfn, &params);
        if (rc != ECORE_SUCCESS) {