lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170922125541.GA2005@nanopsycho.orion>
Date:   Fri, 22 Sep 2017 14:55:41 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Yunsheng Lin <linyunsheng@...wei.com>
Cc:     davem@...emloft.net, huangdaode@...ilicon.com,
        xuwei5@...ilicon.com, liguozhu@...ilicon.com,
        Yisen.Zhuang@...wei.com, gabriele.paoloni@...wei.com,
        john.garry@...wei.com, linuxarm@...wei.com, salil.mehta@...wei.com,
        lipeng321@...wei.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 10/10] net: hns3: Add mqprio support when
 interacting with network stack

Thu, Sep 21, 2017 at 01:21:53PM CEST, linyunsheng@...wei.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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ