DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Unknown speed
       [not found] <CGME20200922211823eucas1p1fc3b4e114d4ae830fe3b3f3dba94ac1b@eucas1p1.samsung.com>
@ 2020-09-22 21:18 ` Ivan Dyukov
       [not found]   ` <CGME20200922211829eucas1p19a49c965d453a99fd4bb6f79673413fd@eucas1p1.samsung.com>
       [not found]   ` <CGME20200922211831eucas1p275c488f015668bb7e60eabb29269049e@eucas1p2.samsung.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Ivan Dyukov @ 2020-09-22 21:18 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, zhihong.wang, john.mcnamara,
	marko.kovacevic
  Cc: dev

It's virtio support for 'ETH_SPEED_NUM_UNKNOWN' which was already merged to
dpdk-next-net/main



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed
       [not found]   ` <CGME20200922211829eucas1p19a49c965d453a99fd4bb6f79673413fd@eucas1p1.samsung.com>
@ 2020-09-22 21:18     ` Ivan Dyukov
  2020-09-25 14:35       ` Maxime Coquelin
  2020-09-30 16:17       ` Maxime Coquelin
  0 siblings, 2 replies; 8+ messages in thread
From: Ivan Dyukov @ 2020-09-22 21:18 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, zhihong.wang, john.mcnamara,
	marko.kovacevic
  Cc: dev, Ivan Dyukov

rte_ethdev states new rule for NICs: they should return UNKNOWN
speed if speed is unknown and interface is up, in case of down
interface, NONE speed should be returned.

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
---
 doc/guides/nics/virtio.rst         | 4 ++--
 drivers/net/virtio/virtio_ethdev.c | 9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index 0daf25b22..33ce0c247 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -361,7 +361,7 @@ Below devargs are supported by the PCI virtio driver:
     It is used to specify link speed of virtio device. Link speed is a part of
     link status structure. It could be requested by application using
     rte_eth_link_get_nowait function.
-    (Default: 10000 (10G))
+    (Default: 0xffffffff (Unknown))
 
 #.  ``vectorized``:
 
@@ -422,7 +422,7 @@ Below devargs are supported by the virtio-user vdev:
     It is used to specify link speed of virtio device. Link speed is a part of
     link status structure. It could be requested by application using
     rte_eth_link_get_nowait function.
-    (Default: 10000 (10G))
+    (Default: 0xffffffff (Unknown))
 
 #.  ``vectorized``:
 
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index dc0093bdf..0ef88feda 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1666,7 +1666,6 @@ virtio_configure_intr(struct rte_eth_dev *dev)
 
 	return 0;
 }
-#define SPEED_UNKNOWN    0xffffffff
 #define DUPLEX_UNKNOWN   0xff
 /* reset device and renegotiate features if needed */
 static int
@@ -1723,7 +1722,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 		     hw->mac_addr[0], hw->mac_addr[1], hw->mac_addr[2],
 		     hw->mac_addr[3], hw->mac_addr[4], hw->mac_addr[5]);
 
-	if (hw->speed == SPEED_UNKNOWN) {
+	if (hw->speed == ETH_SPEED_NUM_UNKNOWN) {
 		if (vtpci_with_feature(hw, VIRTIO_NET_F_SPEED_DUPLEX)) {
 			config = &local_config;
 			vtpci_read_dev_config(hw,
@@ -1736,8 +1735,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 			hw->duplex = config->duplex;
 		}
 	}
-	if (hw->speed == SPEED_UNKNOWN)
-		hw->speed = ETH_SPEED_NUM_10G;
 	if (hw->duplex == DUPLEX_UNKNOWN)
 		hw->duplex = ETH_LINK_FULL_DUPLEX;
 	PMD_INIT_LOG(DEBUG, "link speed = %d, duplex = %d",
@@ -1889,7 +1886,7 @@ int
 eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct virtio_hw *hw = eth_dev->data->dev_private;
-	uint32_t speed = SPEED_UNKNOWN;
+	uint32_t speed = ETH_SPEED_NUM_UNKNOWN;
 	int vectorized = 0;
 	int ret;
 
@@ -2552,6 +2549,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet
 
 	if (!hw->started) {
 		link.link_status = ETH_LINK_DOWN;
+		link.link_speed = ETH_SPEED_NUM_NONE;
 	} else if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) {
 		PMD_INIT_LOG(DEBUG, "Get link status from hw");
 		vtpci_read_dev_config(hw,
@@ -2559,6 +2557,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet
 				&status, sizeof(status));
 		if ((status & VIRTIO_NET_S_LINK_UP) == 0) {
 			link.link_status = ETH_LINK_DOWN;
+			link.link_speed = ETH_SPEED_NUM_NONE;
 			PMD_INIT_LOG(DEBUG, "Port %d is down",
 				     dev->data->port_id);
 		} else {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev
       [not found]   ` <CGME20200922211831eucas1p275c488f015668bb7e60eabb29269049e@eucas1p2.samsung.com>
@ 2020-09-22 21:18     ` Ivan Dyukov
  2020-09-25 14:35       ` Maxime Coquelin
  2020-09-30 16:18       ` Maxime Coquelin
  0 siblings, 2 replies; 8+ messages in thread
From: Ivan Dyukov @ 2020-09-22 21:18 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, zhihong.wang, john.mcnamara,
	marko.kovacevic
  Cc: dev, Ivan Dyukov

ethdev library was updated with new speed 200G

Add 200G speed capa to virtio device

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 0ef88feda..46ecc14a1 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2032,6 +2032,8 @@ virtio_dev_speed_capa_get(uint32_t speed)
 		return ETH_LINK_SPEED_56G;
 	case ETH_SPEED_NUM_100G:
 		return ETH_LINK_SPEED_100G;
+	case ETH_SPEED_NUM_200G:
+		return ETH_LINK_SPEED_200G;
 	default:
 		return 0;
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed
  2020-09-22 21:18     ` [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed Ivan Dyukov
@ 2020-09-25 14:35       ` Maxime Coquelin
  2020-09-25 14:48         ` David Marchand
  2020-09-30 16:17       ` Maxime Coquelin
  1 sibling, 1 reply; 8+ messages in thread
From: Maxime Coquelin @ 2020-09-25 14:35 UTC (permalink / raw)
  To: Ivan Dyukov, chenbo.xia, zhihong.wang, john.mcnamara, marko.kovacevic; +Cc: dev

Hi Ivan,

On 9/22/20 11:18 PM, Ivan Dyukov wrote:
> rte_ethdev states new rule for NICs: they should return UNKNOWN
> speed if speed is unknown and interface is up, in case of down
> interface, NONE speed should be returned.
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>  doc/guides/nics/virtio.rst         | 4 ++--
>  drivers/net/virtio/virtio_ethdev.c | 9 ++++-----
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 

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

ps: CI reports build failure, but it builds when applied on top of
latest next-net.

Thanks!
Maxime


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev
  2020-09-22 21:18     ` [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev Ivan Dyukov
@ 2020-09-25 14:35       ` Maxime Coquelin
  2020-09-30 16:18       ` Maxime Coquelin
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-09-25 14:35 UTC (permalink / raw)
  To: Ivan Dyukov, chenbo.xia, zhihong.wang, john.mcnamara, marko.kovacevic; +Cc: dev



On 9/22/20 11:18 PM, Ivan Dyukov wrote:
> ethdev library was updated with new speed 200G
> 
> Add 200G speed capa to virtio device
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 0ef88feda..46ecc14a1 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -2032,6 +2032,8 @@ virtio_dev_speed_capa_get(uint32_t speed)
>  		return ETH_LINK_SPEED_56G;
>  	case ETH_SPEED_NUM_100G:
>  		return ETH_LINK_SPEED_100G;
> +	case ETH_SPEED_NUM_200G:
> +		return ETH_LINK_SPEED_200G;
>  	default:
>  		return 0;
>  	}
> 

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed
  2020-09-25 14:35       ` Maxime Coquelin
@ 2020-09-25 14:48         ` David Marchand
  0 siblings, 0 replies; 8+ messages in thread
From: David Marchand @ 2020-09-25 14:48 UTC (permalink / raw)
  To: Maxime Coquelin
  Cc: Ivan Dyukov, Xia, Chenbo, Zhihong Wang, Mcnamara, John,
	Kovacevic, Marko, dev

On Fri, Sep 25, 2020 at 4:36 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
> On 9/22/20 11:18 PM, Ivan Dyukov wrote:
> > rte_ethdev states new rule for NICs: they should return UNKNOWN
> > speed if speed is unknown and interface is up, in case of down
> > interface, NONE speed should be returned.
> >
> > Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> > ---
> >  doc/guides/nics/virtio.rst         | 4 ++--
> >  drivers/net/virtio/virtio_ethdev.c | 9 ++++-----
> >  2 files changed, 6 insertions(+), 7 deletions(-)
> >
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> ps: CI reports build failure, but it builds when applied on top of
> latest next-net.

You scared me :-).

Applied on: CommitID:89f6a4be217f22f7592b616d5d69c775530dce88
DPDK git baseline: Repo:dpdk-next-virtio, CommitID:
89f6a4be217f22f7592b616d5d69c775530dce88

The patches just hit the list before you aligned next-virtio to next-net.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed
  2020-09-22 21:18     ` [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed Ivan Dyukov
  2020-09-25 14:35       ` Maxime Coquelin
@ 2020-09-30 16:17       ` Maxime Coquelin
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-09-30 16:17 UTC (permalink / raw)
  To: Ivan Dyukov, chenbo.xia, zhihong.wang, john.mcnamara, marko.kovacevic; +Cc: dev



On 9/22/20 11:18 PM, Ivan Dyukov wrote:
> rte_ethdev states new rule for NICs: they should return UNKNOWN
> speed if speed is unknown and interface is up, in case of down
> interface, NONE speed should be returned.
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>  doc/guides/nics/virtio.rst         | 4 ++--
>  drivers/net/virtio/virtio_ethdev.c | 9 ++++-----
>  2 files changed, 6 insertions(+), 7 deletions(-)

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev
  2020-09-22 21:18     ` [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev Ivan Dyukov
  2020-09-25 14:35       ` Maxime Coquelin
@ 2020-09-30 16:18       ` Maxime Coquelin
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2020-09-30 16:18 UTC (permalink / raw)
  To: Ivan Dyukov, chenbo.xia, zhihong.wang, john.mcnamara, marko.kovacevic; +Cc: dev



On 9/22/20 11:18 PM, Ivan Dyukov wrote:
> ethdev library was updated with new speed 200G
> 
> Add 200G speed capa to virtio device
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-30 16:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200922211823eucas1p1fc3b4e114d4ae830fe3b3f3dba94ac1b@eucas1p1.samsung.com>
2020-09-22 21:18 ` [dpdk-dev] Unknown speed Ivan Dyukov
     [not found]   ` <CGME20200922211829eucas1p19a49c965d453a99fd4bb6f79673413fd@eucas1p1.samsung.com>
2020-09-22 21:18     ` [dpdk-dev] [PATCH 1/2] net/virtio: set UNKNOWN as default speed Ivan Dyukov
2020-09-25 14:35       ` Maxime Coquelin
2020-09-25 14:48         ` David Marchand
2020-09-30 16:17       ` Maxime Coquelin
     [not found]   ` <CGME20200922211831eucas1p275c488f015668bb7e60eabb29269049e@eucas1p2.samsung.com>
2020-09-22 21:18     ` [dpdk-dev] [PATCH 2/2] net/virtio: sync a virtio speed capa with ethdev Ivan Dyukov
2020-09-25 14:35       ` Maxime Coquelin
2020-09-30 16:18       ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).