From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C6A512BB5 for ; Wed, 24 Feb 2016 11:43:53 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 24 Feb 2016 02:43:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,493,1449561600"; d="scan'208";a="658458808" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by FMSMGA003.fm.intel.com with ESMTP; 24 Feb 2016 02:43:53 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 24 Feb 2016 10:43:51 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.237]) by irsmsx155.ger.corp.intel.com ([169.254.14.201]) with mapi id 14.03.0248.002; Wed, 24 Feb 2016 10:43:51 +0000 From: "Ananyev, Konstantin" To: "Horton, Remy" , "Zhang, Helin" , "Xie, Huawei" Thread-Topic: [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions Thread-Index: AQHRbd79Hl2/3mSS8k2jP+V0izOLL587AZAAgAACqyA= Date: Wed, 24 Feb 2016 10:43:50 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B0AB29@irsmsx105.ger.corp.intel.com> References: <1453970895-2639-1-git-send-email-remy.horton@intel.com> <1453970895-2639-2-git-send-email-remy.horton@intel.com> <56CD86BA.7040702@intel.com> In-Reply-To: <56CD86BA.7040702@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDAxZDVjNDItMTA0Yi00ZDE4LWJhYjQtODJkNmE1MzE3ZjliIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImhEK3Z0R1ZtQnlSZXI5allHbEFYVEZLNVhQRThPendBZ1dUQndXNlwvcmhzPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 10:43:54 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton > Sent: Wednesday, February 24, 2016 10:32 AM > To: Zhang, Helin; Xie, Huawei > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev funct= ions >=20 > Comments inline. >=20 > ..Remy >=20 > On 23/02/2016 02:06, Zhang, Helin wrote: > > > >> +static inline int > >> +i40e_read_regs(struct i40e_hw *hw, const struct reg_info *reg, > >> + uint32_t *reg_buf) > >> +{ > >> + unsigned int i; > >> + > >> + for (i =3D 0; i < reg->count; i++) > >> + reg_buf[i] =3D I40E_READ_REG(hw, > >> + reg->base_addr + i * reg->stride); > >> + return reg->count; > >> +} > > From FVL5, some registers should be read by AQ commands, otherwise > it may fail to > > read without any warning. > > Please see my patches of which registers should be read by AQ commands= . > > Please check i40e_osdep.h from below link. Thanks! > > http://www.dpdk.org/dev/patchwork/patch/10654/ >=20 > Ok - will change for v2. >=20 > I noticed that other patches in the same patchset expose extra registers > - are these new or were they simply not exposed previously? >=20 >=20 > >> + /* Only support doing full dump */ > >> + if (regs->offset !=3D 0 && 0) > > '&& 0' means it will never be false, right? > > Anything wrong here? >=20 > Oops - some dead code that slipped through.. :) >=20 >=20 > >> + return -ENOTSUP; > > A message before this return to tell the uers what happened would be > better. >=20 > Will add these into v2. >=20 >=20 > >> +static int i40e_get_eeprom_length(__rte_unused struct rte_eth_dev *d= ev) > > Why needs __rte_unused? >=20 > Good point - surprised the compiler did not complain about them, as they > are not supposed to be there.. >=20 >=20 > >> +static void i40e_set_default_mac_addr(struct rte_eth_dev *dev, > >> + struct ether_addr *mac_addr) > >> +{ > >> + struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > >>> dev_private); > >> + > >> + /* Flags: 0x3 updates port address */ > >> + i40e_aq_mac_address_write(hw, 0x3, mac_addr->addr_bytes, > >> NULL); } > > Checks are needed before writing the MAC address. >=20 > Will look into this. >=20 >=20 > >> +struct reg_info { > >> + uint32_t base_addr; > >> + uint32_t count; > >> + uint32_t stride; > >> + const char *name; > >> +} reg_info; > > I think array definition shouldn't be added into a header file, > otherwise any .c source > > file which includes that header file will define that. >=20 > Since it is quite a large table I think this approach, which is also > used in ixgbe, is the lesser of evils. i40e_ethdev.c itself is already > pretty big, and would prefer to avoid giving a driver-specific table > non-static visibility until it actually has to be used from other > compilation units. Why not to have a separate .h file, specially for registers table definitio= n?