patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/failsafe: report minimum and maximum MTU in device info
@ 2020-12-22  8:51 Andrew Rybchenko
  2021-02-22 15:28 ` Gaëtan Rivet
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Rybchenko @ 2020-12-22  8:51 UTC (permalink / raw)
  To: dev
  Cc: stable, Gaetan Rivet, Andrew Rybchenko, Ian Stokes,
	Stephen Hemminger, Ferruh Yigit

Take minimum and maximum MTU values for subdevices and
report maximum of minimums and minimum of maximums.

Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/failsafe/failsafe_ops.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 76d64871b4..5e6fb369e1 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -1095,6 +1095,8 @@ static void
 fs_dev_merge_info(struct rte_eth_dev_info *info,
 		  const struct rte_eth_dev_info *sinfo)
 {
+	info->min_mtu = RTE_MAX(info->min_mtu, sinfo->min_mtu);
+	info->max_mtu = RTE_MIN(info->max_mtu, sinfo->max_mtu);
 	info->max_rx_pktlen = RTE_MIN(info->max_rx_pktlen, sinfo->max_rx_pktlen);
 	info->max_rx_queues = RTE_MIN(info->max_rx_queues, sinfo->max_rx_queues);
 	info->max_tx_queues = RTE_MIN(info->max_tx_queues, sinfo->max_tx_queues);
@@ -1172,6 +1174,8 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 	int ret;
 
 	/* Use maximum upper bounds by default */
+	infos->min_mtu = RTE_ETHER_MIN_MTU;
+	infos->max_mtu = UINT16_MAX;
 	infos->max_rx_pktlen = UINT32_MAX;
 	infos->max_rx_queues = RTE_MAX_QUEUES_PER_PORT;
 	infos->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;
-- 
2.29.2


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

* Re: [dpdk-stable]  [PATCH] net/failsafe: report minimum and maximum MTU in device info
  2020-12-22  8:51 [dpdk-stable] [PATCH] net/failsafe: report minimum and maximum MTU in device info Andrew Rybchenko
@ 2021-02-22 15:28 ` Gaëtan Rivet
  2021-02-22 16:44   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Gaëtan Rivet @ 2021-02-22 15:28 UTC (permalink / raw)
  To: Andrew Rybchenko, dev
  Cc: stable, Andrew Rybchenko, Ian Stokes, Stephen Hemminger, Ferruh Yigit

On Tue, Dec 22, 2020, at 08:51, Andrew Rybchenko wrote:
> Take minimum and maximum MTU values for subdevices and
> report maximum of minimums and minimum of maximums.
> 
> Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>  drivers/net/failsafe/failsafe_ops.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/failsafe/failsafe_ops.c 
> b/drivers/net/failsafe/failsafe_ops.c
> index 76d64871b4..5e6fb369e1 100644
> --- a/drivers/net/failsafe/failsafe_ops.c
> +++ b/drivers/net/failsafe/failsafe_ops.c
> @@ -1095,6 +1095,8 @@ static void
>  fs_dev_merge_info(struct rte_eth_dev_info *info,
>  		  const struct rte_eth_dev_info *sinfo)
>  {
> +	info->min_mtu = RTE_MAX(info->min_mtu, sinfo->min_mtu);
> +	info->max_mtu = RTE_MIN(info->max_mtu, sinfo->max_mtu);
>  	info->max_rx_pktlen = RTE_MIN(info->max_rx_pktlen, 
> sinfo->max_rx_pktlen);
>  	info->max_rx_queues = RTE_MIN(info->max_rx_queues, 
> sinfo->max_rx_queues);
>  	info->max_tx_queues = RTE_MIN(info->max_tx_queues, 
> sinfo->max_tx_queues);
> @@ -1172,6 +1174,8 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
>  	int ret;
>  
>  	/* Use maximum upper bounds by default */
> +	infos->min_mtu = RTE_ETHER_MIN_MTU;
> +	infos->max_mtu = UINT16_MAX;
>  	infos->max_rx_pktlen = UINT32_MAX;
>  	infos->max_rx_queues = RTE_MAX_QUEUES_PER_PORT;
>  	infos->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;
> -- 
> 2.29.2
> 
>

Hi Andrew,

Sorry, I missed this patch before.
It looks ok to me:

Acked-by: Gaetan Rivet <grive@u256.net>

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

* Re: [dpdk-stable] [PATCH] net/failsafe: report minimum and maximum MTU in device info
  2021-02-22 15:28 ` Gaëtan Rivet
@ 2021-02-22 16:44   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2021-02-22 16:44 UTC (permalink / raw)
  To: Gaëtan Rivet, Andrew Rybchenko, dev
  Cc: stable, Andrew Rybchenko, Ian Stokes, Stephen Hemminger

On 2/22/2021 3:28 PM, Gaëtan Rivet wrote:
> On Tue, Dec 22, 2020, at 08:51, Andrew Rybchenko wrote:
>> Take minimum and maximum MTU values for subdevices and
>> report maximum of minimums and minimum of maximums.
>>
>> Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 
> Acked-by: Gaetan Rivet <grive@u256.net>
> 

Applied to dpdk-next-net/main, thanks.

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

end of thread, other threads:[~2021-02-22 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22  8:51 [dpdk-stable] [PATCH] net/failsafe: report minimum and maximum MTU in device info Andrew Rybchenko
2021-02-22 15:28 ` Gaëtan Rivet
2021-02-22 16:44   ` Ferruh Yigit

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git