|
@@ -8690,6 +8690,28 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)
|
|
|
return need_reset;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * i40e_clear_rss_lut - clear the rx hash lookup table
|
|
|
+ * @vsi: the VSI being configured
|
|
|
+ **/
|
|
|
+static void i40e_clear_rss_lut(struct i40e_vsi *vsi)
|
|
|
+{
|
|
|
+ struct i40e_pf *pf = vsi->back;
|
|
|
+ struct i40e_hw *hw = &pf->hw;
|
|
|
+ u16 vf_id = vsi->vf_id;
|
|
|
+ u8 i;
|
|
|
+
|
|
|
+ if (vsi->type == I40E_VSI_MAIN) {
|
|
|
+ for (i = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++)
|
|
|
+ wr32(hw, I40E_PFQF_HLUT(i), 0);
|
|
|
+ } else if (vsi->type == I40E_VSI_SRIOV) {
|
|
|
+ for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++)
|
|
|
+ i40e_write_rx_ctl(hw, I40E_VFQF_HLUT1(i, vf_id), 0);
|
|
|
+ } else {
|
|
|
+ dev_err(&pf->pdev->dev, "Cannot set RSS LUT - invalid VSI type\n");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* i40e_set_features - set the netdev feature flags
|
|
|
* @netdev: ptr to the netdev being adjusted
|
|
@@ -8703,6 +8725,12 @@ static int i40e_set_features(struct net_device *netdev,
|
|
|
struct i40e_pf *pf = vsi->back;
|
|
|
bool need_reset;
|
|
|
|
|
|
+ if (features & NETIF_F_RXHASH && !(netdev->features & NETIF_F_RXHASH))
|
|
|
+ i40e_pf_config_rss(pf);
|
|
|
+ else if (!(features & NETIF_F_RXHASH) &&
|
|
|
+ netdev->features & NETIF_F_RXHASH)
|
|
|
+ i40e_clear_rss_lut(vsi);
|
|
|
+
|
|
|
if (features & NETIF_F_HW_VLAN_CTAG_RX)
|
|
|
i40e_vlan_stripping_enable(vsi);
|
|
|
else
|