From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 85D092BA2 for ; Wed, 23 Mar 2016 09:36:30 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id l68so223359348wml.0 for ; Wed, 23 Mar 2016 01:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=eR6d0+u+084LfUibi9yyk9b0iKeKyZKAX36Gh1GB18Q=; b=AoMmE3Kf7I0UE0oSV9m4sXMZwuad4haOImhhdZuLurvlHgTtXKTbGHeN7b4AH/kneO 7Oi3ITI0nYuMCQmfUxHeOL7WV7Wl8VkDkTAmbBdGo2fUxEdVgvsXFUr+r7pLBcbuqo40 vDfdFIyrF/wQ84x1hX5OlPkI4jZ0U6bSmSO+vr9oioBP6hbbpZXj9/i6Xp+lJnntg1rQ 8/CICFhsD6Eq03QLRNxX9cznzIwsI1/sI2acf+CfaI2nq4UcwLzGOHuYEXfXu4BGV7QE yDu6s2TNXmWujamtllsAtSdHyahEYfnf0YUh/IqFeVmxKeS6VDfYcYFc1cXS2BmsYIwI p1xg== 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; bh=eR6d0+u+084LfUibi9yyk9b0iKeKyZKAX36Gh1GB18Q=; b=KfiQkbUGw/vnuV1wmRKgSE/vq5MfNsEWYNac9ZIa6fuWG4QxPvLtXGBjJkOU8TkiN3 fKH1B+0AwTqzhbrx4EzrMWtZJneXqyMYWzaX0WP/PVGqCei3LYFL+NCjvuo+q/AXm4mk 9YPWO8KwLv2Xi5SrxsneqN6G3oAqWAOqqZtPUxy+Cn35TBbFou9srDKGIjKs//ytlc6B Z+QDNouci4xuogcH7G7KfLp6XLUKqDQfdqRfetrb0eDTHQAmFmR1AqhPUj78mtGx2gLl KeXQxBCBEPRxhT9tJqDNzOv+i9rlo4hNXAPLZZ1O8YbIBIThLmmgCc9BD4daU1aHYgve S9xg== X-Gm-Message-State: AD7BkJLzrCeOauitpCQ0HE6X4Z4YHOd10VHZxj1OrghZ3cdjt980nZwhNCDb14VXOyDNmWNO X-Received: by 10.194.175.33 with SMTP id bx1mr1964831wjc.104.1458722190439; Wed, 23 Mar 2016 01:36:30 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id c128sm20996729wma.11.2016.03.23.01.36.29 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2016 01:36:29 -0700 (PDT) From: Thomas Monjalon To: "Zhang, Helin" Cc: "marcdevel@gmail.com" , "Richardson, Bruce" , "Doherty, Declan" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , dev@dpdk.org Date: Wed, 23 Mar 2016 09:34:35 +0100 Message-ID: <2545468.xWxNWWbLOO@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> <1458238145-7496-3-git-send-email-thomas.monjalon@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v11 2/8] ethdev: use constants for link duplex 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, 23 Mar 2016 08:36:30 -0000 2016-03-23 02:44, Zhang, Helin: > > struct rte_eth_link { > > uint16_t link_speed; /**< ETH_LINK_SPEED_[10, 100, 1000, 10000] > > */ > > - uint16_t link_duplex; /**< ETH_LINK_[HALF_DUPLEX, > > FULL_DUPLEX] */ > > + uint16_t link_duplex; /**< ETH_LINK_[HALF/FULL]_DUPLEX */ > > uint8_t link_status : 1; /**< ETH_LINK_[DOWN/UP] */ > > }__attribute__((aligned(8))); /**< aligned for atomic64 read/write */ > For link speed and link duplex, I'd suggest to add one more status of 'UNKNOWN'. > Because, sometimes it cannot get all the information from hardware. > For link stauts, assume it in DOWN state is acceptable, while for other two, I don't think so. > > Currently it can be seen that a default link speed and duplex will be set if it cannot > get the accurate info from hardware. That's not good, and I think UNKNOWN could be better. > > What do you think? OK, please provide a patch on top of this one to set ETH_LINK_UNKNOWN_DUPLEX in the drivers where appropriate.