|
@@ -230,10 +230,10 @@ static const char i40e_gstrings_test[][ETH_GSTRING_LEN] = {
|
|
|
|
|
|
static const char i40e_priv_flags_strings[][ETH_GSTRING_LEN] = {
|
|
|
"NPAR",
|
|
|
+ "LinkPolling",
|
|
|
};
|
|
|
|
|
|
-#define I40E_PRIV_FLAGS_STR_LEN \
|
|
|
- (sizeof(i40e_priv_flags_strings) / ETH_GSTRING_LEN)
|
|
|
+#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_priv_flags_strings)
|
|
|
|
|
|
/**
|
|
|
* i40e_partition_setting_complaint - generic complaint for MFP restriction
|
|
@@ -2636,10 +2636,31 @@ static u32 i40e_get_priv_flags(struct net_device *dev)
|
|
|
|
|
|
ret_flags |= pf->hw.func_caps.npar_enable ?
|
|
|
I40E_PRIV_FLAGS_NPAR_FLAG : 0;
|
|
|
+ ret_flags |= pf->flags & I40E_FLAG_LINK_POLLING_ENABLED ?
|
|
|
+ I40E_PRIV_FLAGS_LINKPOLL_FLAG : 0;
|
|
|
|
|
|
return ret_flags;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * i40e_set_priv_flags - set private flags
|
|
|
+ * @dev: network interface device structure
|
|
|
+ * @flags: bit flags to be set
|
|
|
+ **/
|
|
|
+static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
|
|
|
+{
|
|
|
+ struct i40e_netdev_priv *np = netdev_priv(dev);
|
|
|
+ struct i40e_vsi *vsi = np->vsi;
|
|
|
+ struct i40e_pf *pf = vsi->back;
|
|
|
+
|
|
|
+ if (flags & I40E_PRIV_FLAGS_LINKPOLL_FLAG)
|
|
|
+ pf->flags |= I40E_FLAG_LINK_POLLING_ENABLED;
|
|
|
+ else
|
|
|
+ pf->flags &= ~I40E_FLAG_LINK_POLLING_ENABLED;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static const struct ethtool_ops i40e_ethtool_ops = {
|
|
|
.get_settings = i40e_get_settings,
|
|
|
.set_settings = i40e_set_settings,
|
|
@@ -2676,6 +2697,7 @@ static const struct ethtool_ops i40e_ethtool_ops = {
|
|
|
.set_channels = i40e_set_channels,
|
|
|
.get_ts_info = i40e_get_ts_info,
|
|
|
.get_priv_flags = i40e_get_priv_flags,
|
|
|
+ .set_priv_flags = i40e_set_priv_flags,
|
|
|
};
|
|
|
|
|
|
void i40e_set_ethtool_ops(struct net_device *netdev)
|