Re: [ovs-dev] [PATCH v7 3/3] netdev-dpdk: Sync and clean {get, set}_config() callbacks.

2023-11-03 Thread Ilya Maximets
On 10/30/23 10:50, jm...@redhat.com wrote:
> From: Jakob Meng 
> 
> For better usability, the function pairs get_config() and
> set_config() for netdevs should be symmetric: Options which are
> accepted by set_config() should be returned by get_config() and the
> latter should output valid options for set_config() only.
> 
> This patch moves key-value pairs which are no valid options from
> get_config() to the get_status() callback. For example, get_config()
> in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
> previously. For requested rx queues the proper option name is n_rxq,
> so requested_rx_queues has been renamed respectively. Tx queues
> cannot be changed by the user, hence requested_tx_queues has been
> dropped. Both configured_{rx,tx}_queues will be returned as
> n_{r,t}xq in the get_status() callback.
> 
> The netdev dpdk classes no longer share a common get_config() callback,
> instead both the dpdk_class and the dpdk_vhost_client_class define
> their own callbacks. The get_config() callback for dpdk_vhost_class has
> been dropped because it does not have a set_config() callback.
> 
> The documentation in vswitchd/vswitch.xml for status columns as well
> as tests have been updated accordingly.
> 
> Reported-at: https://bugzilla.redhat.com/1949855
> Signed-off-by: Jakob Meng 
> ---
>  Documentation/topics/dpdk/phy.rst |   4 +-
>  NEWS  |   7 ++
>  lib/netdev-dpdk.c | 113 +-
>  tests/system-dpdk.at  |  64 ++---
>  vswitchd/vswitch.xml  |  14 +++-
>  5 files changed, 143 insertions(+), 59 deletions(-)
> 
> diff --git a/Documentation/topics/dpdk/phy.rst 
> b/Documentation/topics/dpdk/phy.rst
> index f66b106c4..41cc3588a 100644
> --- a/Documentation/topics/dpdk/phy.rst
> +++ b/Documentation/topics/dpdk/phy.rst
> @@ -198,7 +198,7 @@ Example::
> a dedicated queue, it will be explicit::
>  
>$ ovs-vsctl get interface dpdk-p0 status
> -  {..., rx_steering=unsupported}
> +  {..., rx-steering=unsupported}
>  
> More details can often be found in ``ovs-vswitchd.log``::
>  
> @@ -499,7 +499,7 @@ its options::
>  
>  $ ovs-appctl dpctl/show
>  [...]
> -  port 3: dpdk-rep0 (dpdk: configured_rx_queues=1, ..., 
> dpdk-vf-mac=00:11:22:33:44:55, ...)
> +  port 3: dpdk-rep0 (dpdk: ..., dpdk-vf-mac=00:11:22:33:44:55, ...)
>  
>  $ ovs-vsctl show
>  [...]
> diff --git a/NEWS b/NEWS
> index 6b45492f1..43aea97b5 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -6,6 +6,13 @@ Post-v3.2.0
> from older version is supported but it may trigger more leader 
> elections
> during the process, and error logs complaining unrecognized fields may
> be observed on old nodes.
> +   - ovs-appctl:
> + * Output of 'dpctl/show' command no longer shows interface configuration
> +   status, only values of the actual configuration options, a.k.a.
> +   'requested' configuration.  The interface configuration status,
> +   a.k.a. 'configured' values, can be found in the 'status' column of
> +   the Interface table, i.e. with 'ovs-vsctl get interface <..> status'.
> +   Reported names adjusted accordingly.
>  
>  
>  v3.2.0 - 17 Aug 2023
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 55700250d..29f2b280d 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -1905,31 +1905,41 @@ netdev_dpdk_get_config(const struct netdev *netdev, 
> struct smap *args)
>  
>  ovs_mutex_lock(>mutex);
>  
> -smap_add_format(args, "requested_rx_queues", "%d", dev->user_n_rxq);
> -smap_add_format(args, "configured_rx_queues", "%d", netdev->n_rxq);
> -smap_add_format(args, "requested_tx_queues", "%d", dev->requested_n_txq);
> -smap_add_format(args, "configured_tx_queues", "%d", netdev->n_txq);
> -smap_add_format(args, "mtu", "%d", dev->mtu);
> +if (dev->devargs && dev->devargs[0]) {
> +smap_add_format(args, "dpdk-devargs", "%s", dev->devargs);
> +}
>  
> -if (dev->type == DPDK_DEV_ETH) {
> -smap_add_format(args, "n_rxq_desc", "%d", dev->rxq_size);
> -smap_add_format(args, "n_txq_desc", "%d", dev->txq_size);
> -if (dev->hw_ol_features & NETDEV_RX_CHECKSUM_OFFLOAD) {
> -smap_add(args, "rx_csum_offload", "true");
> -} else {
> -smap_add(args, "rx_csum_offload", "false");
> -}
> -if (dev->rx_steer_flags == DPDK_RX_STEER_LACP) {
> -smap_add(args, "rx-steering", "rss+lacp");
> -}
> -smap_add(args, "lsc_interrupt_mode",
> - dev->lsc_interrupt_mode ? "true" : "false");
> +smap_add_format(args, "n_rxq", "%d", dev->user_n_rxq);
>  
> -if (dpdk_port_is_representor(dev)) {
> -smap_add_format(args, "dpdk-vf-mac", ETH_ADDR_FMT,
> -ETH_ADDR_ARGS(dev->requested_hwaddr));
> -}
> +if (dev->fc_conf.mode == RTE_ETH_FC_TX_PAUSE ||
> +  

Re: [ovs-dev] [PATCH v7 3/3] netdev-dpdk: Sync and clean {get, set}_config() callbacks.

2023-11-02 Thread Kevin Traynor

On 30/10/2023 09:50, jm...@redhat.com wrote:

From: Jakob Meng

For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.

This patch moves key-value pairs which are no valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.

The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.

The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.

Reported-at:https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng
---
  Documentation/topics/dpdk/phy.rst |   4 +-
  NEWS  |   7 ++
  lib/netdev-dpdk.c | 113 +-
  tests/system-dpdk.at  |  64 ++---
  vswitchd/vswitch.xml  |  14 +++-
  5 files changed, 143 insertions(+), 59 deletions(-)


Acked-by: Kevin Traynor 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v7 3/3] netdev-dpdk: Sync and clean {get, set}_config() callbacks.

2023-10-30 Thread Robin Jarry

, Oct 30, 2023 at 10:50:

From: Jakob Meng 

For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.

This patch moves key-value pairs which are no valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.

The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.

The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.

Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng 


Hi Jakob, this looks good. Thanks!

Reviewed-by: Robin Jarry 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v7 3/3] netdev-dpdk: Sync and clean {get, set}_config() callbacks.

2023-10-30 Thread jmeng
From: Jakob Meng 

For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.

This patch moves key-value pairs which are no valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.

The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.

The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.

Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng 
---
 Documentation/topics/dpdk/phy.rst |   4 +-
 NEWS  |   7 ++
 lib/netdev-dpdk.c | 113 +-
 tests/system-dpdk.at  |  64 ++---
 vswitchd/vswitch.xml  |  14 +++-
 5 files changed, 143 insertions(+), 59 deletions(-)

diff --git a/Documentation/topics/dpdk/phy.rst 
b/Documentation/topics/dpdk/phy.rst
index f66b106c4..41cc3588a 100644
--- a/Documentation/topics/dpdk/phy.rst
+++ b/Documentation/topics/dpdk/phy.rst
@@ -198,7 +198,7 @@ Example::
a dedicated queue, it will be explicit::
 
   $ ovs-vsctl get interface dpdk-p0 status
-  {..., rx_steering=unsupported}
+  {..., rx-steering=unsupported}
 
More details can often be found in ``ovs-vswitchd.log``::
 
@@ -499,7 +499,7 @@ its options::
 
 $ ovs-appctl dpctl/show
 [...]
-  port 3: dpdk-rep0 (dpdk: configured_rx_queues=1, ..., 
dpdk-vf-mac=00:11:22:33:44:55, ...)
+  port 3: dpdk-rep0 (dpdk: ..., dpdk-vf-mac=00:11:22:33:44:55, ...)
 
 $ ovs-vsctl show
 [...]
diff --git a/NEWS b/NEWS
index 6b45492f1..43aea97b5 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,13 @@ Post-v3.2.0
from older version is supported but it may trigger more leader elections
during the process, and error logs complaining unrecognized fields may
be observed on old nodes.
+   - ovs-appctl:
+ * Output of 'dpctl/show' command no longer shows interface configuration
+   status, only values of the actual configuration options, a.k.a.
+   'requested' configuration.  The interface configuration status,
+   a.k.a. 'configured' values, can be found in the 'status' column of
+   the Interface table, i.e. with 'ovs-vsctl get interface <..> status'.
+   Reported names adjusted accordingly.
 
 
 v3.2.0 - 17 Aug 2023
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 55700250d..29f2b280d 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1905,31 +1905,41 @@ netdev_dpdk_get_config(const struct netdev *netdev, 
struct smap *args)
 
 ovs_mutex_lock(>mutex);
 
-smap_add_format(args, "requested_rx_queues", "%d", dev->user_n_rxq);
-smap_add_format(args, "configured_rx_queues", "%d", netdev->n_rxq);
-smap_add_format(args, "requested_tx_queues", "%d", dev->requested_n_txq);
-smap_add_format(args, "configured_tx_queues", "%d", netdev->n_txq);
-smap_add_format(args, "mtu", "%d", dev->mtu);
+if (dev->devargs && dev->devargs[0]) {
+smap_add_format(args, "dpdk-devargs", "%s", dev->devargs);
+}
 
-if (dev->type == DPDK_DEV_ETH) {
-smap_add_format(args, "n_rxq_desc", "%d", dev->rxq_size);
-smap_add_format(args, "n_txq_desc", "%d", dev->txq_size);
-if (dev->hw_ol_features & NETDEV_RX_CHECKSUM_OFFLOAD) {
-smap_add(args, "rx_csum_offload", "true");
-} else {
-smap_add(args, "rx_csum_offload", "false");
-}
-if (dev->rx_steer_flags == DPDK_RX_STEER_LACP) {
-smap_add(args, "rx-steering", "rss+lacp");
-}
-smap_add(args, "lsc_interrupt_mode",
- dev->lsc_interrupt_mode ? "true" : "false");
+smap_add_format(args, "n_rxq", "%d", dev->user_n_rxq);
 
-if (dpdk_port_is_representor(dev)) {
-smap_add_format(args, "dpdk-vf-mac", ETH_ADDR_FMT,
-ETH_ADDR_ARGS(dev->requested_hwaddr));
-}
+if (dev->fc_conf.mode == RTE_ETH_FC_TX_PAUSE ||
+dev->fc_conf.mode == RTE_ETH_FC_FULL) {
+smap_add(args, "rx-flow-ctrl", "true");
 }
+
+if (dev->fc_conf.mode == RTE_ETH_FC_RX_PAUSE ||
+dev->fc_conf.mode == RTE_ETH_FC_FULL) {
+smap_add(args, "tx-flow-ctrl", "true");
+}
+
+if