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 E3D712BF2 for ; Tue, 29 Mar 2016 08:18:36 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 28 Mar 2016 23:18:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,409,1455004800"; d="scan'208";a="933669861" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 28 Mar 2016 23:18:35 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 28 Mar 2016 23:18:35 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 28 Mar 2016 23:18:34 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Tue, 29 Mar 2016 14:18:33 +0800 From: "Xing, Beilei" To: Marc Sune , Thomas Monjalon , "Xu, Qian Q" , "dev@dpdk.org" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Richardson, Bruce" , "Glynn, Michael J" Thread-Topic: [PATCH v13 6/8] ethdev: redesign link speed config Thread-Index: AQHRhv7FAGMl0PYThkewrz6ERZN6a59v9nYg Date: Tue, 29 Mar 2016 06:18:32 +0000 Message-ID: <94479800C636CB44BD422CB454846E01332447@SHSMSX101.ccr.corp.intel.com> References: <1458934950-23333-1-git-send-email-thomas.monjalon@6wind.com> <1458955640-22951-1-git-send-email-marcdevel@gmail.com> <1458955640-22951-7-git-send-email-marcdevel@gmail.com> In-Reply-To: <1458955640-22951-7-git-send-email-marcdevel@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v13 6/8] ethdev: redesign link speed 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: Tue, 29 Mar 2016 06:18:37 -0000 > -----Original Message----- > From: Marc Sune [mailto:marcdevel@gmail.com] > Sent: Saturday, March 26, 2016 9:27 AM > To: Thomas Monjalon ; Xu, Qian Q > ; Xing, Beilei ; dev@dpdk.org= ; > Ananyev, Konstantin ; Lu, Wenzhuo > ; Richardson, Bruce ; > Glynn, Michael J > Cc: Marc Sune > Subject: [PATCH v13 6/8] ethdev: redesign link speed config >=20 > a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c > index a98e8eb..6cc2da0 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -2193,32 +2195,21 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > if (err) > goto error; >=20 > + speed =3D 0x0; > + if (*link_speeds & ETH_LINK_SPEED_10G) > + speed |=3D IXGBE_LINK_SPEED_10GB_FULL; > + if (*link_speeds & ETH_LINK_SPEED_1G) > + speed |=3D IXGBE_LINK_SPEED_1GB_FULL; > + if (*link_speeds & ETH_LINK_SPEED_100M) > + speed |=3D IXGBE_LINK_SPEED_100_FULL; > + > err =3D ixgbe_setup_link(hw, speed, link_up); > if (err) > goto error; Hi Marc, According to ixgbe HW, link speed shouldn't be 0 when setting up,=20 Otherwise device will start fail. So we need to set speed if link_speed=20 is ETH_LINK_SPEED_AUTONEG. Following code is for reference. speed =3D 0x0; if ((*link_speeds & 0x1) =3D=3D ETH_LINK_SPEED_AUTONEG) speed =3D (hw->mac.type !=3D ixgbe_mac_82598EB) ? IXGBE_LINK_SPEED_82599_AUTONEG : IXGBE_LINK_SPEED_82598_AUTONEG; else { if (*link_speeds & ETH_LINK_SPEED_10G) speed |=3D IXGBE_LINK_SPEED_10GB_FULL; if (*link_speeds & ETH_LINK_SPEED_1G) speed |=3D IXGBE_LINK_SPEED_1GB_FULL; if (*link_speeds & ETH_LINK_SPEED_100M) speed |=3D IXGBE_LINK_SPEED_100_FULL; } Beilei Xing Thanks