From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 890E83253 for ; Mon, 17 Jul 2017 18:14:28 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id 15AA66009F; Mon, 17 Jul 2017 16:14:28 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx4-us3.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 836AA60049; Mon, 17 Jul 2017 16:14:26 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx4-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 2CFA98008C; Mon, 17 Jul 2017 16:14:26 +0000 (UTC) Received: from [192.168.239.128] (85.187.13.33) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 17 Jul 2017 17:14:21 +0100 To: Stephen Hemminger CC: , Stephen Hemminger , "Thomas Monjalon" References: <20170714183027.16021-1-stephen@networkplumber.org> <20170714183027.16021-3-stephen@networkplumber.org> <20170717090122.18655a27@xeon-e3> From: Andrew Rybchenko Message-ID: <0a1a1f6d-1fef-5a9b-bf80-822aeb2123f0@solarflare.com> Date: Mon, 17 Jul 2017 19:14:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170717090122.18655a27@xeon-e3> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [85.187.13.33] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23200.003 X-TM-AS-Result: No--9.747300-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1500308066-tUu+TaR+hLoU Subject: Re: [dpdk-dev] ***Spam*** Re: [RFC 02/14] virtio: use eth_link_read/write (and bug fix) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 16:14:28 -0000 On 07/17/2017 07:01 PM, Stephen Hemminger wrote: > On Sun, 16 Jul 2017 15:33:26 +0300 > Andrew Rybchenko wrote: > >>> + link.link_autoneg = ETH_LINK_SPEED_FIXED; >> As I understand link_autoneg is 1 bit field with boolean semantics. I.e. 0/false - no autoneg, 1/true - autoneg. >> It looks like it has wrong comment: >> uint16_t link_autoneg : 1; /**< ETH_LINK_SPEED_[AUTONEG/FIXED] */ >> >> since >> #define ETH_LINK_SPEED_AUTONEG (0 << 0) /**< Autonegotiate (all speeds) */ >> #define ETH_LINK_SPEED_FIXED (1 << 0) /**< Disable autoneg (fixed speed) */ >> >> whereas >> #define ETH_LINK_FIXED 0 /**< No autonegotiation. */ >> #define ETH_LINK_AUTONEG 1 /**< Autonegotiated. */ >> >> In general this attempt to introduce bug is the result of wrong comment which is caused by very similar >> defines with opposite values. > Orignal observation was because some drivers (vmxnet3) were setting autoneg = fixed > and others were not. Turns out it makes no difference > since FIXED == 0, the old code and new code have same effect. May be I miss something, but ETH_LINK_SPEED_FIXED==1, but ETH_LINK_FIXED==0. So, initially it was 0 (fixed speed), but now it is 1 (autoneg).