From: Jiri Pirko <jiri@resnulli.us>
To: Yunsheng Lin <linyunsheng@huawei.com>
Cc: davem@davemloft.net, huangdaode@hisilicon.com,
xuwei5@hisilicon.com, liguozhu@hisilicon.com,
Yisen.Zhuang@huawei.com, gabriele.paoloni@huawei.com,
john.garry@huawei.com, linuxarm@huawei.com,
salil.mehta@huawei.com, lipeng321@huawei.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack
Date: Fri, 22 Sep 2017 14:55:41 +0200 [thread overview]
Message-ID: <20170922125541.GA2005@nanopsycho.orion> (raw)
In-Reply-To: <1505992913-107256-11-git-send-email-linyunsheng@huawei.com>
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
next prev parent reply other threads:[~2017-09-22 12:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 11:21 [PATCH net-next 00/10] Add support for DCB feature in hns3 driver Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 01/10] net: hns3: Support for dynamically assigning tx buffer to TC Yunsheng Lin
2017-09-22 1:41 ` David Miller
2017-09-22 1:57 ` Yunsheng Lin
2017-09-22 3:43 ` David Miller
2017-09-21 11:21 ` [PATCH net-next 02/10] net: hns3: Add support for dynamically buffer reallocation Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 03/10] net: hns3: Add support for PFC setting in TM module Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 04/10] net: hns3: Add support for port shaper " Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 05/10] net: hns3: Add tc-based TM support for sriov enabled port Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 06/10] net: hns3: Add some interface for the support of DCB feature Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 07/10] net: hns3: Add hclge_dcb module " Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 08/10] net: hns3: Add dcb netlink interface " Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 09/10] net: hns3: Setting for fc_mode and dcb enable flag in TM module Yunsheng Lin
2017-09-21 11:21 ` [PATCH net-next 10/10] net: hns3: Add mqprio support when interacting with network stack Yunsheng Lin
2017-09-22 12:55 ` Jiri Pirko [this message]
[not found] ` <59c51a37.a1c4df0a.ac4e2.8df0SMTPIN_ADDED_BROKEN@mx.google.com>
2017-09-22 16:03 ` Jiri Pirko
2017-09-23 0:47 ` Yunsheng Lin
2017-09-24 11:37 ` Jiri Pirko
2017-09-25 0:45 ` Yunsheng Lin
2017-09-25 6:57 ` Jiri Pirko
2017-09-25 7:22 ` Yunsheng Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170922125541.GA2005@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=Yisen.Zhuang@huawei.com \
--cc=davem@davemloft.net \
--cc=gabriele.paoloni@huawei.com \
--cc=huangdaode@hisilicon.com \
--cc=john.garry@huawei.com \
--cc=liguozhu@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=linyunsheng@huawei.com \
--cc=lipeng321@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=xuwei5@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox