All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/bonding: fix setting default aggregator mode to stable
@ 2017-10-20 14:32 Daniel Mrzyglod
  2017-11-01 17:20 ` Jastrzebski, MichalX K
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Mrzyglod @ 2017-10-20 14:32 UTC (permalink / raw)
  To: declan.doherty; +Cc: dev, Daniel Mrzyglod

This patch change default aggregator  mode to stable
when using rte_eth_bond_create()

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 3fbc1b123..df20349d7 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2841,6 +2841,7 @@ bond_probe(struct rte_vdev_device *dev)
 	struct rte_kvargs *kvlist;
 	uint8_t bonding_mode, socket_id/*, agg_mode*/;
 	int  arg_count, port_id;
+	uint8_t agg_mode;
 
 	if (!dev)
 		return -EINVAL;
@@ -2898,6 +2899,25 @@ bond_probe(struct rte_vdev_device *dev)
 	internals = rte_eth_devices[port_id].data->dev_private;
 	internals->kvlist = kvlist;
 
+
+	if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) {
+		if (rte_kvargs_process(kvlist,
+				PMD_BOND_AGG_MODE_KVARG,
+				&bond_ethdev_parse_slave_agg_mode_kvarg,
+				&agg_mode) != 0) {
+			RTE_LOG(ERR, EAL,
+					"Failed to parse agg selection mode for bonded device %s\n",
+					name);
+			goto parse_error;
+		}
+
+		if (internals->mode == BONDING_MODE_8023AD)
+			rte_eth_bond_8023ad_agg_selection_set(port_id,
+					agg_mode);
+	} else {
+		rte_eth_bond_8023ad_agg_selection_set(port_id, AGG_STABLE);
+	}
+
 	RTE_LOG(INFO, EAL, "Create bonded device %s on port %d in mode %u on "
 			"socket %u.\n",	name, port_id, bonding_mode, socket_id);
 	return 0;
@@ -3064,7 +3084,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
 					name);
 		}
 		if (internals->mode == BONDING_MODE_8023AD)
-			if (agg_mode != 0)
 				rte_eth_bond_8023ad_agg_selection_set(port_id,
 						agg_mode);
 	}
-- 
2.13.6

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

* Re: [PATCH] net/bonding: fix setting default aggregator mode to stable
  2017-10-20 14:32 [PATCH] net/bonding: fix setting default aggregator mode to stable Daniel Mrzyglod
@ 2017-11-01 17:20 ` Jastrzebski, MichalX K
  2017-11-01 20:13   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Jastrzebski, MichalX K @ 2017-11-01 17:20 UTC (permalink / raw)
  To: Mrzyglod, DanielX T, Doherty, Declan
  Cc: dev, Mrzyglod, DanielX T, Jain, Deepak K

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Daniel Mrzyglod
> Sent: Friday, October 20, 2017 4:33 PM
> To: Doherty, Declan <declan.doherty@intel.com>
> Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
> Subject: [dpdk-dev] [PATCH] net/bonding: fix setting default aggregator
> mode to stable
> 
> This patch change default aggregator  mode to stable
> when using rte_eth_bond_create()
> 
> Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 3fbc1b123..df20349d7 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -2841,6 +2841,7 @@ bond_probe(struct rte_vdev_device *dev)
>  	struct rte_kvargs *kvlist;
>  	uint8_t bonding_mode, socket_id/*, agg_mode*/;
>  	int  arg_count, port_id;
> +	uint8_t agg_mode;
> 
>  	if (!dev)
>  		return -EINVAL;
> @@ -2898,6 +2899,25 @@ bond_probe(struct rte_vdev_device *dev)
>  	internals = rte_eth_devices[port_id].data->dev_private;
>  	internals->kvlist = kvlist;
> 
> +
> +	if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1)
> {
> +		if (rte_kvargs_process(kvlist,
> +				PMD_BOND_AGG_MODE_KVARG,
> +
> 	&bond_ethdev_parse_slave_agg_mode_kvarg,
> +				&agg_mode) != 0) {
> +			RTE_LOG(ERR, EAL,
> +					"Failed to parse agg selection mode
> for bonded device %s\n",
> +					name);
> +			goto parse_error;
> +		}
> +
> +		if (internals->mode == BONDING_MODE_8023AD)
> +			rte_eth_bond_8023ad_agg_selection_set(port_id,
> +					agg_mode);
> +	} else {
> +		rte_eth_bond_8023ad_agg_selection_set(port_id,
> AGG_STABLE);
> +	}
> +
>  	RTE_LOG(INFO, EAL, "Create bonded device %s on port %d in mode
> %u on "
>  			"socket %u.\n",	name, port_id,
> bonding_mode, socket_id);
>  	return 0;
> @@ -3064,7 +3084,6 @@ bond_ethdev_configure(struct rte_eth_dev
> *dev)
>  					name);
>  		}
>  		if (internals->mode == BONDING_MODE_8023AD)
> -			if (agg_mode != 0)
> 
> 	rte_eth_bond_8023ad_agg_selection_set(port_id,
>  						agg_mode);
>  	}
> --
> 2.13.6

Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

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

* Re: [PATCH] net/bonding: fix setting default aggregator mode to stable
  2017-11-01 17:20 ` Jastrzebski, MichalX K
@ 2017-11-01 20:13   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-11-01 20:13 UTC (permalink / raw)
  To: Jastrzebski, MichalX K, Mrzyglod, DanielX T, Doherty, Declan
  Cc: dev, Jain, Deepak K

On 11/1/2017 10:20 AM, Jastrzebski, MichalX K wrote:
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Daniel Mrzyglod
>> Sent: Friday, October 20, 2017 4:33 PM
>> To: Doherty, Declan <declan.doherty@intel.com>
>> Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
>> Subject: [dpdk-dev] [PATCH] net/bonding: fix setting default aggregator
>> mode to stable
>>
>> This patch change default aggregator  mode to stable
>> when using rte_eth_bond_create()
>>
>> Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
>>
>> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>

> Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

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

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

end of thread, other threads:[~2017-11-01 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 14:32 [PATCH] net/bonding: fix setting default aggregator mode to stable Daniel Mrzyglod
2017-11-01 17:20 ` Jastrzebski, MichalX K
2017-11-01 20:13   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.