Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737478

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

From Jiri Pirko <jiri@resnulli.us>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack
Date 2017-09-22 15:00 +0200
Message-ID <usvIJ-6c6-3@gated-at.bofh.it> (permalink)
References <us7Q5-kv-3@gated-at.bofh.it> <us7Q7-kv-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Thu, Sep 21, 2017 at 01:21:53PM CEST, linyunsheng@huawei.com wrote:
>When using tc qdisc to configure DCB parameter, dcb_ops->setup_tc
>is used to tell hclge_dcb module to do the setup.
>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 <linyunsheng@huawei.com>

[...]
	
	
	
>-static int hns3_setup_tc(struct net_device *netdev, u8 tc)
>+static int hns3_setup_tc(struct net_device *netdev, u8 tc, u8 *prio_tc)
> {
> 	struct hns3_nic_priv *priv = netdev_priv(netdev);
> 	struct hnae3_handle *h = priv->ae_handle;
> 	struct hnae3_knic_private_info *kinfo = &h->kinfo;
>+	bool if_running = netif_running(netdev);
> 	unsigned int i;
> 	int ret;
> 
> 	if (tc > HNAE3_MAX_TC)
> 		return -EINVAL;
> 
>-	if (kinfo->num_tc == tc)
>-		return 0;
>-
> 	if (!netdev)
> 		return -EINVAL;
> 
>-	if (!tc) {
>+	if (if_running) {
>+		(void)hns3_nic_net_stop(netdev);
>+		msleep(100);
>+	}
>+
>+	ret = (kinfo->dcb_ops && kinfo->dcb_ops->setup_tc) ?
>+		kinfo->dcb_ops->setup_tc(h, tc, prio_tc) : -EOPNOTSUPP;

This is most odd. Why do you call dcb_ops from ndo_setup_tc callback?
Why are you mixing this together? prio->tc mapping can be done
directly in dcbnl

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/10] Add support for DCB feature in hns3 driver Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
  [PATCH net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
    Re: [PATCH net-next 01/10] net: hns3: Support for dynamically  assigning tx buffer to TC David Miller <davem@davemloft.net> - 2017-09-22 03:50 +0200
      Re: [PATCH net-next 01/10] net: hns3: Support for dynamically  assigning tx buffer to TC Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-22 04:00 +0200
        Re: [PATCH net-next 01/10] net: hns3: Support for dynamically  assigning tx buffer to TC David Miller <davem@davemloft.net> - 2017-09-22 05:50 +0200
  [PATCH net-next 02/10] net: hns3: Add support for dynamically buffer reallocation Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
  [PATCH net-next 06/10] net: hns3: Add some interface for the support of DCB feature Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
  [PATCH net-next 09/10] net: hns3: Setting for fc_mode and dcb enable flag in TM module Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
  [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200
    Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Jiri Pirko <jiri@resnulli.us> - 2017-09-22 15:00 +0200
      Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Jiri Pirko <jiri@resnulli.us> - 2017-09-22 18:10 +0200
        Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-23 02:50 +0200
          Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Jiri Pirko <jiri@resnulli.us> - 2017-09-24 13:40 +0200
            Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-25 02:50 +0200
              Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Jiri Pirko <jiri@resnulli.us> - 2017-09-25 09:00 +0200
                Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when  interacting with network stack Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-25 09:30 +0200
  [PATCH net-next 08/10] net: hns3: Add dcb netlink interface for the support of DCB feature Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-21 13:30 +0200

csiph-web