net: ethernet: mediatek: Use hw_feature to judge if HWLRO is supported
authorSean Wang <sean.wang@mediatek.com>
Sat, 1 Jun 2019 00:16:26 +0000 (08:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 22:04:07 +0000 (15:04 -0700)
Should hw_feature as hardware capability flags to check if hardware LRO
got support.

Signed-off-by: Mark Lee <mark-mc.lee@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index f9fbb3ffa3a61e696a8078a98f41be1496a9ac45..0b88febbaf2affc80349b05420e1e6fa53606ca2 100644 (file)
@@ -2298,13 +2298,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
 
        switch (cmd->cmd) {
        case ETHTOOL_GRXRINGS:
-               if (dev->features & NETIF_F_LRO) {
+               if (dev->hw_features & NETIF_F_LRO) {
                        cmd->data = MTK_MAX_RX_RING_NUM;
                        ret = 0;
                }
                break;
        case ETHTOOL_GRXCLSRLCNT:
-               if (dev->features & NETIF_F_LRO) {
+               if (dev->hw_features & NETIF_F_LRO) {
                        struct mtk_mac *mac = netdev_priv(dev);
 
                        cmd->rule_cnt = mac->hwlro_ip_cnt;
@@ -2312,11 +2312,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
                }
                break;
        case ETHTOOL_GRXCLSRULE:
-               if (dev->features & NETIF_F_LRO)
+               if (dev->hw_features & NETIF_F_LRO)
                        ret = mtk_hwlro_get_fdir_entry(dev, cmd);
                break;
        case ETHTOOL_GRXCLSRLALL:
-               if (dev->features & NETIF_F_LRO)
+               if (dev->hw_features & NETIF_F_LRO)
                        ret = mtk_hwlro_get_fdir_all(dev, cmd,
                                                     rule_locs);
                break;
@@ -2333,11 +2333,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 
        switch (cmd->cmd) {
        case ETHTOOL_SRXCLSRLINS:
-               if (dev->features & NETIF_F_LRO)
+               if (dev->hw_features & NETIF_F_LRO)
                        ret = mtk_hwlro_add_ipaddr(dev, cmd);
                break;
        case ETHTOOL_SRXCLSRLDEL:
-               if (dev->features & NETIF_F_LRO)
+               if (dev->hw_features & NETIF_F_LRO)
                        ret = mtk_hwlro_del_ipaddr(dev, cmd);
                break;
        default: