]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.9/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch
fixes for 4.9
[thirdparty/kernel/stable-queue.git] / queue-4.9 / net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch
1 From 01aaef64c03c2b344d998c2475e933a357176c64 Mon Sep 17 00:00:00 2001
2 From: Sean Wang <sean.wang@mediatek.com>
3 Date: Sat, 1 Jun 2019 08:16:26 +0800
4 Subject: net: ethernet: mediatek: Use hw_feature to judge if HWLRO is
5 supported
6
7 [ Upstream commit 9e4f56f1a7f3287718d0083b5cb85298dc05a5fd ]
8
9 Should hw_feature as hardware capability flags to check if hardware LRO
10 got support.
11
12 Signed-off-by: Mark Lee <mark-mc.lee@mediatek.com>
13 Signed-off-by: Sean Wang <sean.wang@mediatek.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 Signed-off-by: Sasha Levin <sashal@kernel.org>
16 ---
17 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 12 ++++++------
18 1 file changed, 6 insertions(+), 6 deletions(-)
19
20 diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
21 index 20de37a414fe..03b599109619 100644
22 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
23 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
24 @@ -2175,13 +2175,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
25
26 switch (cmd->cmd) {
27 case ETHTOOL_GRXRINGS:
28 - if (dev->features & NETIF_F_LRO) {
29 + if (dev->hw_features & NETIF_F_LRO) {
30 cmd->data = MTK_MAX_RX_RING_NUM;
31 ret = 0;
32 }
33 break;
34 case ETHTOOL_GRXCLSRLCNT:
35 - if (dev->features & NETIF_F_LRO) {
36 + if (dev->hw_features & NETIF_F_LRO) {
37 struct mtk_mac *mac = netdev_priv(dev);
38
39 cmd->rule_cnt = mac->hwlro_ip_cnt;
40 @@ -2189,11 +2189,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
41 }
42 break;
43 case ETHTOOL_GRXCLSRULE:
44 - if (dev->features & NETIF_F_LRO)
45 + if (dev->hw_features & NETIF_F_LRO)
46 ret = mtk_hwlro_get_fdir_entry(dev, cmd);
47 break;
48 case ETHTOOL_GRXCLSRLALL:
49 - if (dev->features & NETIF_F_LRO)
50 + if (dev->hw_features & NETIF_F_LRO)
51 ret = mtk_hwlro_get_fdir_all(dev, cmd,
52 rule_locs);
53 break;
54 @@ -2210,11 +2210,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
55
56 switch (cmd->cmd) {
57 case ETHTOOL_SRXCLSRLINS:
58 - if (dev->features & NETIF_F_LRO)
59 + if (dev->hw_features & NETIF_F_LRO)
60 ret = mtk_hwlro_add_ipaddr(dev, cmd);
61 break;
62 case ETHTOOL_SRXCLSRLDEL:
63 - if (dev->features & NETIF_F_LRO)
64 + if (dev->hw_features & NETIF_F_LRO)
65 ret = mtk_hwlro_del_ipaddr(dev, cmd);
66 break;
67 default:
68 --
69 2.20.1
70