* [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF
@ 2018-01-26 11:31 Peng Li
2018-01-26 11:31 ` [PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF Peng Li
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peng Li @ 2018-01-26 11:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, linuxarm, salil.mehta, lipeng321
This patch-set adds ethtool_ops.{get|set}_coalesce to VF and
fix one related bug.
HNS3 PF and VF driver use the common enet layer, as the
ethtool_ops.{get|set}_coalesce to PF have upstreamed, just
need add the ops to hns3vf_ethtool_ops.
[Patch 1/2] fix a related bug for the VF ethtool_ops.{set|
get}_coalesce.
Fuyun Liang (2):
net: hns3: add get/set_coalesce support to VF
net: hns3: add int_gl_idx setup for VF
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 ++
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 8 ++++++++
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++
3 files changed, 15 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF
2018-01-26 11:31 [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF Peng Li
@ 2018-01-26 11:31 ` Peng Li
2018-01-26 11:31 ` [PATCH net-next 2/2] net: hns3: add int_gl_idx setup for VF Peng Li
2018-01-26 15:58 ` [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Peng Li @ 2018-01-26 11:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, linuxarm, salil.mehta, lipeng321
From: Fuyun Liang <liangfuyun1@huawei.com>
This patch adds ethtool_ops.get/set_coalesce support to VF.
Since PF and VF share the same get/set_coalesce interface,
we only need to set hns3_get/set_coalesce to the ethtool_ops
when supporting get/set_coalesce for VF.
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 7410205..b034c7f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -1109,6 +1109,8 @@ static int hns3_set_phys_id(struct net_device *netdev,
.set_rxfh = hns3_set_rss,
.get_link_ksettings = hns3_get_link_ksettings,
.get_channels = hns3_get_channels,
+ .get_coalesce = hns3_get_coalesce,
+ .set_coalesce = hns3_set_coalesce,
};
static const struct ethtool_ops hns3_ethtool_ops = {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: hns3: add int_gl_idx setup for VF
2018-01-26 11:31 [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF Peng Li
2018-01-26 11:31 ` [PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF Peng Li
@ 2018-01-26 11:31 ` Peng Li
2018-01-26 15:58 ` [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Peng Li @ 2018-01-26 11:31 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, linuxarm, salil.mehta, lipeng321
From: Fuyun Liang <liangfuyun1@huawei.com>
Just like PF, if the int_gl_idx of VF does not be set, the default
interrupt coalesce index of VF is 0. But it should be GL1 for TX
queues and GL0 for RX queues.
This patch adds the int_gl_idx setup for VF.
Fixes: 200ecda42598 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 8 ++++++++
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
index 96f453f..f38fc5c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
@@ -116,6 +116,9 @@ static int hclge_get_ring_chain_from_mbx(
hnae_set_bit(ring_chain->flag, HNAE3_RING_TYPE_B, req->msg[3]);
ring_chain->tqp_index =
hclge_get_queue_id(vport->nic.kinfo.tqp[req->msg[4]]);
+ hnae_set_field(ring_chain->int_gl_idx, HCLGE_INT_GL_IDX_M,
+ HCLGE_INT_GL_IDX_S,
+ req->msg[5]);
cur_chain = ring_chain;
@@ -133,6 +136,11 @@ static int hclge_get_ring_chain_from_mbx(
[req->msg[HCLGE_RING_NODE_VARIABLE_NUM * i +
HCLGE_RING_MAP_MBX_BASIC_MSG_NUM + 1]]);
+ hnae_set_field(new_chain->int_gl_idx, HCLGE_INT_GL_IDX_M,
+ HCLGE_INT_GL_IDX_S,
+ req->msg[HCLGE_RING_NODE_VARIABLE_NUM * i +
+ HCLGE_RING_MAP_MBX_BASIC_MSG_NUM + 2]);
+
cur_chain->next = new_chain;
cur_chain = new_chain;
}
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 3d2bc9a..0d89965 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -565,6 +565,11 @@ static int hclgevf_bind_ring_to_vector(struct hnae3_handle *handle, bool en,
hnae_get_bit(node->flag, HNAE3_RING_TYPE_B);
req->msg[HCLGEVF_RING_NODE_VARIABLE_NUM * i + 1] =
node->tqp_index;
+ req->msg[HCLGEVF_RING_NODE_VARIABLE_NUM * i + 2] =
+ hnae_get_field(node->int_gl_idx,
+ HNAE3_RING_GL_IDX_M,
+ HNAE3_RING_GL_IDX_S);
+
if (i == (HCLGE_MBX_VF_MSG_DATA_NUM -
HCLGEVF_RING_MAP_MBX_BASIC_MSG_NUM) /
HCLGEVF_RING_NODE_VARIABLE_NUM) {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF
2018-01-26 11:31 [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF Peng Li
2018-01-26 11:31 ` [PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF Peng Li
2018-01-26 11:31 ` [PATCH net-next 2/2] net: hns3: add int_gl_idx setup for VF Peng Li
@ 2018-01-26 15:58 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-26 15:58 UTC (permalink / raw)
To: lipeng321; +Cc: netdev, linux-kernel, linuxarm, salil.mehta
From: Peng Li <lipeng321@huawei.com>
Date: Fri, 26 Jan 2018 19:31:23 +0800
> This patch-set adds ethtool_ops.{get|set}_coalesce to VF and
> fix one related bug.
>
> HNS3 PF and VF driver use the common enet layer, as the
> ethtool_ops.{get|set}_coalesce to PF have upstreamed, just
> need add the ops to hns3vf_ethtool_ops.
>
> [Patch 1/2] fix a related bug for the VF ethtool_ops.{set|
> get}_coalesce.
Series applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-26 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-26 11:31 [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce for VF Peng Li
2018-01-26 11:31 ` [PATCH net-next 1/2] net: hns3: add get/set_coalesce support to VF Peng Li
2018-01-26 11:31 ` [PATCH net-next 2/2] net: hns3: add int_gl_idx setup for VF Peng Li
2018-01-26 15:58 ` [PATCH net-next 0/2] net: hns3: add support ethtool_ops.{set|get}_coalesce " 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).