Commit 9e4f56f1 authored by Sean Wang's avatar Sean Wang Committed by David S. Miller

net: ethernet: mediatek: Use hw_feature to judge if HWLRO is supported

Should hw_feature as hardware capability flags to check if hardware LRO
got support.
Signed-off-by: default avatarMark Lee <mark-mc.lee@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09faf5a7
...@@ -2298,13 +2298,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, ...@@ -2298,13 +2298,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
switch (cmd->cmd) { switch (cmd->cmd) {
case ETHTOOL_GRXRINGS: case ETHTOOL_GRXRINGS:
if (dev->features & NETIF_F_LRO) { if (dev->hw_features & NETIF_F_LRO) {
cmd->data = MTK_MAX_RX_RING_NUM; cmd->data = MTK_MAX_RX_RING_NUM;
ret = 0; ret = 0;
} }
break; break;
case ETHTOOL_GRXCLSRLCNT: case ETHTOOL_GRXCLSRLCNT:
if (dev->features & NETIF_F_LRO) { if (dev->hw_features & NETIF_F_LRO) {
struct mtk_mac *mac = netdev_priv(dev); struct mtk_mac *mac = netdev_priv(dev);
cmd->rule_cnt = mac->hwlro_ip_cnt; cmd->rule_cnt = mac->hwlro_ip_cnt;
...@@ -2312,11 +2312,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, ...@@ -2312,11 +2312,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
} }
break; break;
case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRULE:
if (dev->features & NETIF_F_LRO) if (dev->hw_features & NETIF_F_LRO)
ret = mtk_hwlro_get_fdir_entry(dev, cmd); ret = mtk_hwlro_get_fdir_entry(dev, cmd);
break; break;
case ETHTOOL_GRXCLSRLALL: case ETHTOOL_GRXCLSRLALL:
if (dev->features & NETIF_F_LRO) if (dev->hw_features & NETIF_F_LRO)
ret = mtk_hwlro_get_fdir_all(dev, cmd, ret = mtk_hwlro_get_fdir_all(dev, cmd,
rule_locs); rule_locs);
break; break;
...@@ -2333,11 +2333,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) ...@@ -2333,11 +2333,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
switch (cmd->cmd) { switch (cmd->cmd) {
case ETHTOOL_SRXCLSRLINS: case ETHTOOL_SRXCLSRLINS:
if (dev->features & NETIF_F_LRO) if (dev->hw_features & NETIF_F_LRO)
ret = mtk_hwlro_add_ipaddr(dev, cmd); ret = mtk_hwlro_add_ipaddr(dev, cmd);
break; break;
case ETHTOOL_SRXCLSRLDEL: case ETHTOOL_SRXCLSRLDEL:
if (dev->features & NETIF_F_LRO) if (dev->hw_features & NETIF_F_LRO)
ret = mtk_hwlro_del_ipaddr(dev, cmd); ret = mtk_hwlro_del_ipaddr(dev, cmd);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment