From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7D3BCFE5 for ; Wed, 2 Nov 2016 18:36:31 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 02 Nov 2016 10:36:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="1062982524" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by fmsmga001.fm.intel.com with ESMTP; 02 Nov 2016 10:36:30 -0700 To: Ananda Sathyanarayana , wenzhuo.lu@intel.com References: <1478040424-102624-1-git-send-email-ananda@versa-networks.com> From: Ferruh Yigit Message-ID: <373b7081-1e76-f4b9-834b-8ed2ff0efc6d@intel.com> Date: Wed, 2 Nov 2016 17:36:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478040424-102624-1-git-send-email-ananda@versa-networks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] E1000: fix for forced speed/duplex config 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, 02 Nov 2016 17:36:31 -0000 Hi Ananda, Thank you for the patch. Can you please take care a few minor issues? Patch tag should be: "net/e1000:", so patch title becomes: "net/e1000: fix for forced speed/duplex config" On 11/1/2016 10:47 PM, Ananda Sathyanarayana wrote: > From the code, it looks like, hw->mac.autoneg, variable is used to > switch between calling either autoneg function or forcing > speed/duplex function. But this variable is not modified in > eth_em_start/eth_igb_start routines (it is always set to 1) > even while forcing the link speed. > > Following discussion thread has some more information on > this > > http://dpdk.org/ml/archives/dev/2016-October/049272.html Requires a fixes line: http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body > > Signed-off-by: Ananda Sathyanarayana You can keep Wenzhuo's ack for next version of the patch. Acked-by: Wenzhuo Lu > --- > drivers/net/e1000/em_ethdev.c | 16 ++++++++++++++-- > drivers/net/e1000/igb_ethdev.c | 16 ++++++++++++++-- > 2 files changed, 28 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c > index 7cf5f0c..a2412f5 100644 > --- a/drivers/net/e1000/em_ethdev.c > +++ b/drivers/net/e1000/em_ethdev.c > @@ -639,6 +639,7 @@ eth_em_start(struct rte_eth_dev *dev) > speeds = &dev->data->dev_conf.link_speeds; > if (*speeds == ETH_LINK_SPEED_AUTONEG) { > hw->phy.autoneg_advertised = E1000_ALL_SPEED_DUPLEX; > + hw->mac.autoneg = 1; checkpatch gives many whitespace errors. >>From coding style document: "Global whitespace rule in DPDK, use tabs for indentation, spaces for alignment." And how to use checkpatch: http://dpdk.org/doc/guides/contributing/patches.html#checking-the-patches > } else { > num_speeds = 0; > autoneg = (*speeds & ETH_LINK_SPEED_FIXED) == 0; > @@ -672,9 +673,20 @@ eth_em_start(struct rte_eth_dev *dev) > hw->phy.autoneg_advertised |= ADVERTISE_1000_FULL; > num_speeds++; > } > - if (num_speeds == 0 || (!autoneg && (num_speeds > 1))) > + if (num_speeds == 0 || (!autoneg && (num_speeds > 1))) { No need to update this line, dpdk coding style doesn't require parenthesis for single line statement: http://dpdk.org/doc/guides/contributing/coding_style.html#control-statements-and-loops > goto error_invalid_config; > - } > + } > + /* > + * Set/reset the mac.autoneg based on the link speed, > + * fixed or not > + */ > + if (!autoneg) { > + hw->mac.autoneg = 0; > + hw->mac.forced_speed_duplex = hw->phy.autoneg_advertised; This line over 80 character limit. > + } else { > + hw->mac.autoneg = 1; > + } > + } > > e1000_setup_link(hw); > > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c Same comments valid for this file too. Thanks, ferruh