]> Git Repo - J-linux.git/blobdiff - drivers/net/ethernet/intel/ice/ice_main.c
Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf...
[J-linux.git] / drivers / net / ethernet / intel / ice / ice_main.c
index 9b0c04d595ced6ed9051be9a65e5eaeb7696e634..b97d116650beb00731ec1ac4677ef25cd177eb10 100644 (file)
@@ -3426,6 +3426,7 @@ static void ice_set_ops(struct ice_vsi *vsi)
 
        netdev->netdev_ops = &ice_netdev_ops;
        netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
+       netdev->xdp_metadata_ops = &ice_xdp_md_ops;
        ice_set_ethtool_ops(netdev);
 
        if (vsi->type != ICE_VSI_PF)
@@ -6093,6 +6094,23 @@ ice_fix_features(struct net_device *netdev, netdev_features_t features)
        return features;
 }
 
+/**
+ * ice_set_rx_rings_vlan_proto - update rings with new stripped VLAN proto
+ * @vsi: PF's VSI
+ * @vlan_ethertype: VLAN ethertype (802.1Q or 802.1ad) in network byte order
+ *
+ * Store current stripped VLAN proto in ring packet context,
+ * so it can be accessed more efficiently by packet processing code.
+ */
+static void
+ice_set_rx_rings_vlan_proto(struct ice_vsi *vsi, __be16 vlan_ethertype)
+{
+       u16 i;
+
+       ice_for_each_alloc_rxq(vsi, i)
+               vsi->rx_rings[i]->pkt_ctx.vlan_proto = vlan_ethertype;
+}
+
 /**
  * ice_set_vlan_offload_features - set VLAN offload features for the PF VSI
  * @vsi: PF's VSI
@@ -6135,6 +6153,9 @@ ice_set_vlan_offload_features(struct ice_vsi *vsi, netdev_features_t features)
        if (strip_err || insert_err)
                return -EIO;
 
+       ice_set_rx_rings_vlan_proto(vsi, enable_stripping ?
+                                   htons(vlan_ethertype) : 0);
+
        return 0;
 }
 
This page took 0.132118 seconds and 4 git commands to generate.