From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id E6B7995D9 for ; Fri, 1 Apr 2016 00:12:44 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id i204so102772wmd.0 for ; Thu, 31 Mar 2016 15:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MZO8y4pmPGZvu7T/VoqIaRkggZ8biQpJitF8rBpJbKg=; b=XwbYreeK4nTiKIbA+HYkSgoGuk/yACBtkLBzRN07q/xLp97j9FJ6t6dROW7yq67gwm 1/ZsVREfFPSklYJwmXB3GkqLjN0zEeRHmcmhV4Tiwq+BUG84EMFQUDKw0EL0w+x0gOSE GghYZbxJ4fEUZaFsCjvEWUSkoL4duyJfhSf+XFY6GXNcecCXZg3GCNBc5oWBKguBbb2I 05Fn+kVwfw+zRMYABobhzVjp0+i4xYwTuh5mOWdfYqvzVUsiwbEvTKtHvPdCq1X8y6Hg oseHOCHXwUtRvWjWlHULazavhvNlwXfL+M327tFSg0HbmB19U8MzZki1JHwfQWi8Loiu UBBA== 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:in-reply-to :references; bh=MZO8y4pmPGZvu7T/VoqIaRkggZ8biQpJitF8rBpJbKg=; b=YyCbUceyqlZIJGGdqASmk5t2cKyvoNtxfug+gMrZLWtVGcJAj0JeFS/duqvopUc9W5 HLqhPZ6DZ7BApBUZ+g1s+aZvlM/PNJOl6Br/zaeG7IMC6A23xHHZIk3lo8Bp2WEGGHCz hyrQDOmcHo83Jw/CudosESWr3K9sVGhtnnFJnUzdApcXLd4Shsjwnsj+9LUKaglYZugO tG4BKOo2KtzqrooJ4LWuvW9q0NpLMY+whZohwB8+3Np4eOm8S2xo4sjps3Yh2qZw5mIs 1r5LqeyvtXolN4znfMWp/k9il+NXIAssBPUaGAVPhjods8vOKCn9EhPJuha0rDNAyH6i J+RQ== X-Gm-Message-State: AD7BkJKT3hI2dUjPfpv5pVOkB2EEK/ziLNRm42qBhYhhWGecyEpUAndlHTKw3dgtdLoNcw== X-Received: by 10.194.2.169 with SMTP id 9mr817442wjv.7.1459462364783; Thu, 31 Mar 2016 15:12:44 -0700 (PDT) Received: from localhost.localdomain (149.red-83-32-179.dynamicip.rima-tde.net. [83.32.179.149]) by smtp.gmail.com with ESMTPSA id m13sm11495604wma.3.2016.03.31.15.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 15:12:44 -0700 (PDT) From: Marc Sune To: Thomas Monjalon , "Xu, Qian Q" , "Xing, Beilei" , "dev@dpdk.org" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Richardson, Bruce" , "Glynn, Michael J" Cc: Marc Sune Date: Fri, 1 Apr 2016 00:12:25 +0200 Message-Id: <1459462351-1120-3-git-send-email-marcdevel@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459462351-1120-1-git-send-email-marcdevel@gmail.com> References: <1458955640-22951-1-git-send-email-marcdevel@gmail.com> <1459462351-1120-1-git-send-email-marcdevel@gmail.com> Subject: [dpdk-dev] [PATCH v14 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: Thu, 31 Mar 2016 22:12:45 -0000 Some duplex values are replaced from 0 to half-duplex when link is down. Some drivers are still using their own constants for duplex modes. Signed-off-by: Marc Sune --- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/virtio/virtio_ethdev.h | 2 -- lib/librte_ether/rte_ethdev.h | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 9c50674..b78ac04 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1108,7 +1108,7 @@ eth_em_link_update(struct rte_eth_dev *dev, int wait_to_complete) link.link_status = ETH_LINK_UP; } else if (!link_check && (link.link_status == ETH_LINK_UP)) { link.link_speed = 0; - link.link_duplex = 0; + link.link_duplex = ETH_LINK_HALF_DUPLEX; link.link_status = ETH_LINK_DOWN; } rte_em_dev_atomic_write_link_status(dev, &link); diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 045fc63..4dfa7e3 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -2062,7 +2062,7 @@ eth_igb_link_update(struct rte_eth_dev *dev, int wait_to_complete) link.link_status = ETH_LINK_UP; } else if (!link_check) { link.link_speed = 0; - link.link_duplex = 0; + link.link_duplex = ETH_LINK_HALF_DUPLEX; link.link_status = ETH_LINK_DOWN; } rte_igb_dev_atomic_write_link_status(dev, &link); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 8bcd0d8..5721882 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3066,7 +3066,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) link.link_status = ETH_LINK_DOWN; link.link_speed = 0; - link.link_duplex = 0; + link.link_duplex = ETH_LINK_HALF_DUPLEX; memset(&old, 0, sizeof(old)); rte_ixgbe_dev_atomic_read_link_status(dev, &old); diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 3ebc221..63a368a 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1401,7 +1401,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet memset(&link, 0, sizeof(link)); virtio_dev_atomic_read_link_status(dev, &link); old = link; - link.link_duplex = FULL_DUPLEX; + link.link_duplex = ETH_LINK_FULL_DUPLEX; link.link_speed = SPEED_10G; if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h index fed9571..66423a0 100644 --- a/drivers/net/virtio/virtio_ethdev.h +++ b/drivers/net/virtio/virtio_ethdev.h @@ -42,8 +42,6 @@ #define SPEED_100 100 #define SPEED_1000 1000 #define SPEED_10G 10000 -#define HALF_DUPLEX 1 -#define FULL_DUPLEX 2 #ifndef PAGE_SIZE #define PAGE_SIZE 4096 diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index c5a215a..2d13f92 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -246,7 +246,7 @@ struct rte_eth_stats { */ 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 */ -- 2.1.4