From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3CA8029C6 for ; Wed, 23 Mar 2016 03:52:15 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 22 Mar 2016 19:52:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,380,1455004800"; d="scan'208";a="674152872" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2016 19:52:14 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 19:52:13 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 19:52:13 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.132]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.18]) with mapi id 14.03.0248.002; Wed, 23 Mar 2016 10:52:11 +0800 From: "Zhang, Helin" To: Thomas Monjalon , "marcdevel@gmail.com" , "Richardson, Bruce" , "Doherty, Declan" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Chen, Jing D" , "harish.patil@qlogic.com" , "rahul.lakkireddy@chelsio.com" , "johndale@cisco.com" , "vido@cesnet.cz" , "adrien.mazarguil@6wind.com" , "alejandro.lucero@netronome.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v11 4/8] ethdev: rename link speed constants Thread-Index: AQHRgHhe3niGbROt406hQXpah/42i59mXIDw Date: Wed, 23 Mar 2016 02:52:10 +0000 Message-ID: References: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> <1458238145-7496-1-git-send-email-thomas.monjalon@6wind.com> <1458238145-7496-5-git-send-email-thomas.monjalon@6wind.com> In-Reply-To: <1458238145-7496-5-git-send-email-thomas.monjalon@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v11 4/8] ethdev: rename link speed constants 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 02:52:16 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Friday, March 18, 2016 2:09 AM > To: marcdevel@gmail.com; Richardson, Bruce; Doherty, Declan; Ananyev, > Konstantin; Lu, Wenzhuo; Zhang, Helin; Chen, Jing D; > harish.patil@qlogic.com; rahul.lakkireddy@chelsio.com; > johndale@cisco.com; vido@cesnet.cz; adrien.mazarguil@6wind.com; > alejandro.lucero@netronome.com > Cc: dev@dpdk.org > Subject: [PATCH v11 4/8] ethdev: rename link speed constants >=20 > From: Marc Sune >=20 > The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_. > The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used for bit > flags in next patch. >=20 > Signed-off-by: Marc Sune > --- > app/test-pmd/cmdline.c | 10 +++++----- > app/test/virtual_pmd.c | 2 +- > drivers/net/af_packet/rte_eth_af_packet.c | 2 +- > drivers/net/bonding/rte_eth_bond_8023ad.c | 12 ++++++------ > drivers/net/cxgbe/base/t4_hw.c | 8 ++++---- > drivers/net/e1000/em_ethdev.c | 8 ++++---- > drivers/net/e1000/igb_ethdev.c | 8 ++++---- > drivers/net/i40e/i40e_ethdev.c | 30 +++++++++++++++----------= ----- > drivers/net/i40e/i40e_ethdev_vf.c | 2 +- > drivers/net/ixgbe/ixgbe_ethdev.c | 22 +++++++++++----------- > drivers/net/mpipe/mpipe_tilegx.c | 4 ++-- > drivers/net/nfp/nfp_net.c | 2 +- > drivers/net/null/rte_eth_null.c | 2 +- > drivers/net/pcap/rte_eth_pcap.c | 2 +- > drivers/net/ring/rte_eth_ring.c | 2 +- > drivers/net/szedata2/rte_eth_szedata2.c | 8 ++++---- > drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- > drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +- > lib/librte_ether/rte_ethdev.h | 29 ++++++++++++++++++-------= ---- > 19 files changed, 82 insertions(+), 75 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 37be5cd..874129a 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -1001,20 +1001,20 @@ parse_and_check_speed_duplex(char *speedstr, > char *duplexstr, uint16_t *speed) > } >=20 > if (!strcmp(speedstr, "10")) { > - *speed =3D ETH_LINK_SPEED_10; > + *speed =3D ETH_SPEED_NUM_10M; > } else if (!strcmp(speedstr, "100")) { > - *speed =3D ETH_LINK_SPEED_100; > + *speed =3D ETH_SPEED_NUM_100M; > } else { > if (duplex !=3D ETH_LINK_FULL_DUPLEX) { > printf("Invalid speed/duplex parameters\n"); > return -1; > } > if (!strcmp(speedstr, "1000")) { > - *speed =3D ETH_LINK_SPEED_1000; > + *speed =3D ETH_SPEED_NUM_1G; > } else if (!strcmp(speedstr, "10000")) { > - *speed =3D ETH_LINK_SPEED_10G; > + *speed =3D ETH_SPEED_NUM_10G; > } else if (!strcmp(speedstr, "40000")) { > - *speed =3D ETH_LINK_SPEED_40G; > + *speed =3D ETH_SPEED_NUM_40G; > } else if (!strcmp(speedstr, "auto")) { > *speed =3D ETH_LINK_SPEED_AUTONEG; > } else { > diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index > b1d40d7..b4bd2f2 100644 > --- a/app/test/virtual_pmd.c > +++ b/app/test/virtual_pmd.c > @@ -604,7 +604,7 @@ virtual_ethdev_create(const char *name, struct > ether_addr *mac_addr, > TAILQ_INIT(&(eth_dev->link_intr_cbs)); >=20 > eth_dev->data->dev_link.link_status =3D ETH_LINK_DOWN; > - eth_dev->data->dev_link.link_speed =3D ETH_LINK_SPEED_10000; > + eth_dev->data->dev_link.link_speed =3D ETH_SPEED_NUM_10G; > eth_dev->data->dev_link.link_duplex =3D ETH_LINK_FULL_DUPLEX; >=20 > eth_dev->data->mac_addrs =3D rte_zmalloc(name, ETHER_ADDR_LEN, > 0); diff --git a/drivers/net/af_packet/rte_eth_af_packet.c > b/drivers/net/af_packet/rte_eth_af_packet.c > index dee7b59..641f849 100644 > --- a/drivers/net/af_packet/rte_eth_af_packet.c > +++ b/drivers/net/af_packet/rte_eth_af_packet.c > @@ -116,7 +116,7 @@ static const char *valid_arguments[] =3D { static co= nst > char *drivername =3D "AF_PACKET PMD"; >=20 > static struct rte_eth_link pmd_link =3D { > - .link_speed =3D 10000, > + .link_speed =3D ETH_SPEED_NUM_10G, > .link_duplex =3D ETH_LINK_FULL_DUPLEX, > .link_status =3D ETH_LINK_DOWN, > }; > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c > b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1b7e93a..ac8306f 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -711,22 +711,22 @@ link_speed_key(uint16_t speed) { > case ETH_LINK_SPEED_AUTONEG: > key_speed =3D 0x00; > break; > - case ETH_LINK_SPEED_10: > + case ETH_SPEED_NUM_10M: > key_speed =3D BOND_LINK_SPEED_KEY_10M; > break; > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > key_speed =3D BOND_LINK_SPEED_KEY_100M; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > key_speed =3D BOND_LINK_SPEED_KEY_1000M; > break; > - case ETH_LINK_SPEED_10G: > + case ETH_SPEED_NUM_10G: > key_speed =3D BOND_LINK_SPEED_KEY_10G; > break; > - case ETH_LINK_SPEED_20G: > + case ETH_SPEED_NUM_20G: > key_speed =3D BOND_LINK_SPEED_KEY_20G; > break; > - case ETH_LINK_SPEED_40G: > + case ETH_SPEED_NUM_40G: > key_speed =3D BOND_LINK_SPEED_KEY_40G; > break; > default: > diff --git a/drivers/net/cxgbe/base/t4_hw.c > b/drivers/net/cxgbe/base/t4_hw.c index 884d2cf..79af806 100644 > --- a/drivers/net/cxgbe/base/t4_hw.c > +++ b/drivers/net/cxgbe/base/t4_hw.c > @@ -2159,13 +2159,13 @@ int t4_handle_fw_rpl(struct adapter *adap, > const __be64 *rpl) > if (stat & F_FW_PORT_CMD_TXPAUSE) > fc |=3D PAUSE_TX; > if (stat & > V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M)) > - speed =3D ETH_LINK_SPEED_100; > + speed =3D ETH_SPEED_NUM_100M; > else if (stat & > V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G)) > - speed =3D ETH_LINK_SPEED_1000; > + speed =3D ETH_SPEED_NUM_1G; > else if (stat & > V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) > - speed =3D ETH_LINK_SPEED_10000; > + speed =3D ETH_SPEED_NUM_10G; > else if (stat & > V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) > - speed =3D ETH_LINK_SPEED_40G; > + speed =3D ETH_SPEED_NUM_40G; >=20 > for_each_port(adap, i) { > pi =3D adap2pinfo(adap, i); > diff --git a/drivers/net/e1000/em_ethdev.c > b/drivers/net/e1000/em_ethdev.c index 943a270..b9dbc0f 100644 > --- a/drivers/net/e1000/em_ethdev.c > +++ b/drivers/net/e1000/em_ethdev.c > @@ -625,7 +625,7 @@ eth_em_start(struct rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_10: > + case ETH_SPEED_NUM_10M: > if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) > hw->phy.autoneg_advertised =3D > E1000_ALL_10_SPEED; > else if (dev->data->dev_conf.link_duplex =3D=3D @@ -637,7 > +637,7 @@ eth_em_start(struct rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) > hw->phy.autoneg_advertised =3D > E1000_ALL_100_SPEED; > else if (dev->data->dev_conf.link_duplex =3D=3D @@ -649,7 > +649,7 @@ eth_em_start(struct rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > if ((dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) || > (dev->data->dev_conf.link_duplex =3D=3D > @@ -658,7 +658,7 @@ eth_em_start(struct rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_10000: > + case ETH_SPEED_NUM_10G: > default: > goto error_invalid_config; > } > diff --git a/drivers/net/e1000/igb_ethdev.c > b/drivers/net/e1000/igb_ethdev.c index ea156ce..11786ef 100644 > --- a/drivers/net/e1000/igb_ethdev.c > +++ b/drivers/net/e1000/igb_ethdev.c > @@ -1241,7 +1241,7 @@ eth_igb_start(struct rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_10: > + case ETH_SPEED_NUM_10M: > if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) > hw->phy.autoneg_advertised =3D > E1000_ALL_10_SPEED; > else if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_HALF_DUPLEX) @@ -1251,7 +1251,7 @@ eth_igb_start(struct > rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) > hw->phy.autoneg_advertised =3D > E1000_ALL_100_SPEED; > else if (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_HALF_DUPLEX) @@ -1261,14 +1261,14 @@ eth_igb_start(struct > rte_eth_dev *dev) > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > if ((dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_AUTONEG_DUPLEX) || > (dev->data->dev_conf.link_duplex =3D=3D > ETH_LINK_FULL_DUPLEX)) > hw->phy.autoneg_advertised =3D > ADVERTISE_1000_FULL; > else > goto error_invalid_config; > break; > - case ETH_LINK_SPEED_10000: > + case ETH_SPEED_NUM_10G: > default: > goto error_invalid_config; > } > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 10e0d38..5d8bdd9 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1372,19 +1372,19 @@ i40e_parse_link_speed(uint16_t eth_link_speed) > uint8_t link_speed =3D I40E_LINK_SPEED_UNKNOWN; >=20 > switch (eth_link_speed) { > - case ETH_LINK_SPEED_40G: > + case ETH_SPEED_NUM_40G: > link_speed =3D I40E_LINK_SPEED_40GB; > break; > - case ETH_LINK_SPEED_20G: > + case ETH_SPEED_NUM_20G: > link_speed =3D I40E_LINK_SPEED_20GB; > break; > - case ETH_LINK_SPEED_10G: > + case ETH_SPEED_NUM_10G: > link_speed =3D I40E_LINK_SPEED_10GB; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > link_speed =3D I40E_LINK_SPEED_1GB; > break; > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > link_speed =3D I40E_LINK_SPEED_100MB; > break; > } > @@ -1754,7 +1754,7 @@ i40e_dev_link_update(struct rte_eth_dev *dev, > /* Get link status information from hardware */ > status =3D i40e_aq_get_link_info(hw, false, &link_status, > NULL); > if (status !=3D I40E_SUCCESS) { > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > link.link_duplex =3D ETH_LINK_FULL_DUPLEX; > PMD_DRV_LOG(ERR, "Failed to get link info"); > goto out; > @@ -1776,22 +1776,22 @@ i40e_dev_link_update(struct rte_eth_dev *dev, > /* Parse the link status */ > switch (link_status.link_speed) { > case I40E_LINK_SPEED_100MB: > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > break; > case I40E_LINK_SPEED_1GB: > - link.link_speed =3D ETH_LINK_SPEED_1000; > + link.link_speed =3D ETH_SPEED_NUM_1G; > break; > case I40E_LINK_SPEED_10GB: > - link.link_speed =3D ETH_LINK_SPEED_10G; > + link.link_speed =3D ETH_SPEED_NUM_10G; > break; > case I40E_LINK_SPEED_20GB: > - link.link_speed =3D ETH_LINK_SPEED_20G; > + link.link_speed =3D ETH_SPEED_NUM_20G; > break; > case I40E_LINK_SPEED_40GB: > - link.link_speed =3D ETH_LINK_SPEED_40G; > + link.link_speed =3D ETH_SPEED_NUM_40G; > break; > default: > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > break; > } >=20 > @@ -8087,15 +8087,15 @@ i40e_start_timecounters(struct rte_eth_dev > *dev) > rte_i40e_dev_atomic_read_link_status(dev, &link); >=20 > switch (link.link_speed) { > - case ETH_LINK_SPEED_40G: > + case ETH_SPEED_NUM_40G: > tsync_inc_l =3D I40E_PTP_40GB_INCVAL & 0xFFFFFFFF; > tsync_inc_h =3D I40E_PTP_40GB_INCVAL >> 32; > break; > - case ETH_LINK_SPEED_10G: > + case ETH_SPEED_NUM_10G: > tsync_inc_l =3D I40E_PTP_10GB_INCVAL & 0xFFFFFFFF; > tsync_inc_h =3D I40E_PTP_10GB_INCVAL >> 32; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > tsync_inc_l =3D I40E_PTP_1GB_INCVAL & 0xFFFFFFFF; > tsync_inc_h =3D I40E_PTP_1GB_INCVAL >> 32; > break; > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > b/drivers/net/i40e/i40e_ethdev_vf.c > index de00aff..f2b37a2 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1958,7 +1958,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev, > else { > /* Always assume it's up, for Linux driver PF host */ > new_link.link_duplex =3D ETH_LINK_AUTONEG_DUPLEX; > - new_link.link_speed =3D ETH_LINK_SPEED_10000; > + new_link.link_speed =3D ETH_SPEED_NUM_10G; > new_link.link_status =3D ETH_LINK_UP; > } > i40evf_dev_atomic_write_link_status(dev, &new_link); diff --git > a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c > index 35dac49..9246fdb 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -2179,17 +2179,17 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > IXGBE_LINK_SPEED_82599_AUTONEG : > IXGBE_LINK_SPEED_82598_AUTONEG; > break; > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > /* > * Invalid for 82598 but error will be detected by > * ixgbe_setup_link() > */ > speed =3D IXGBE_LINK_SPEED_100_FULL; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > speed =3D IXGBE_LINK_SPEED_1GB_FULL; > break; > - case ETH_LINK_SPEED_10000: > + case ETH_SPEED_NUM_10G: > speed =3D IXGBE_LINK_SPEED_10GB_FULL; > break; > default: > @@ -3010,7 +3010,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, > int wait_to_complete) > diag =3D ixgbe_check_link(hw, &link_speed, &link_up, 1); >=20 > if (diag !=3D 0) { > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > link.link_duplex =3D ETH_LINK_HALF_DUPLEX; > rte_ixgbe_dev_atomic_write_link_status(dev, &link); > if (link.link_status =3D=3D old.link_status) @@ -3031,19 +3031,19 > @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) > default: > case IXGBE_LINK_SPEED_UNKNOWN: > link.link_duplex =3D ETH_LINK_HALF_DUPLEX; > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > break; >=20 > case IXGBE_LINK_SPEED_100_FULL: > - link.link_speed =3D ETH_LINK_SPEED_100; > + link.link_speed =3D ETH_SPEED_NUM_100M; > break; >=20 > case IXGBE_LINK_SPEED_1GB_FULL: > - link.link_speed =3D ETH_LINK_SPEED_1000; > + link.link_speed =3D ETH_SPEED_NUM_1G; > break; >=20 > case IXGBE_LINK_SPEED_10GB_FULL: > - link.link_speed =3D ETH_LINK_SPEED_10000; > + link.link_speed =3D ETH_SPEED_NUM_10G; > break; > } > rte_ixgbe_dev_atomic_write_link_status(dev, &link); @@ -5838,15 > +5838,15 @@ ixgbe_start_timecounters(struct rte_eth_dev *dev) > rte_ixgbe_dev_atomic_read_link_status(dev, &link); >=20 > switch (link.link_speed) { > - case ETH_LINK_SPEED_100: > + case ETH_SPEED_NUM_100M: > incval =3D IXGBE_INCVAL_100; > shift =3D IXGBE_INCVAL_SHIFT_100; > break; > - case ETH_LINK_SPEED_1000: > + case ETH_SPEED_NUM_1G: > incval =3D IXGBE_INCVAL_1GB; > shift =3D IXGBE_INCVAL_SHIFT_1GB; > break; > - case ETH_LINK_SPEED_10000: > + case ETH_SPEED_NUM_10G: > default: > incval =3D IXGBE_INCVAL_10GB; > shift =3D IXGBE_INCVAL_SHIFT_10GB; > diff --git a/drivers/net/mpipe/mpipe_tilegx.c > b/drivers/net/mpipe/mpipe_tilegx.c > index 1e04b75..960d468 100644 > --- a/drivers/net/mpipe/mpipe_tilegx.c > +++ b/drivers/net/mpipe/mpipe_tilegx.c > @@ -395,11 +395,11 @@ mpipe_link_update(struct rte_eth_dev *dev, int > wait_to_complete) > speed =3D state & GXIO_MPIPE_LINK_SPEED_MASK; >=20 > if (speed =3D=3D GXIO_MPIPE_LINK_1G) { > - new.link_speed =3D ETH_LINK_SPEED_1000; > + new.link_speed =3D ETH_SPEED_NUM_1G; > new.link_duplex =3D ETH_LINK_FULL_DUPLEX; > new.link_status =3D ETH_LINK_UP; > } else if (speed =3D=3D GXIO_MPIPE_LINK_10G) { > - new.link_speed =3D ETH_LINK_SPEED_10000; > + new.link_speed =3D ETH_SPEED_NUM_10G; > new.link_duplex =3D ETH_LINK_FULL_DUPLEX; > new.link_status =3D ETH_LINK_UP; > } > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index > 7cb7d76..9e314bd 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -821,7 +821,7 @@ nfp_net_link_update(struct rte_eth_dev *dev, > __rte_unused int wait_to_complete) >=20 > link.link_duplex =3D ETH_LINK_FULL_DUPLEX; > /* Other cards can limit the tx and rx rate per VF */ > - link.link_speed =3D ETH_LINK_SPEED_40G; > + link.link_speed =3D ETH_SPEED_NUM_40G; >=20 > if (old.link_status !=3D link.link_status) { > nfp_net_dev_atomic_write_link_status(dev, &link); diff --git > a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index > 6adea91..5640585 100644 > --- a/drivers/net/null/rte_eth_null.c > +++ b/drivers/net/null/rte_eth_null.c > @@ -89,7 +89,7 @@ struct pmd_internals { static struct ether_addr > eth_addr =3D { .addr_bytes =3D {0} }; static const char *drivername =3D = "Null PMD"; > static struct rte_eth_link pmd_link =3D { > - .link_speed =3D 10000, > + .link_speed =3D ETH_SPEED_NUM_10G, > .link_duplex =3D ETH_LINK_FULL_DUPLEX, > .link_status =3D ETH_LINK_DOWN, > }; > diff --git a/drivers/net/pcap/rte_eth_pcap.c > b/drivers/net/pcap/rte_eth_pcap.c index b90c725..c657951 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -123,7 +123,7 @@ static int open_single_iface(const char *iface, > pcap_t **pcap); static struct ether_addr eth_addr =3D { .addr_bytes =3D = { 0, 0, 0, > 0x1, 0x2, 0x3 } }; static const char *drivername =3D "Pcap PMD"; static= struct > rte_eth_link pmd_link =3D { > - .link_speed =3D 10000, > + .link_speed =3D ETH_SPEED_NUM_10G, > .link_duplex =3D ETH_LINK_FULL_DUPLEX, > .link_status =3D ETH_LINK_DOWN, > }; > diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_r= ing.c > index 4335c6a..58685e9 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -77,7 +77,7 @@ struct pmd_internals { >=20 > static const char *drivername =3D "Rings PMD"; static struct rte_eth_li= nk > pmd_link =3D { > - .link_speed =3D 10000, > + .link_speed =3D ETH_SPEED_NUM_10G, > .link_duplex =3D ETH_LINK_FULL_DUPLEX, > .link_status =3D ETH_LINK_DOWN, > }; > diff --git a/drivers/net/szedata2/rte_eth_szedata2.c > b/drivers/net/szedata2/rte_eth_szedata2.c > index c65067e..854cb5c 100644 > --- a/drivers/net/szedata2/rte_eth_szedata2.c > +++ b/drivers/net/szedata2/rte_eth_szedata2.c > @@ -1149,10 +1149,10 @@ eth_link_update(struct rte_eth_dev *dev, >=20 > switch (cgmii_link_speed(ibuf)) { > case SZEDATA2_LINK_SPEED_10G: > - link.link_speed =3D ETH_LINK_SPEED_10G; > + link.link_speed =3D ETH_SPEED_NUM_10G; > break; > case SZEDATA2_LINK_SPEED_40G: > - link.link_speed =3D ETH_LINK_SPEED_40G; > + link.link_speed =3D ETH_SPEED_NUM_40G; > break; > case SZEDATA2_LINK_SPEED_100G: > /* > @@ -1161,10 +1161,10 @@ eth_link_update(struct rte_eth_dev *dev, > * will be changed to support 100Gbps speed change > * this value to 100G. > */ > - link.link_speed =3D ETH_LINK_SPEED_10G; > + link.link_speed =3D ETH_SPEED_NUM_10G; > break; > default: > - link.link_speed =3D ETH_LINK_SPEED_10G; > + link.link_speed =3D ETH_SPEED_NUM_10G; > break; > } >=20 > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c > b/drivers/net/vmxnet3/vmxnet3_ethdev.c > index 7fe3a53..ad8029b 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -762,7 +762,7 @@ vmxnet3_dev_link_update(struct rte_eth_dev *dev, > __attribute__((unused)) int wai > if (ret & 0x1) { > link.link_status =3D ETH_LINK_UP; > link.link_duplex =3D ETH_LINK_FULL_DUPLEX; > - link.link_speed =3D ETH_LINK_SPEED_10000; > + link.link_speed =3D ETH_SPEED_NUM_10G; > } >=20 > vmxnet3_dev_atomic_write_link_status(dev, &link); diff --git > a/drivers/net/xenvirt/rte_eth_xenvirt.c > b/drivers/net/xenvirt/rte_eth_xenvirt.c > index 9453a06..77d3ba1 100644 > --- a/drivers/net/xenvirt/rte_eth_xenvirt.c > +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c > @@ -70,7 +70,7 @@ static int virtio_idx =3D 0; static const char *driver= name =3D > "xen virtio PMD"; >=20 > static struct rte_eth_link pmd_link =3D { > - .link_speed =3D 10000, > + .link_speed =3D ETH_SPEED_NUM_10G, > .link_duplex =3D ETH_LINK_FULL_DUPLEX, > .link_status =3D ETH_LINK_DOWN, > }; > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h > index 5379bee..d7c8a66 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -242,23 +242,30 @@ struct rte_eth_stats { }; >=20 > /** > + * Ethernet numeric link speeds in Mbps */ > +#define ETH_LINK_SPEED_AUTONEG 0 /**< Auto-negotiate link speed. */ > +#define ETH_SPEED_NUM_10M 10 /**< 10 Mbps */ > +#define ETH_SPEED_NUM_100M 100 /**< 100 Mbps */ > +#define ETH_SPEED_NUM_1G 1000 /**< 1 Gbps */ > +#define ETH_SPEED_NUM_2_5G 2500 /**< 2.5 Gbps */ > +#define ETH_SPEED_NUM_5G 5000 /**< 5 Gbps */ > +#define ETH_SPEED_NUM_10G 10000 /**< 10 Gbps */ > +#define ETH_SPEED_NUM_20G 20000 /**< 20 Gbps */ > +#define ETH_SPEED_NUM_25G 25000 /**< 25 Gbps */ > +#define ETH_SPEED_NUM_40G 40000 /**< 40 Gbps */ > +#define ETH_SPEED_NUM_50G 50000 /**< 50 Gbps */ > +#define ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */ 100G is coming, should we define it here? > + > +/** > * A structure used to retrieve link-level information of an Ethernet po= rt. > */ > struct rte_eth_link { > - uint16_t link_speed; /**< ETH_LINK_SPEED_[10, 100, 1000, 10000] > */ > + uint16_t link_speed; /**< ETH_SPEED_NUM_ */ > 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 *= / >=20 > -#define ETH_LINK_SPEED_AUTONEG 0 /**< Auto-negotiate link speed. > */ > -#define ETH_LINK_SPEED_10 10 /**< 10 megabits/second. */ > -#define ETH_LINK_SPEED_100 100 /**< 100 megabits/second. */ > -#define ETH_LINK_SPEED_1000 1000 /**< 1 gigabits/second. */ > -#define ETH_LINK_SPEED_10000 10000 /**< 10 gigabits/second. */ > -#define ETH_LINK_SPEED_10G 10000 /**< alias of 10 gigabits/second= . > */ > -#define ETH_LINK_SPEED_20G 20000 /**< 20 gigabits/second. */ > -#define ETH_LINK_SPEED_40G 40000 /**< 40 gigabits/second. */ > - > /* Utility constants */ > #define ETH_LINK_AUTONEG_DUPLEX 0 /**< Auto-negotiate duplex. */ > #define ETH_LINK_HALF_DUPLEX 1 /**< Half-duplex connection. */ > @@ -779,7 +786,7 @@ struct rte_intr_conf { > */ > struct rte_eth_conf { > uint16_t link_speed; 100G support? Uint16_t -> uint32_t to support 100G? Thanks, /Helin > - /**< ETH_LINK_SPEED_10[0|00|000], or 0 for autonegotation */ > + /**< ETH_SPEED_NUM_ or 0 for autonegotiation */ > uint16_t link_duplex; > /**< ETH_LINK_[HALF_DUPLEX|FULL_DUPLEX], or 0 for > autonegotation */ > struct rte_eth_rxmode rxmode; /**< Port RX configuration. */ > -- > 2.7.0