linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: hns3: fixes for -net
@ 2020-02-14  1:53 Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 1/3] net: hns3: add management table after IMP reset Huazhong Tan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Huazhong Tan @ 2020-02-14  1:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba, Huazhong Tan

This series includes three bugfixes for the HNS3 ethernet driver.

[patch 1] fixes a management table lost issue after IMP reset.
[patch 2] fixes a VF bandwidth configuration not work problem.
[patch 3] fixes a problem related to IPv6 address copying.

Guangbin Huang (1):
  net: hns3: fix a copying IPv6 address error in
    hclge_fd_get_flow_tuples()

Yonglong Liu (1):
  net: hns3: fix VF bandwidth does not take effect in some case

Yufeng Mo (1):
  net: hns3: add management table after IMP reset

 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 22 ++++++++++++++++------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  2 +-
 2 files changed, 17 insertions(+), 7 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/3] net: hns3: add management table after IMP reset
  2020-02-14  1:53 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
@ 2020-02-14  1:53 ` Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 2/3] net: hns3: fix VF bandwidth does not take effect in some case Huazhong Tan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Huazhong Tan @ 2020-02-14  1:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba, Yufeng Mo, Huazhong Tan

From: Yufeng Mo <moyufeng@huawei.com>

In the current process, the management table is missing after the
IMP reset. This patch adds the management table to the reset process.

Fixes: f5aac71c0327 ("net: hns3: add manager table initialization for hardware")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index ec5f6ee..25ac573 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -9834,6 +9834,13 @@ static int hclge_reset_ae_dev(struct hnae3_ae_dev *ae_dev)
 		return ret;
 	}
 
+	ret = init_mgr_tbl(hdev);
+	if (ret) {
+		dev_err(&pdev->dev,
+			"failed to reinit manager table, ret = %d\n", ret);
+		return ret;
+	}
+
 	ret = hclge_init_fd_config(hdev);
 	if (ret) {
 		dev_err(&pdev->dev, "fd table init fail, ret=%d\n", ret);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 2/3] net: hns3: fix VF bandwidth does not take effect in some case
  2020-02-14  1:53 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 1/3] net: hns3: add management table after IMP reset Huazhong Tan
@ 2020-02-14  1:53 ` Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 3/3] net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples() Huazhong Tan
  2020-02-14 15:05 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Huazhong Tan @ 2020-02-14  1:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba, Yonglong Liu, Huazhong Tan

From: Yonglong Liu <liuyonglong@huawei.com>

When enabling 4 TC after setting the bandwidth of VF, the bandwidth
of VF will resume to default value, because of the qset resources
changed in this case.

This patch fixes it by using a fixed VF's qset resources according to
HNAE3_MAX_TC macro.

Fixes: ee9e44248f52 ("net: hns3: add support for configuring bandwidth of VF on the host")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 180224e..28db132 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -566,7 +566,7 @@ static void hclge_tm_vport_tc_info_update(struct hclge_vport *vport)
 	 */
 	kinfo->num_tc = vport->vport_id ? 1 :
 			min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc);
-	vport->qs_offset = (vport->vport_id ? hdev->tm_info.num_tc : 0) +
+	vport->qs_offset = (vport->vport_id ? HNAE3_MAX_TC : 0) +
 				(vport->vport_id ? (vport->vport_id - 1) : 0);
 
 	max_rss_size = min_t(u16, hdev->rss_size_max,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net 3/3] net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()
  2020-02-14  1:53 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 1/3] net: hns3: add management table after IMP reset Huazhong Tan
  2020-02-14  1:53 ` [PATCH net 2/3] net: hns3: fix VF bandwidth does not take effect in some case Huazhong Tan
@ 2020-02-14  1:53 ` Huazhong Tan
  2020-02-14 15:05 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Huazhong Tan @ 2020-02-14  1:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba, Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

The IPv6 address defined in struct in6_addr is specified as
big endian, but there is no specified endian in struct
hclge_fd_rule_tuples, so it  will cause a problem if directly
use memcpy() to copy ipv6 address between these two structures
since this field in struct hclge_fd_rule_tuples is little endian.

This patch fixes this problem by using be32_to_cpu() to convert
endian of IPv6 address of struct in6_addr before copying.

Fixes: d93ed94fbeaf ("net: hns3: add aRFS support for PF")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 25ac573..492bc94 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6113,6 +6113,9 @@ static int hclge_get_all_rules(struct hnae3_handle *handle,
 static void hclge_fd_get_flow_tuples(const struct flow_keys *fkeys,
 				     struct hclge_fd_rule_tuples *tuples)
 {
+#define flow_ip6_src fkeys->addrs.v6addrs.src.in6_u.u6_addr32
+#define flow_ip6_dst fkeys->addrs.v6addrs.dst.in6_u.u6_addr32
+
 	tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto);
 	tuples->ip_proto = fkeys->basic.ip_proto;
 	tuples->dst_port = be16_to_cpu(fkeys->ports.dst);
@@ -6121,12 +6124,12 @@ static void hclge_fd_get_flow_tuples(const struct flow_keys *fkeys,
 		tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src);
 		tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst);
 	} else {
-		memcpy(tuples->src_ip,
-		       fkeys->addrs.v6addrs.src.in6_u.u6_addr32,
-		       sizeof(tuples->src_ip));
-		memcpy(tuples->dst_ip,
-		       fkeys->addrs.v6addrs.dst.in6_u.u6_addr32,
-		       sizeof(tuples->dst_ip));
+		int i;
+
+		for (i = 0; i < IPV6_SIZE; i++) {
+			tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]);
+			tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]);
+		}
 	}
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2020-02-14  1:53 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
                   ` (2 preceding siblings ...)
  2020-02-14  1:53 ` [PATCH net 3/3] net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples() Huazhong Tan
@ 2020-02-14 15:05 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-02-14 15:05 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Fri, 14 Feb 2020 09:53:40 +0800

> This series includes three bugfixes for the HNS3 ethernet driver.
> 
> [patch 1] fixes a management table lost issue after IMP reset.
> [patch 2] fixes a VF bandwidth configuration not work problem.
> [patch 3] fixes a problem related to IPv6 address copying.

Series applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-14 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  1:53 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
2020-02-14  1:53 ` [PATCH net 1/3] net: hns3: add management table after IMP reset Huazhong Tan
2020-02-14  1:53 ` [PATCH net 2/3] net: hns3: fix VF bandwidth does not take effect in some case Huazhong Tan
2020-02-14  1:53 ` [PATCH net 3/3] net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples() Huazhong Tan
2020-02-14 15:05 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).