Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / intel / i40e / i40e_virtchnl_pf.c
index 033ea71..4f184c5 100644 (file)
@@ -2147,6 +2147,10 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
                /* VFs only use TC 0 */
                vfres->vsi_res[0].qset_handle
                                          = le16_to_cpu(vsi->info.qs_handle[0]);
+               if (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) {
+                       i40e_del_mac_filter(vsi, vf->default_lan_addr.addr);
+                       eth_zero_addr(vf->default_lan_addr.addr);
+               }
                ether_addr_copy(vfres->vsi_res[0].default_mac_addr,
                                vf->default_lan_addr.addr);
        }
@@ -4349,6 +4353,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,
                /* duplicate request, so just return success */
                goto error_pvid;
 
+       i40e_vlan_stripping_enable(vsi);
        i40e_vc_reset_vf(vf, true);
        /* During reset the VF got a new VSI, so refresh a pointer. */
        vsi = pf->vsi[vf->lan_vsi_idx];
@@ -4364,7 +4369,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,
         * MAC addresses deleted.
         */
        if ((!(vlan_id || qos) ||
-           vlanprio != le16_to_cpu(vsi->info.pvid)) &&
+            vlanprio != le16_to_cpu(vsi->info.pvid)) &&
            vsi->info.pvid) {
                ret = i40e_add_vlan_all_mac(vsi, I40E_VLAN_ANY);
                if (ret) {
@@ -4727,6 +4732,11 @@ int i40e_ndo_set_vf_trust(struct net_device *netdev, int vf_id, bool setting)
                goto out;
 
        vf->trusted = setting;
+
+       /* request PF to sync mac/vlan filters for the VF */
+       set_bit(__I40E_MACVLAN_SYNC_PENDING, pf->state);
+       pf->vsi[vf->lan_vsi_idx]->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
+
        i40e_vc_reset_vf(vf, true);
        dev_info(&pf->pdev->dev, "VF %u is now %strusted\n",
                 vf_id, setting ? "" : "un");