From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by dpdk.org (Postfix) with ESMTP id A40255686 for ; Wed, 14 Jan 2015 13:41:07 +0100 (CET) Received: by mail-wi0-f181.google.com with SMTP id hi2so10546765wib.2 for ; Wed, 14 Jan 2015 04:41:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=Q+6+FbY2x0j3OY1CUdGiDvzC4j6/zwvomBFcalht9u4=; b=nFZMWPtzRzzzkDRXEoMGOSR5JaFM3zwaVtUfS5LU/2oyA8o5FpCjO07HMX/cVSGpVb Nom6F+LZCAUV4Xp8RjZCvaEhSNEVhdc7y+EQpZPC0VrrQZYeOtiWI+W3R/FNvTF3UW0m 36vrPB5PBClF5zpXjiOPk8llX9Od1Xmw/vmC0l2Acv6YCklYZL419nYtJhkmFJam7wz0 5gY7U4lXY5Q67xhaGNmlJ8VPRUH/a9n/SIdLyaramSbqbJbaZ1fVN7KD30EYC4Sx8ka6 MTBVH7Wscb/PeOV0kuVcm/eqzCn9gVHRHe+yXnax1chBC7RGxyU6tKt6BjUJKzcfPUT2 EiKg== X-Gm-Message-State: ALoCoQmkzVYgS5LN9QW0YdjkF1g59gPosMAlDQGxFOQdj9GWiyEDWGeeIrJPgThh/UL3ErEvorGx X-Received: by 10.181.13.42 with SMTP id ev10mr8192764wid.78.1421239267381; Wed, 14 Jan 2015 04:41:07 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id fm10sm3223794wib.7.2015.01.14.04.41.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 04:41:06 -0800 (PST) From: Thomas Monjalon To: "Marc E. Cooper" Date: Wed, 14 Jan 2015 13:40:44 +0100 Message-ID: <2270936.iNpNn7VcXy@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.6-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Port link speed and link duplex always set to auto-negotiate & manual link speed configuration of 100Mb link speed not possible 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, 14 Jan 2015 12:41:08 -0000 Hi Mark, Thanks for the report and the patch. Unfortunately, there is still no review. I believe 2 things could help to go further here: 1) your fix need to be sent in the format described here: =09http://dpdk.org/dev#send 2) a maintainer of e1000 PMD should be identified 2015-01-08 16:26, Marc E. Cooper: > I believe there are defects in the code supporting manual configurati= on of > port link speed and link duplex to values other than auto-negotiate. = The > TESTPMD application from DPDK version 1.8.0 was executed on 2 differe= nt > systems having 4x1G NICs with the following Ethernet controllers: >=20 > * Intel Corporation 82576 Gigabit Network Connection (rev 01) > * Intel Corporation I350 Gigabit Network Connection (rev 01) >=20 > There appears to be two issues in the code: >=20 > * "hw->mac.autoneg=B2 is always set to true (1). The force speed and= duplex > code path is not followed. > * "hw->mac.forced_speed_duplex" is never set. A forced link speed > configuration will always default to 10Mb regardless of whether confi= gured > for 100Mb or 10Mb. For example, e1000_phy_force_speed_duplex_setup()= will > always configure link speed to 10mb since it checks for the following= > condition "if (mac->forced_speed_duplex & E1000_ALL_100_SPEED)=B2. >=20 > Changes are needed within =B3igb_ethdev.c=B2 and =B3em_ethdev.c=B2 wi= thin > =B3lib/librte_pmd_e1000=B2. The switch statements that setup link sp= eed and > link duplex within these files need to manually set "hw->mac.autoneg"= and > "hw->mac.forced_speed_duplex" as shown below: >=20 > [root@box librte_pmd_e1000]# pwd > /home/marc/dpdk/dpdk-1.8.0/lib/librte_pmd_e1000 > [root@box librte_pmd_e1000]# diff -p igb_ethdev.c.orig igb_ethdev.c > *** igb_ethdev.c.orig=092015-01-08 09:59:52.937215791 -0500 > --- igb_ethdev.c=092015-01-08 10:01:44.073730592 -0500 > *************** eth_igb_start(struct rte_eth_dev *dev) > *** 871,876 **** > --- 871,878 ---- > =09=09=09hw->phy.autoneg_advertised =3D ADVERTISE_10_FULL; > =09=09else > =09=09=09goto error_invalid_config; > + hw->mac.autoneg =3D 0; > + hw->mac.forced_speed_duplex |=3D hw->phy.autoneg_adve= rtised; > =09=09break; > =09case ETH_LINK_SPEED_100: > =09=09if (dev->data->dev_conf.link_duplex =3D=3D ETH_LINK_AUTONEG_D= UPLEX) > *************** eth_igb_start(struct rte_eth_dev *dev) > *** 881,886 **** > --- 883,890 ---- > =09=09=09hw->phy.autoneg_advertised =3D ADVERTISE_100_FULL; > =09=09else > =09=09=09goto error_invalid_config; > + hw->mac.autoneg =3D 0; > + hw->mac.forced_speed_duplex |=3D hw->phy.autoneg_adve= rtised; > =09=09break; > =09case ETH_LINK_SPEED_1000: > =09=09if ((dev->data->dev_conf.link_duplex =3D=3D ETH_LINK_AUTONEG_= DUPLEX) || > *************** eth_igb_start(struct rte_eth_dev *dev) > *** 888,893 **** > --- 892,899 ---- > =09=09=09hw->phy.autoneg_advertised =3D ADVERTISE_1000_FULL; > =09=09else > =09=09=09goto error_invalid_config; > + hw->mac.autoneg =3D 0; > + hw->mac.forced_speed_duplex |=3D hw->phy.autoneg_adve= rtised; > =09=09break; > =09case ETH_LINK_SPEED_10000: > =09default: > [root@box librte_pmd_e1000]# >=20 >=20 > After only setting hw->mac.autoneg =3D 0 in the switch statement case= s > described above I experimented with configuring the peer (switch) por= ts > for 100Mb full duplex. Within TESTPMD the ports were also configured= for > 100Mb full duplex using =B3port config all speed 100 duplex full=B2. = The > links failed to establish. I enabled debug statements within > =B3e1000_phy_force_speed_duplex_setup()=B2 found in > =B3lib/librte_pmd_e1000/e1000/e1000_phy.c=B2 to display whether 100mb= or 10mb > was being forced. It was observed that 10Mb was being forced when th= e > link speed was manually configured for 100Mb. Setting > =B3hw->mac.force_speed_duplex=B2 as shown above seemed to resolve thi= s issue > and the links came up. > =20 >=20 > Are these known issues? >=20 > -Marc