Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754406AbdFNIE0 (ORCPT ); Wed, 14 Jun 2017 04:04:26 -0400 Received: from mail-cys01nam02on0040.outbound.protection.outlook.com ([104.47.37.40]:13760 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751821AbdFNIEU (ORCPT ); Wed, 14 Jun 2017 04:04:20 -0400 From: "Mintz, Yuval" To: Salil Mehta , "davem@davemloft.net" CC: "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: RE: [PATCH net-next 1/9] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Thread-Topic: [PATCH net-next 1/9] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Thread-Index: AQHS4ZylAUR/9UEISEenwnHcN46eG6IeAvvAgAUJGQCAAPlbEA== Date: Wed, 14 Jun 2017 08:04:17 +0000 Message-ID: References: <20170610034630.493852-1-salil.mehta@huawei.com> <20170610034630.493852-2-salil.mehta@huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=cavium.com; x-originating-ip: [31.168.140.228] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BLUPR0701MB2004;7:v645gZVze3p63TR15+ig+N7VvEy65q9HC/7wdOjEoEnRIpg05VF6/6j+y10msbLaHVcHR5wESNhWY1aqIyk647rUHJLDqsfrUWHKMVTuCpGYzKTH4MxMlY2uegzt3qpjl/P0IJUUxwd3E6Q2pWEBddkTIM9l1jnlSFJilfgHYF44FVb7ZEIuPkR9xNHnEMRCgp8gosamvIt32pjrAiTCvAAoGDySOrS3OnpeMLsfdTwybi+4rRlUHSDvbl5eQJxgH2MsMFlU9kx2jcftf/cWxg+qhCu58z/rWPwxf/gvGhOovZ6aYhuq1DGE4LJ+sZeDMz1kQ8m6YfqPXeRPd3wpzw== x-ms-traffictypediagnostic: BLUPR0701MB2004: x-ms-office365-filtering-correlation-id: db937fa8-4639-458d-0f46-08d4b2fbf4d7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075);SRVR:BLUPR0701MB2004; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BLUPR0701MB2004;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BLUPR0701MB2004; x-forefront-prvs: 033857D0BD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39840400002)(39400400002)(39410400002)(39450400003)(305945005)(81166006)(7736002)(38730400002)(2501003)(3846002)(7696004)(74316002)(6116002)(478600001)(102836003)(122556002)(229853002)(8676002)(86362001)(2906002)(6436002)(2900100001)(14454004)(8936002)(77096006)(5660300001)(6506006)(4326008)(6246003)(25786009)(54906002)(66066001)(3280700002)(33656002)(99286003)(189998001)(39060400002)(53936002)(9686003)(72206003)(54356999)(50986999)(93886004)(76176999)(55016002)(2950100002)(3660700001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB2004;H:BLUPR0701MB2004.namprd07.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2017 08:04:17.8946 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2004 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5E84VKB021240 Content-Length: 1617 Lines: 50 > > > +static void hns3_nic_net_down(struct net_device *ndev) { > > > + struct hns3_nic_priv *priv = netdev_priv(ndev); > > > + struct hnae3_ae_ops *ops; > > > + int i; > > > + > > > + netif_tx_stop_all_queues(ndev); > > > + netif_carrier_off(ndev); > > > + netif_tx_disable(ndev); > > > + > > > + ops = priv->ae_handle->ae_algo->ops; > > > + > > > + if (ops->stop) > > > + ops->stop(priv->ae_handle); > > > + > > > + netif_tx_stop_all_queues(ndev); > > > > Looks a bit excessive. Why do you need all these > > netif_tx_stop_all_queues()? > If we are disabling the netdev. We need to stop scheduling the queues > associated with that netdev for TX, so we need this code. Why do you think > it is excessive? Why do you need both netif_tx_disable() and netif_tx_stop_all_queues()? And why would you need to re-do netif_tx_stop_all_queues() after calling ops->stop()? > > Isn't mqprio going to override your priority2tc mapping with the one > > provided by user? > I guess you are referring to below code in the mqprio_init() - right? > > static int mqprio_init(struct Qdisc *sch, struct nlattr *opt) > { > [...] > /* Always use supplied priority mappings */ > for (i = 0; i < TC_BITMASK + 1; i++) > netdev_set_prio_tc_map(dev, i, qopt->prio_tc_map[i]); > [...] > } > > In this case yes, you are right below code seems to be redundant: > > + /* Assign UP2TC map for the VSI */ > + for (i = 0; i < HNAE3_MAX_TC; i++) { > + netdev_set_prio_tc_map(ndev, > + kinfo->tc_info[i].up, > + kinfo->tc_info[i].tc); > > Hope I am not missing anything here? You're not; That's what I meant.