[dpdk-dev] net/virtio: remove unnecessary macro definitions

Message ID 20171226092500.53594-1-zhiyong.yang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yang, Zhiyong Dec. 26, 2017, 9:25 a.m. UTC
  DPDK has already the definition of Ethernet numeric link speeds in Mbps in
the file Rte_ethdev.h, it is unnecessary to rededine virtio specific link
speeds macros again.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 +-
 drivers/net/virtio/virtio_ethdev.h | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)
  

Comments

Yuanhan Liu Dec. 27, 2017, 2:17 p.m. UTC | #1
On Tue, Dec 26, 2017 at 05:25:00PM +0800, Zhiyong Yang wrote:
> DPDK has already the definition of Ethernet numeric link speeds in Mbps in
> the file Rte_ethdev.h, it is unnecessary to rededine virtio specific link
> speeds macros again.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu
  
Maxime Coquelin Jan. 2, 2018, 6:39 a.m. UTC | #2
On 12/26/2017 10:25 AM, Zhiyong Yang wrote:
> DPDK has already the definition of Ethernet numeric link speeds in Mbps in
> the file Rte_ethdev.h, it is unnecessary to rededine virtio specific link
> speeds macros again.
> 
> Signed-off-by: Zhiyong Yang<zhiyong.yang@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 2 +-
>   drivers/net/virtio/virtio_ethdev.h | 5 -----
>   2 files changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e0328f61d..db89cc32d 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1965,7 +1965,7 @@  virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet
 	virtio_dev_atomic_read_link_status(dev, &link);
 	old = link;
 	link.link_duplex = ETH_LINK_FULL_DUPLEX;
-	link.link_speed  = SPEED_10G;
+	link.link_speed  = ETH_SPEED_NUM_10G;
 
 	if (hw->started == 0) {
 		link.link_status = ETH_LINK_DOWN;
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 2039bc547..6387a44f9 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -38,11 +38,6 @@ 
 
 #include "virtio_pci.h"
 
-#define SPEED_10	10
-#define SPEED_100	100
-#define SPEED_1000	1000
-#define SPEED_10G	10000
-
 #ifndef PAGE_SIZE
 #define PAGE_SIZE 4096
 #endif