Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbdG0UrK (ORCPT ); Thu, 27 Jul 2017 16:47:10 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:32396 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbdG0UrI (ORCPT ); Thu, 27 Jul 2017 16:47:08 -0400 From: Salil Mehta To: Florian Fainelli , "davem@davemloft.net" CC: "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Linuxarm Subject: RE: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Thread-Topic: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Thread-Index: AQHTAzeG7c9B5JjSK0qDUDvf4rqa46Jhg68AgAZ5MnD//+DagIAATnAg Date: Thu, 27 Jul 2017 20:46:29 +0000 Message-ID: References: <20170722220942.78852-1-salil.mehta@huawei.com> <20170722220942.78852-8-salil.mehta@huawei.com> <23ddbe00-8bef-a09b-5783-3a5438086bd6@gmail.com> <0fa12c08-8d20-5bb2-5e56-c083c57922e2@gmail.com> In-Reply-To: <0fa12c08-8d20-5bb2-5e56-c083c57922e2@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.161] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.597A512D.0007,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.170, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b93c1fa63844e3e748179b9cc9b1f3f6 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 base64 to 8bit by nfs id v6RKlGmu015151 Content-Length: 3650 Lines: 107 Hi Florian, > -----Original Message----- > From: Florian Fainelli [mailto:f.fainelli@gmail.com] > Sent: Thursday, July 27, 2017 7:05 PM > 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; linux-rdma@vger.kernel.org; Linuxarm > Subject: Re: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support to > HNS3 driver > > On 07/27/2017 11:01 AM, Salil Mehta wrote: > > Hi Florian, > > > >> -----Original Message----- > >> From: Florian Fainelli [mailto:f.fainelli@gmail.com] > >> Sent: Sunday, July 23, 2017 6:05 PM > >> 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; linux-rdma@vger.kernel.org; Linuxarm > >> Subject: Re: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support > to > >> HNS3 driver > >> > >> > >> > >> On 07/22/2017 03:09 PM, Salil Mehta wrote: > >>> This patch adds the support of the Ethtool interface to > >>> the HNS3 Ethernet driver. Various commands to read the > >>> statistics, configure the offloading, loopback selftest etc. > >>> are supported. > >>> > >>> Signed-off-by: Daode Huang > >>> Signed-off-by: lipeng > >>> Signed-off-by: Salil Mehta > >>> Signed-off-by: Yisen Zhuang > >>> --- > >>> Patch V4: addressed below comments > >>> 1. Andrew Lunn > >>> Removed the support of loop PHY back for now > >>> Patch V3: Address below comments > >>> 1. Stephen Hemminger > >>> https://lkml.org/lkml/2017/6/13/974 > >>> 2. Andrew Lunn > >>> https://lkml.org/lkml/2017/6/13/1037 > >>> Patch V2: No change > >>> Patch V1: Initial Submit > >>> --- > >>> .../ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 543 > >> +++++++++++++++++++++ > >>> 1 file changed, 543 insertions(+) > >>> create mode 100644 > >> drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c > >>> > >>> diff --git > >> a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c > >> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c > >>> new file mode 100644 > >>> index 000000000000..82b0d4d829f8 > >>> --- /dev/null > >>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c > >>> @@ -0,0 +1,543 @@ > >>> +/* > >>> + * Copyright (c) 2016~2017 Hisilicon Limited. > >>> + * > >>> + * This program is free software; you can redistribute it and/or > >> modify > >>> + * it under the terms of the GNU General Public License as > published > >> by > >>> + * the Free Software Foundation; either version 2 of the License, > or > >>> + * (at your option) any later version. > >>> + */ > >>> + > >>> +#include > >>> +#include "hns3_enet.h" > >>> + > >>> +struct hns3_stats { > >>> + char stats_string[ETH_GSTRING_LEN]; > >>> + int stats_size; > >>> + int stats_offset; > >>> +}; > >>> + > >>> +/* netdev related stats */ > >>> +#define HNS3_NETDEV_STAT(_string, _member) \ > >>> + { _string, \ > >>> + FIELD_SIZEOF(struct rtnl_link_stats64, _member), \ > >>> + offsetof(struct rtnl_link_stats64, _member), \ > >>> + } > >> > >> Can you make this macro use named initializers? > > Can you please explain bit more or point out some > > example. This would be very handy. > > .stat_string = _string, > .stats_size = FIELD_SIZEOF(struct rtnl_link_stat64, _member), > .stats_offset = offsetof(struct rtnl_link_stats64, _member), > > https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html Ok got it, thanks! > -- > Florian