From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 3B9AE47CD for ; Mon, 17 Jul 2017 18:01:25 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id q85so78510154pfq.1 for ; Mon, 17 Jul 2017 09:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ezGCDUMwrK5KL4IGRSuX9uz0V2bjHHHTTbe9I5lqeD8=; b=O6zMKRwDJKyEqgI3sSXPrswy/KRK92W9CHeH044zCoiQFTGXjZdCsp3GAqY1JplRFM L4pNs5+wmXjb4pav9yiLV04ahp+g6dC5/ebptjiQPfR4BmWy/5m0nS9akLWnseQLAkyV Nz9bJYuk8S1PBFF/BC2Vf1tElWVba8G6Klj2BcmcdYZDDHe1f9X/iQYDZkcIvKxsVPh+ /Ai+CvL5E6BJHG8xgzVV8WL5DlM2cBp1sROsJ/6Rb5mVBdoVVNa8MDf3hg237sh0oSmx vX9zO3qorIEi5SqzYEJSyFRA6zMAzaKsvk1E5HpDadUiwaBw7yDmPYJezA12TMBYlzi2 8H1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ezGCDUMwrK5KL4IGRSuX9uz0V2bjHHHTTbe9I5lqeD8=; b=ieoLZnVkdyhctshGRS97wWXv5bGcN6oYTnpUBOVX3mX81tXfsapVYTtOOfySOLHNO7 60J9+AD/ICv39Kuv4HV/WE79hEx1sXLD+xG/qE/c+2XPr5mHJWjCLRIjg1bZG6EUPGPm nRZbLX2GBW+3tl9Y4l2+a3DFQJfe/kv4FGDFk0lRfFdaoEofM7xuVkPwo1kBmE3CRs1z oXhW4IS5X4CK6sWPj8HUB+G3t0FgNuNVNSxaRcNFuehgkDHfpwk20WlEL0uFPAu7pwfm /lVF606qBsxa6ixlXLBOV+tiwTIwrRTMYnstSDUIvABs1iEZ0+wiY1gIR967kyTVE5ot HGYQ== X-Gm-Message-State: AIVw1131aKxRRmuo1DQtKq0qwippUTHAkSE2tj/b1FWYS+UVgn9dovz+ ngWj03xyKDSDYQg2 X-Received: by 10.98.209.22 with SMTP id z22mr19587587pfg.141.1500307285148; Mon, 17 Jul 2017 09:01:25 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id s64sm39113214pfd.77.2017.07.17.09.01.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jul 2017 09:01:25 -0700 (PDT) Date: Mon, 17 Jul 2017 09:01:22 -0700 From: Stephen Hemminger To: Andrew Rybchenko Cc: , Stephen Hemminger , Thomas Monjalon Message-ID: <20170717090122.18655a27@xeon-e3> In-Reply-To: References: <20170714183027.16021-1-stephen@networkplumber.org> <20170714183027.16021-3-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [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:01:26 -0000 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.