[PATCH net] net: hns: Add self-adaptive interrupt coalesce support in hns driver

2017-08-02 Thread Yunsheng Lin
From: Lin Yun Sheng <linyunsh...@huawei.com> When deal with low and high throughput, it is hard to achiece both high performance and low latency. In order to achiece that, this patch calculates the rx rate, and adjust the interrupt coalesce parameter accordingly. Signed-off-by: Yunshe

[PATCH net-next] net: hns: Fix for __udivdi3 compiler error

2017-08-04 Thread Yunsheng Lin
This patch fixes the __udivdi3 undefined error reported by test robot. Fixes: b8c17f708831 ("net: hns: Add self-adaptive interrupt coalesce support in hns driver") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 3 ++- 1

Re: [PATCH NET V7 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-28 Thread Yunsheng Lin
. The only time you drop such tags is when > you make a big change. Will do next time, thanks for reviewing. Best Regards Yunsheng Lin

Re: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-29 Thread Yunsheng Lin
> + > + if (mask_basic->n_proto) { cpu_to_be16(mask_basic->n_proto) remove cpu_to_be16 in case. > + /* Ethernet type is present in the key. */ > + switch (key_basic->n_proto) { > + case cpu_to_be16(ETH_P_IP): > + key_layer |=

Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-28 Thread Yunsheng Lin
the phy has a default state. suspended? 2. If user runs the self test after using 'ifconfig ethX down', then I suppose phy is already suspended. Also I don't quite understand what do you mean by in trouble. Right now in phy core, phy_resume return ok even the phy is not suspended. Best Rega

Re: [PATCH NET V7 0/2] Add loopback support in phy_driver and hns ethtool fix

2017-06-30 Thread Yunsheng Lin
Hi, David I will send out a patch based on net-next, and I will continue to address the problem andrew pointed out. If I come out with a doable solution, I will send out the new patch. Best Regards Yunsheng Lin On 2017/6/30 4:08, David Miller wrote: > From: Andrew Lunn <and...@lunn.ch&g

Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-30 Thread Yunsheng Lin
after mac driver is first loaded? It seems that ixgbe_ethtool in mainline kernel also use netif_tx_disable, napi_disable and other hardware specific method to setup self test. But newest ixgbe_ethtool code in github also use dev_close to do self test. Any idea? Best Regard Yunsheng Lin

Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-07-03 Thread Yunsheng Lin
ng when it is WOL'ed, and it do not check the return value of phy_suspend. I hope I am not missing something obvious. Please let me know if you have any idea about WOL problem, thanks. Best Regards Yunsheng Lin

Re: [PATCH net 0/3] Bugfixs for hns ethernet driver

2017-07-05 Thread Yunsheng Lin
Hi, Florian On 2017/7/5 0:56, Florian Fainelli wrote: > On 04/07/2017 03:47, Lin Yun Sheng wrote: >> This patchset fix skb uesd after used, C45 op code and >> Tx description filling issues in hns driver. > > Since these are fixes, can you include proper Fixes: tag so it is easier > for -stable

Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description

2017-07-05 Thread Yunsheng Lin
Hi, David On 2017/7/4 18:28, David Miller wrote: > From: Lin Yun Sheng <linyunsh...@huawei.com> > Date: Tue, 4 Jul 2017 18:47:31 +0800 > >> From: Yunsheng Lin <linyunsh...@huawei.com> >> >> If driver support checksum offload, should check netdev feature >

Re: [PATCH NET 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-22 Thread Yunsheng Lin
do when it receive the error? I assume that it will return it to userspace. because the rtnl_lock ensure only one ethtool is executing, if the function return error, it means some bug in the mac driver, am I right? will add the function in phy.c next version. Best Regards Yunsheng Lin

Re: [PATCH NET 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-22 Thread Yunsheng Lin
gt; +return 0; >> +} > > This is pointless. The core code in phy.c should first check if the > function exists before calling it. So not having a 10g method is fine. > will remove it next vesion. Best Regards Yunsheng Lin

Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-23 Thread Yunsheng Lin
opback); > > One of the comments we made of the PHY code in the hns driver is that > its locking is completely broken. You have made the same error > here. The core needs to hold the mutex while calling into the PHY > driver. Do you mean hns_nic_config_phy_loopback need to hold the mutex while calling phy_loopback? and other place that calling phy_* function? Best Regards Yunsheng Lin

Re: [PATCH NET v3 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-24 Thread Yunsheng Lin
On 2017/6/24 11:40, Yunsheng Lin wrote: > Hi, Andrew > > On 2017/6/24 11:12, Andrew Lunn wrote: >>> +int phy_loopback(struct phy_device *phydev, bool enable) >>> +{ >>> + struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); >&g

Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-26 Thread Yunsheng Lin
nic_config_phy_loopback(phy_dev, 0x1); >> -ret |= h->dev->ops->set_loopback(h, loop, 0x1); >> -} >> +ret = hns_nic_config_phy_loopback(phy_dev, 0x1); >> +ret |= h->dev->ops->set_loopback(h, loop, 0x1); > > Or'ing together two errno values does not make much sense: > >> +if (loop == MAC_INTERNALLOOP_PHY) >> +ret = __lb_setup(ndev, MAC_LOOP_PHY_NONE); >> +else >> +ret = __lb_setup(ndev, MAC_LOOP_NONE); >> if (ret) >> netdev_err(ndev, "%s: __lb_setup return error(%d)!\n", >> __func__, > > And it looks like you even print the OR'ed version here! > Thanks for pointing out, will modify it next version. Best Regard Yunsheng Lin

Re: [PATCH NET V4 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-25 Thread Yunsheng Lin
Hi, Andrew On 2017/6/24 21:44, Andrew Lunn wrote: >> @@ -1087,7 +1087,7 @@ int phy_suspend(struct phy_device *phydev) >> { >> struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); >> struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; >> -int ret = 0; >> +int

Re: [PATCH NET v2 0/2] Add loopback support in phy_driver and hns ethtool fix

2017-06-23 Thread Yunsheng Lin
My apology, this patch set have a bug in hns mac driver which is not calling phy_loopback enable and disable in pair, I will send a v3 to fix it. Please ignore this patch set. Best Regards Yunsheng Lin On 2017/6/23 15:54, Lin Yun Sheng wrote: > This Patch Set add set_loopback in phy_dri

Re: [PATCH NET V6 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-27 Thread Yunsheng Lin
Hi, Madalin On 2017/6/27 19:48, Madalin-cristian Bucur wrote: >> -Original Message- >> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] >> On Behalf Of Lin Yun Sheng >> Sent: Tuesday, June 27, 2017 2:01 PM >> To: da...@davemloft.net; and...@lunn.ch;

Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-27 Thread Yunsheng Lin
p; phydrv->suspend) ret = phydrv->suspend(phydev); if (ret) return ret; phydev->suspended = true; return ret; } Best Regard Yunsheng Lin

Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-22 Thread Yunsheng Lin
Hi, Jiri On 2017/9/23 0:03, Jiri Pirko wrote: > Fri, Sep 22, 2017 at 04:11:51PM CEST, linyunsh...@huawei.com wrote: >> Hi, Jiri >> - if (!tc) { + if (if_running) { + (void)hns3_nic_net_stop(netdev); + msleep(100); + } + + ret = (kinfo->dcb_ops &&

[PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-21 Thread Yunsheng Lin
ed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 135 + 1 file changed, 111 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon

[PATCH net-next 08/10] net: hns3: Add dcb netlink interface for the support of DCB feature

2017-09-21 Thread Yunsheng Lin
This patch add dcb netlink interface by calling the interface from hclge_dcb module. This patch also update Makefile in order to build hns3_dcbnl module. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/Makefile| 2 + .../ethernet/his

[PATCH net-next 05/10] net: hns3: Add tc-based TM support for sriov enabled port

2017-09-21 Thread Yunsheng Lin
When sriov is enabled and TM is in tc-based mode, vf's TM parameters is not set in TM initialization process. This patch add the tc_based TM support for sriov enabled using the information in vport struct. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilico

[PATCH net-next 09/10] net: hns3: Setting for fc_mode and dcb enable flag in TM module

2017-09-21 Thread Yunsheng Lin
After the DCB feature is supported, fc_mode and dcb enable flag must be set according to the DCB parameter. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 34 +++--- 1 file changed, 30 insertions(+), 4 del

[PATCH net-next 03/10] net: hns3: Add support for PFC setting in TM module

2017-09-21 Thread Yunsheng Lin
This patch add a pfc_pause_en cmd, and use it to configure PFC option according to fc_mode in hdev->tm_info. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 68 -- .../net/ethernet/hisilicon/hns3/hns3pf/h

[PATCH net-next 00/10] Add support for DCB feature in hns3 driver

2017-09-21 Thread Yunsheng Lin
(if schedule mode is ETS), prio_tc_map and PFC parameter. Yunsheng Lin (10): net: hns3: Support for dynamically assigning tx buffer to TC net: hns3: Add support for dynamically buffer reallocation net: hns3: Add support for PFC setting in TM module net: hns3: Add support for port shaper

[PATCH net-next 02/10] net: hns3: Add support for dynamically buffer reallocation

2017-09-21 Thread Yunsheng Lin
parameter, and priv_buf is only used at buffer allocation process, so it is ok to use a dynamic allocated temporary memory. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 5 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Re: [PATCH net-next 2/4] cxgb4: add basic tc flower offload support

2017-09-21 Thread Yunsheng Lin
Hi, Kumar On 2017/9/21 15:33, Rahul Lakkireddy wrote: > From: Kumar Sanghvi > > Add support to add/remove flows for offload. Following match > and action are supported for offloading a flow: > > Match: ether-protocol, IPv4/IPv6 addresses, L4 ports (TCP/UDP) > Action:

Re: [PATCH net 2/4] net:ethernet:aquantia: Fix Tx queue hangups

2017-09-21 Thread Yunsheng Lin
Hi, Igor On 2017/9/21 18:53, Igor Russkikh wrote: > Driver did a poor job in managing its Tx queues: Sometimes it could stop > tx queues due to link down condition in aq_nic_xmit - but never waked up > them. That led to Tx path total suspend. > This patch fixes this and improves generic queue

[PATCH net-next 07/10] net: hns3: Add hclge_dcb module for the support of DCB feature

2017-09-21 Thread Yunsheng Lin
The hclge_dcb module calls the interface from hclge_main/tm and provide interface for the dcb netlink interface. This patch also update Makefiles required to build the DCB supported code in HNS3 Ethernet driver and update the existing Kconfig file in the hisilicon folder. Signed-off-by: Yunsheng

[PATCH net-next 06/10] net: hns3: Add some interface for the support of DCB feature

2017-09-21 Thread Yunsheng Lin
This patch add some interface and export some interface from hclge_tm and hclgc_main to support the upcoming DCB feature. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 3 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h

[PATCH net-next 04/10] net: hns3: Add support for port shaper setting in TM module

2017-09-21 Thread Yunsheng Lin
This patch add a tm_port_shaper cmd and set port shaper to HCLGE_ETHER_MAX_RATE on TM initialization process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 33 ++ .../net/ethernet/hisilicon/hns3/hns3pf/hclg

[PATCH net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC

2017-09-21 Thread Yunsheng Lin
This patch add support of dynamically assigning tx buffer to TC when the TC is enabled. It will save buffer for rx direction to avoid packet loss. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 1 + .../ethernet/hisilico

Re: [PATCH net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC

2017-09-21 Thread Yunsheng Lin
Hi, David On 2017/9/22 9:41, David Miller wrote: > From: Yunsheng Lin <linyunsh...@huawei.com> > Date: Thu, 21 Sep 2017 19:21:44 +0800 > >> @@ -1324,23 +1324,28 @@ static int hclge_alloc_vport(struct hclge_dev *hdev) >> return 0; >> } >> >>

[PATCH net 4/9] net: hns3: Fix for not setting rx private buffer size to zero

2017-09-20 Thread Yunsheng Lin
Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --

[PATCH net 2/9] net: hns3: Fix initialization when cmd is not supported

2017-09-20 Thread Yunsheng Lin
: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 7 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 26 +---

[PATCH net 1/9] net: hns3: Cleanup for ROCE capability flag in ae_dev

2017-09-20 Thread Yunsheng Lin
is not supported. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 5 - .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 25 -- .../net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 16 +- 3 files chang

[PATCH net 7/9] net: hns3: Fix typo error for feild in hclge_tm

2017-09-20 Thread Yunsheng Lin
This patch fixes a typo error for feild, which should be field. Fixes: 848440544b41f ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3p

[PATCH net 0/9] TM related bugfixes for the HNS3 Ethernet Driver

2017-09-20 Thread Yunsheng Lin
This patch set contains a few bugfixes related to hclge_tm module. Yunsheng Lin (9): net: hns3: Cleanup for ROCE capability flag in ae_dev net: hns3: Fix initialization when cmd is not supported net: hns3: Fix for DEFAULT_DV when dev doesn't support DCB net: hns3: Fix for not setting rx

[PATCH net 3/9] net: hns3: Fix for DEFAULT_DV when dev doesn't support DCB

2017-09-20 Thread Yunsheng Lin
When ae_dev doesn't support DCB, DEFAULT_DV must be set to a lower value, otherwise the buffer allocation process will fail. This patch fix it by setting it to 30K bytes. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by

[PATCH net 8/9] net: hns3: Fix for setting rss_size incorrectly

2017-09-20 Thread Yunsheng Lin
correctly. For now, each TC has the same rss size. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 76 ++--

[PATCH net 9/9] net: hns3: Fix for pri to tc mapping in TM

2017-09-20 Thread Yunsheng Lin
Current mapping between pri and tc is one to one, so user can't map multi priorities to the same tc. This patch changes the mapping to many to one. Fixes: 848440544b41f ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Yunsheng Lin <linyu

[PATCH net 6/9] net: hns3: Fix for rx priv buf allocation when DCB is not supported

2017-09-20 Thread Yunsheng Lin
ation Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/

[PATCH net 5/9] net: hns3: Fix for rx_priv_buf_alloc not setting rx shared buffer

2017-09-20 Thread Yunsheng Lin
of packet in SSU. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 3 ++- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclg

Re: [PATCH net-next 0/2] Add mqprio hardware offload support in hns3 driver

2017-10-15 Thread Yunsheng Lin
" According to the description of the above patchset, the default mode is already dcb, so i will drop the dcb mode patch. I think the scenario you mentioned still existed, and I am willing to implement it if we come to a solution that will suit most in the community. Thanks, Yunsheng Li

Re: [PATCH net-next 0/2] Add mqprio hardware offload support in hns3 driver

2017-10-15 Thread Yunsheng Lin
ions available for monitoring using dcbnl logic > if the > configuration change [for user]; So user can re-configure whatever it wants. Yes, if user is only using dcb tool. > But other than dropping all the qdisc configurations and going back to the > default > qdiscs, what default

Re: [PATCH net-next 0/2] Add mqprio hardware offload support in hns3 driver

2017-10-16 Thread Yunsheng Lin
ach underlying qdisc */ for (ntx = 0; ntx < dev->num_tx_queues; ntx++) { qdisc = priv->qdiscs[ntx]; old = dev_graft_qdisc(qdisc->dev_queue, qdisc); if (old) qdisc_destroy(old); --Only call qdisc_hash_add whe

Re: [net-next 4/9] i40e: Enable 'channel' mode in mqprio for TC configs

2017-10-16 Thread Yunsheng Lin
tdev_priv *np = netdev_priv(netdev); > struct i40e_vsi *vsi = np->vsi; > struct i40e_pf *pf = vsi->back; > - u8 enabled_tc = 0; > + u8 enabled_tc = 0, num_tc, hw; > + bool need_reset = false; > int ret = -EINVAL; > + u16 mode

[PATCH v2 net-next] net: hns3: Add mqprio hardware offload support in hns3 driver

2017-10-17 Thread Yunsheng Lin
When using tc qdisc, dcb_ops->setup_tc is used to tell hclge_dcb module to do the tm related setup. Only TC_MQPRIO_MODE_CHANNEL offload mode is supported. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- V2: 1. Add HCLGE_FLAG_MQPRIO_ENABLE to indicate offlaoding the

Re: [net-next 4/9] i40e: Enable 'channel' mode in mqprio for TC configs

2017-10-17 Thread Yunsheng Lin
Hi, Nambiar On 2017/10/17 0:03, Nambiar, Amritha wrote: > On 10/16/2017 1:53 AM, Yunsheng Lin wrote: >> Hi, Jeff >> >> On 2017/10/14 5:52, Jeff Kirsher wrote: >>> From: Amritha Nambiar <amritha.namb...@intel.com> >>> >>> The i40e driver is

Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-24 Thread Yunsheng Lin
Hi, Jiri On 2017/9/24 19:37, Jiri Pirko wrote: > Sat, Sep 23, 2017 at 02:47:20AM CEST, linyunsh...@huawei.com wrote: >> Hi, Jiri >> >> On 2017/9/23 0:03, Jiri Pirko wrote: >>> Fri, Sep 22, 2017 at 04:11:51PM CEST, linyunsh...@huawei.com wrote: Hi, Jiri >> - if (!tc) { >> + if

Re: [patch net-next v2 06/12] net: mroute: Check if rule is a default rule

2017-09-24 Thread Yunsheng Lin
Hi, Jiri On 2017/9/25 1:22, Jiri Pirko wrote: > From: Yotam Gigi > > When the ipmr starts, it adds one default FIB rule that matches all packets > and sends them to the DEFAULT (multicast) FIB table. A more complex rule > can be added by user to specify that for a specific

Re: [patch net-next v2 07/12] mlxsw: spectrum: Add the multicast routing offloading logic

2017-09-24 Thread Yunsheng Lin
Hi, Jiri On 2017/9/25 1:22, Jiri Pirko wrote: > From: Yotam Gigi > > Add the multicast router offloading logic, which is in charge of handling > the VIF and MFC notifications and translating it to the hardware logic API. > > The offloading logic has to overcome several

Re: [patch net-next v2 03/12] ipmr: Add FIB notification access functions

2017-09-24 Thread Yunsheng Lin
Hi, Jiri On 2017/9/25 1:22, Jiri Pirko wrote: > From: Yotam Gigi > > Make the ipmr module register as a FIB notifier. To do that, implement both > the ipmr_seq_read and ipmr_dump ops. > > The ipmr_seq_read op returns a sequence counter that is incremented on > every

[PATCH v3 net-next 02/10] net: hns3: Add support for dynamically buffer reallocation

2017-09-26 Thread Yunsheng Lin
parameter, and priv_buf is only used at buffer allocation process, so it is ok to use a dynamic allocated temporary memory. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 5 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH v3 net-next 07/10] net: hns3: Add hclge_dcb module for the support of DCB feature

2017-09-26 Thread Yunsheng Lin
The hclge_dcb module calls the interface from hclge_main/tm and provide interface for the dcb netlink interface. This patch also update Makefiles required to build the DCB supported code in HNS3 Ethernet driver and update the existing Kconfig file in the hisilicon folder. Signed-off-by: Yunsheng

[PATCH v3 net-next 08/10] net: hns3: Add dcb netlink interface for the support of DCB feature

2017-09-26 Thread Yunsheng Lin
This patch add dcb netlink interface by calling the interface from hclge_dcb module. This patch also update Makefile in order to build hns3_dcbnl module. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/Makefile| 2 + .../ethernet/his

[PATCH v3 net-next 09/10] net: hns3: Setting for fc_mode and dcb enable flag in TM module

2017-09-26 Thread Yunsheng Lin
After the DCB feature is supported, fc_mode and dcb enable flag must be set according to the DCB parameter. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 34 +++--- 1 file changed, 30 insertions(+), 4 del

[PATCH v3 net-next 05/10] net: hns3: Add tc-based TM support for sriov enabled port

2017-09-26 Thread Yunsheng Lin
When sriov is enabled and TM is in tc-based mode, vf's TM parameters is not set in TM initialization process. This patch add the tc_based TM support for sriov enabled using the information in vport struct. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilico

Re: [PATCH v2 net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-26 Thread Yunsheng Lin
Hi, Yuval On 2017/9/26 20:29, Yuval Mintz wrote: >> Hi, Yuval >> >> On 2017/9/26 14:43, Yuval Mintz wrote: When using tc qdisc to configure DCB parameter, dcb_ops->setup_tc is used to tell hclge_dcb module to do the setup. >>> >>> While this might be a step in the right direction, this

[PATCH v3 net-next 04/10] net: hns3: Add support for port shaper setting in TM module

2017-09-26 Thread Yunsheng Lin
This patch add a tm_port_shaper cmd and set port shaper to HCLGE_ETHER_MAX_RATE on TM initialization process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 32 ++ .../net/ethernet/hisilicon/hns3/hns3pf/hclg

[PATCH v3 net-next 10/10] net: hns3: Add DCB support when interacting with network stack

2017-09-26 Thread Yunsheng Lin
When using lldptool to configure DCB parameter, hclge_dcb module call the client_ops->setup_tc to tell network stack which queue and priority is using for specific tc. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- V2: Drop mqprio support. V1: Initi

[PATCH v3 net-next 03/10] net: hns3: Add support for PFC setting in TM module

2017-09-26 Thread Yunsheng Lin
This patch add a pfc_pause_en cmd, and use it to configure PFC option according to fc_mode in hdev->tm_info. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 68 -- .../net/ethernet/hisilicon/hns3/hns3pf/h

[PATCH v3 net-next 06/10] net: hns3: Add some interface for the support of DCB feature

2017-09-26 Thread Yunsheng Lin
This patch add some interface and export some interface from hclge_tm and hclgc_main to support the upcoming DCB feature. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 3 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h

[PATCH v3 net-next 00/10] Add support for DCB feature in hns3 driver

2017-09-26 Thread Yunsheng Lin
: Initial Submit. Yunsheng Lin (10): net: hns3: Support for dynamically assigning tx buffer to TC net: hns3: Add support for dynamically buffer reallocation net: hns3: Add support for PFC setting in TM module net: hns3: Add support for port shaper setting in TM module net: hns3: Add tc

[PATCH v3 net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC

2017-09-26 Thread Yunsheng Lin
This patch add support of dynamically assigning tx buffer to TC when the TC is enabled. It will save buffer for rx direction to avoid packet loss. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- V2: Fix for not defining variables in local loop. V1: Initial

[PATCH v2 net-next 08/10] net: hns3: Add dcb netlink interface for the support of DCB feature

2017-09-25 Thread Yunsheng Lin
This patch add dcb netlink interface by calling the interface from hclge_dcb module. This patch also update Makefile in order to build hns3_dcbnl module. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/Makefile| 2 + .../ethernet/his

[PATCH v2 net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-25 Thread Yunsheng Lin
ed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 135 + 1 file changed, 111 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon

[PATCH v2 net-next 09/10] net: hns3: Setting for fc_mode and dcb enable flag in TM module

2017-09-25 Thread Yunsheng Lin
After the DCB feature is supported, fc_mode and dcb enable flag must be set according to the DCB parameter. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 34 +++--- 1 file changed, 30 insertions(+), 4 del

[PATCH v2 net-next 05/10] net: hns3: Add tc-based TM support for sriov enabled port

2017-09-25 Thread Yunsheng Lin
When sriov is enabled and TM is in tc-based mode, vf's TM parameters is not set in TM initialization process. This patch add the tc_based TM support for sriov enabled using the information in vport struct. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilico

[PATCH v2 net-next 02/10] net: hns3: Add support for dynamically buffer reallocation

2017-09-25 Thread Yunsheng Lin
parameter, and priv_buf is only used at buffer allocation process, so it is ok to use a dynamic allocated temporary memory. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 5 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH v2 net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC

2017-09-25 Thread Yunsheng Lin
This patch add support of dynamically assigning tx buffer to TC when the TC is enabled. It will save buffer for rx direction to avoid packet loss. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- V2: Fix for not defining variables in local loop. V1: Initial

[PATCH v2 net-next 07/10] net: hns3: Add hclge_dcb module for the support of DCB feature

2017-09-25 Thread Yunsheng Lin
The hclge_dcb module calls the interface from hclge_main/tm and provide interface for the dcb netlink interface. This patch also update Makefiles required to build the DCB supported code in HNS3 Ethernet driver and update the existing Kconfig file in the hisilicon folder. Signed-off-by: Yunsheng

[PATCH v2 net-next 04/10] net: hns3: Add support for port shaper setting in TM module

2017-09-25 Thread Yunsheng Lin
This patch add a tm_port_shaper cmd and set port shaper to HCLGE_ETHER_MAX_RATE on TM initialization process. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 32 ++ .../net/ethernet/hisilicon/hns3/hns3pf/hclg

Re: [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

2017-09-30 Thread Yunsheng Lin
Hi, Christophe On 2017/9/30 13:34, Christophe JAILLET wrote: > If this sanity check fails, we must free 'rss_indir'. Otherwise there is a > memory leak. > 'goto err' as done in the other error handling paths to fix it. Thanks for fixing. > > Fixes: 46a3df9f9718 ("net: hns3: Fix for setting

Re: [PATCH] net: hns3: fix null pointer dereference before null check

2017-09-29 Thread Yunsheng Lin
Hi, Colin On 2017/9/30 3:51, Colin King wrote: > From: Colin Ian King > > pointer ndev is being dereferenced with the call to netif_running > before it is being null checked. Re-order the code to only dereference > ndev after it has been null checked. Thanks for

Re: [PATCH v2 net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-26 Thread Yunsheng Lin
Hi, Yuval On 2017/9/26 14:43, Yuval Mintz wrote: >> When using tc qdisc to configure DCB parameter, dcb_ops->setup_tc >> is used to tell hclge_dcb module to do the setup. > > While this might be a step in the right direction, this causes an > inconsistency > in user experience - Some [well,

Re: [PATCH v2 net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-26 Thread Yunsheng Lin
Hi, Yuval On 2017/9/26 14:43, Yuval Mintz wrote: >> When using tc qdisc to configure DCB parameter, dcb_ops->setup_tc >> is used to tell hclge_dcb module to do the setup. > > While this might be a step in the right direction, this causes an > inconsistency > in user experience - Some [well,

Re: [PATCH v2 net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-26 Thread Yunsheng Lin
Hi, Yuval On 2017/9/26 14:43, Yuval Mintz wrote: >> When using tc qdisc to configure DCB parameter, dcb_ops->setup_tc >> is used to tell hclge_dcb module to do the setup. > > While this might be a step in the right direction, this causes an > inconsistency > in user experience - Some [well,

[PATCH v2 net-next 03/10] net: hns3: Add support for PFC setting in TM module

2017-09-25 Thread Yunsheng Lin
This patch add a pfc_pause_en cmd, and use it to configure PFC option according to fc_mode in hdev->tm_info. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 68 -- .../net/ethernet/hisilicon/hns3/hns3pf/h

[PATCH v2 net-next 06/10] net: hns3: Add some interface for the support of DCB feature

2017-09-25 Thread Yunsheng Lin
This patch add some interface and export some interface from hclge_tm and hclgc_main to support the upcoming DCB feature. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 3 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h

[PATCH v2 net-next 00/10] Add support for DCB feature in hns3 driver

2017-09-25 Thread Yunsheng Lin
(if schedule mode is ETS), prio_tc_map and PFC parameter. --- V2: Fix for not defining variables in local loop. V1: Initial Submit. Yunsheng Lin (10): net: hns3: Support for dynamically assigning tx buffer to TC net: hns3: Add support for dynamically buffer reallocation net: hns3: Add

Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack

2017-09-25 Thread Yunsheng Lin
Hi, Jiri On 2017/9/25 14:57, Jiri Pirko wrote: > Mon, Sep 25, 2017 at 02:45:08AM CEST, linyunsh...@huawei.com wrote: >> Hi, Jiri >> >> On 2017/9/24 19:37, Jiri Pirko wrote: >>> Sat, Sep 23, 2017 at 02:47:20AM CEST, linyunsh...@huawei.com wrote: Hi, Jiri On 2017/9/23 0:03, Jiri

Re: [patch net-next v2 03/12] ipmr: Add FIB notification access functions

2017-09-25 Thread Yunsheng Lin
Hi, Yotam On 2017/9/25 13:38, Yotam Gigi wrote: > On 09/25/2017 04:19 AM, Yunsheng Lin wrote: >> Hi, Jiri >> >> On 2017/9/25 1:22, Jiri Pirko wrote: >>> From: Yotam Gigi <yot...@mellanox.com> >>> >>> Make the ipmr module register as a FIB noti

[PATCH net-next 6/7] net: hns3: Cleanup for endian issue in hns3 driver

2017-10-09 Thread Yunsheng Lin
This patch fixes a lot of endian issues detected by sparse. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 8 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 10 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH net-next 5/7] net: hns3: Cleanup for struct that used to send cmd to firmware

2017-10-09 Thread Yunsheng Lin
The hclge_tm module has already added _cmd to the end of struct that used to send cmd to firmware. This will help us finding the endian issues. This patch adds the _cmd to the end of struct that used to send cmd to firmware in hclge_main module. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.

[PATCH net-next 4/7] net: hns3: Consistently using GENMASK in hns3 driver

2017-10-09 Thread Yunsheng Lin
This patch uses GENMASK to generate bit mask whenever possible in hns3 driver. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 48 +++--- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 4 +- 2 files chang

[PATCH net-next 2/7] net: hns3: Add hns3_get_handle macro in hns3 driver

2017-10-09 Thread Yunsheng Lin
There are many places that will need to get the handle of netdev, so add a macro to get the handle of netdev. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../ethernet/hisilicon/hns3/hns3pf/hns3_dcbnl.c| 18 -- .../net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.

[PATCH net-next 7/7] net: hns3: Cleanup for non-static function in hns3 driver

2017-10-09 Thread Yunsheng Lin
This patch fixes the following warning from sparse: warning: symbol 'hns3_set_multicast_list' was not declared. Should it be static. hns3_set_multicast_list turns out to be not used, so delete it. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- .../net/ethernet/hisilicon/hns3/

[PATCH net-next 3/7] net: hns3: Cleanup indentation for Kconfig in the the hisilicon folder

2017-10-09 Thread Yunsheng Lin
This patch fixes a few indentation for Kconfig file in the hisilicon folder. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/Kconfig b/d

[PATCH net-next 0/7] A few cleanup for hns3 ethernet driver

2017-10-09 Thread Yunsheng Lin
This patchset contains a few cleanup for hns3 ethernet driver. No functional change intended. Yunsheng Lin (7): net: hns3: Cleanup for shifting true in hns3 driver net: hns3: Add hns3_get_handle macro in hns3 driver net: hns3: Cleanup indentation for Kconfig in the the hisilicon folder

[PATCH net-next 1/7] net: hns3: Cleanup for shifting true in hns3 driver

2017-10-09 Thread Yunsheng Lin
This patch fixes a shifting true in hclge_main module. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mai

[PATCH net-next 1/2] mqprio: Add a new hardware offload type in mqprio

2017-10-11 Thread Yunsheng Lin
in the network stack. This patch adds a new offload type to indicate that the underlying driver offload prio mapping as part of DCB. If the driver would be incapable of that it would refuse the offload. User would then have to explicitly request that qdisc offload. Signed-off-by: Yunsheng Lin <linyu

[PATCH net-next 0/2] Add mqprio hardware offload support in hns3 driver

2017-10-11 Thread Yunsheng Lin
This patchset adds a new hardware offload type in mqprio before adding mqprio hardware offload support in hns3 driver. Yunsheng Lin (2): mqprio: Add a new hardware offload type in mqprio net: hns3: Add mqprio hardware offload support in hns3 driver drivers/net/ethernet/hisilicon/hns3/hnae3

[PATCH net-next 2/2] net: hns3: Add mqprio hardware offload support in hns3 driver

2017-10-11 Thread Yunsheng Lin
When using tc qdisc, dcb_ops->setup_tc is used to tell hclge_dcb module to do the tm related setup. Only TC_MQPRIO_HW_OFFLOAD_DCB offload type is supported. Signed-off-by: Yunsheng Lin <linyunsh...@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 1 + .../net

Re: [PATCH net-next 0/2] Add mqprio hardware offload support in hns3 driver

2017-10-12 Thread Yunsheng Lin
ue does not have a default pfifo mqprio attached. Maybe we can add a callback to notify mqprio the configuration has changed. Thanks Yunsheng Lin > > Cheers, > Yuval > >> >> Yunsheng Lin (2): >> mqprio: Add a new hardware offload type in mqprio >> net: hns3:

Re: [PATCH net-next 1/2] mqprio: Add a new hardware offload type in mqprio

2017-10-12 Thread Yunsheng Lin
Hi, Yuval On 2017/10/13 4:10, Yuval Mintz wrote: >> When a driver supports both dcb and hardware offloaded mqprio, and >> user is running mqprio and dcb tool concurrently, the configuration >> set by each tool may be conflicted with each other because the dcb > (for second 'each') s/each/the >

[QUESTION] Doubt about NAPI_GRO_CB(skb)->is_atomic in tcpv4 gro process

2017-12-20 Thread Yunsheng Lin
Hi, all I have some doubt about NAPI_GRO_CB(skb)->is_atomic when analyzing the tcpv4 gro process: Firstly we set NAPI_GRO_CB(skb)->is_atomic to 1 in dev_gro_receive: https://elixir.free-electrons.com/linux/v4.15-rc4/source/net/core/dev.c#L4838 And then in inet_gro_receive, we check the

Re: [PATCH net-next 3/9] net: hns3: Refactor the initialization of command queue

2017-11-01 Thread Yunsheng Lin
Hi, Lipeng On 2017/11/1 22:47, Lipeng wrote: > From: qumingguang > > There is no necessary to reallocate the descriptor and remap the descriptor > memory in reset process, But there is still some other action exit in both exit -> exist > reset process and

Re: [QUESTION] Doubt about NAPI_GRO_CB(skb)->is_atomic in tcpv4 gro process

2017-12-21 Thread Yunsheng Lin
Hi, Alexander On 2017/12/21 0:24, Alexander Duyck wrote: > On Wed, Dec 20, 2017 at 1:09 AM, Yunsheng Lin <linyunsh...@huawei.com> wrote: >> Hi, all >> I have some doubt about NAPI_GRO_CB(skb)->is_atomic when >> analyzing the tcpv4 gro process: >&g

  1   2   >