From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v11 2/8] ethdev: use constants for link duplex Date: Wed, 23 Mar 2016 09:34:35 +0100 Message-ID: <2545468.xWxNWWbLOO@xps13> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "marcdevel@gmail.com" , "Richardson, Bruce" , "Doherty, Declan" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , dev@dpdk.org To: "Zhang, Helin" 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) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.