@@ -2522,13 +2522,13 @@ static int mlx4_en_set_features(struct net_device *netdev,
bool reset = false;
int ret = 0;
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_RXFCS)) {
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_RXFCS_BIT)) {
en_info(priv, "Turn %s RX-FCS\n",
(features & NETIF_F_RXFCS) ? "ON" : "OFF");
reset = true;
}
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_RXALL)) {
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_RXALL_BIT)) {
u8 ignore_fcs_value = (features & NETIF_F_RXALL) ? 1 : 0;
en_info(priv, "Turn %s RX-ALL\n",
@@ -2539,21 +2539,21 @@ static int mlx4_en_set_features(struct net_device *netdev,
return ret;
}
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_RX)) {
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_RX_BIT)) {
en_info(priv, "Turn %s RX vlan strip offload\n",
(features & NETIF_F_HW_VLAN_CTAG_RX) ? "ON" : "OFF");
reset = true;
}
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_TX))
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_CTAG_TX_BIT))
en_info(priv, "Turn %s TX vlan strip offload\n",
(features & NETIF_F_HW_VLAN_CTAG_TX) ? "ON" : "OFF");
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_STAG_TX))
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_HW_VLAN_STAG_TX_BIT))
en_info(priv, "Turn %s TX S-VLAN strip offload\n",
(features & NETIF_F_HW_VLAN_STAG_TX) ? "ON" : "OFF");
- if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_LOOPBACK)) {
+ if (DEV_FEATURE_CHANGED(netdev, features, NETIF_F_LOOPBACK_BIT)) {
en_info(priv, "Turn %s loopback\n",
(features & NETIF_F_LOOPBACK) ? "ON" : "OFF");
mlx4_en_update_loopback_state(netdev, features);
@@ -3508,11 +3508,11 @@ int mlx4_en_reset_config(struct net_device *dev,
if (priv->hwtstamp_config.tx_type == ts_config.tx_type &&
priv->hwtstamp_config.rx_filter == ts_config.rx_filter &&
- !DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX) &&
- !DEV_FEATURE_CHANGED(dev, features, NETIF_F_RXFCS))
+ !DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX_BIT) &&
+ !DEV_FEATURE_CHANGED(dev, features, NETIF_F_RXFCS_BIT))
return 0; /* Nothing to change */
- if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX) &&
+ if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX_BIT) &&
(features & NETIF_F_HW_VLAN_CTAG_RX) &&
(priv->hwtstamp_config.rx_filter != HWTSTAMP_FILTER_NONE)) {
en_warn(priv, "Can't turn ON rx vlan offload while time-stamping rx filter is ON\n");
@@ -3539,7 +3539,7 @@ int mlx4_en_reset_config(struct net_device *dev,
mlx4_en_safe_replace_resources(priv, tmp);
- if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX)) {
+ if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX_BIT)) {
if (features & NETIF_F_HW_VLAN_CTAG_RX)
dev->features |= NETIF_F_HW_VLAN_CTAG_RX;
else
@@ -3554,7 +3554,7 @@ int mlx4_en_reset_config(struct net_device *dev,
dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX;
}
- if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_RXFCS)) {
+ if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_RXFCS_BIT)) {
if (features & NETIF_F_RXFCS)
dev->features |= NETIF_F_RXFCS;
else
@@ -774,8 +774,9 @@ void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv);
void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf);
void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev);
-#define DEV_FEATURE_CHANGED(dev, new_features, feature) \
- ((dev->features & feature) ^ (new_features & feature))
+#define DEV_FEATURE_CHANGED(dev, new_features, feature_bit) \
+ (netdev_active_feature_test(dev, feature_bit) != \
+ netdev_feature_test(feature_bit, new_features))
int mlx4_en_moderation_update(struct mlx4_en_priv *priv);
int mlx4_en_reset_config(struct net_device *dev,
The macro DEV_FEATURE_CHANGED use NETIF_F_XXX as parameter, change it to use NETIF_F_XXX_BIT instead, for all the macroes NETIF_F_XXX will be removed later. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- .../net/ethernet/mellanox/mlx4/en_netdev.c | 22 +++++++++---------- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 5 +++-- 2 files changed, 14 insertions(+), 13 deletions(-)