DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT
@ 2014-10-22 10:28 Declan Doherty
  2014-10-22 10:47 ` De Lara Guarch, Pablo
  2014-10-22 12:59 ` [dpdk-dev] [PATCH v2] " Declan Doherty
  0 siblings, 2 replies; 4+ messages in thread
From: Declan Doherty @ 2014-10-22 10:28 UTC (permalink / raw)
  To: dev

Link bonding broadcast mode requires refcnt parameter in the mbuf struct to 
allow efficient transmission of duplicated mbufs on slave ports. 

This patch disables broadcast mode when the complication option RTE_MBUF_REFCNT
is disabled to allow clean building of the bonding library


Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 app/test/test_link_bonding.c            |    9 ++++++++-
 lib/librte_pmd_bond/rte_eth_bond.h      |    3 ++-
 lib/librte_pmd_bond/rte_eth_bond_args.c |    2 ++
 lib/librte_pmd_bond/rte_eth_bond_pmd.c  |   12 ++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index db5b180..214d2a2 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -788,7 +788,10 @@ test_set_bonding_mode(void)
 	int bonding_modes[] = { BONDING_MODE_ROUND_ROBIN,
 							BONDING_MODE_ACTIVE_BACKUP,
 							BONDING_MODE_BALANCE,
-							BONDING_MODE_BROADCAST };
+#ifdef RTE_MBUF_REFCNT
+							BONDING_MODE_BROADCAST
+#endif
+							};
 
 	/* Test supported link bonding modes */
 	for (i = 0; i < (int)RTE_DIM(bonding_modes);	i++) {
@@ -3227,6 +3230,7 @@ test_balance_verify_slave_link_status_change_behaviour(void)
 	return remove_slaves_and_stop_bonded_device();
 }
 
+#ifdef RTE_MBUF_REFCNT
 /** Broadcast Mode Tests */
 
 static int
@@ -3704,6 +3708,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)
 	/* Clean up and remove slaves from bonded device */
 	return remove_slaves_and_stop_bonded_device();
 }
+#endif
 
 static int
 test_reconfigure_bonded_device(void)
@@ -3797,11 +3802,13 @@ static struct unit_test_suite link_bonding_test_suite  = {
 		TEST_CASE(test_balance_verify_promiscuous_enable_disable),
 		TEST_CASE(test_balance_verify_mac_assignment),
 		TEST_CASE(test_balance_verify_slave_link_status_change_behaviour),
+#ifdef RTE_MBUF_REFCNT
 		TEST_CASE(test_broadcast_tx_burst),
 		TEST_CASE(test_broadcast_rx_burst),
 		TEST_CASE(test_broadcast_verify_promiscuous_enable_disable),
 		TEST_CASE(test_broadcast_verify_mac_assignment),
 		TEST_CASE(test_broadcast_verify_slave_link_status_change_behaviour),
+#endif
 		TEST_CASE(test_reconfigure_bonded_device),
 		TEST_CASE(test_close_bonded_device),
 
diff --git a/lib/librte_pmd_bond/rte_eth_bond.h b/lib/librte_pmd_bond/rte_eth_bond.h
index bd59780..344ca1e 100644
--- a/lib/librte_pmd_bond/rte_eth_bond.h
+++ b/lib/librte_pmd_bond/rte_eth_bond.h
@@ -71,11 +71,12 @@ extern "C" {
  * slaves using one of three available transmit policies - l2, l2+3 or l3+4.
  * See BALANCE_XMIT_POLICY macros definitions for further details on transmit
  * policies. */
+#ifdef RTE_MBUF_REFCNT
 #define BONDING_MODE_BROADCAST			(3)
 /**< Broadcast (Mode 3).
  * In this mode all transmitted packets will be transmitted on all available
  * active slaves of the bonded. */
-
+#endif
 /* Balance Mode Transmit Policies */
 #define BALANCE_XMIT_POLICY_LAYER2		(0)
 /**< Layer 2 (Ethernet MAC) */
diff --git a/lib/librte_pmd_bond/rte_eth_bond_args.c b/lib/librte_pmd_bond/rte_eth_bond_args.c
index 11d9816..05a2b07 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_args.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_args.c
@@ -169,7 +169,9 @@ bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused,
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_ACTIVE_BACKUP:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		return 0;
 	default:
 		return -1;
diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index 08d3b5f..147028b 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -61,7 +61,9 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 	switch (internals->mode) {
 	case BONDING_MODE_ROUND_ROBIN:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 	case BONDING_MODE_BALANCE:
 		for (i = 0; i < internals->active_slave_count && nb_pkts; i++) {
 			/* Offset of pointer to *bufs increases as packets are received
@@ -318,6 +320,7 @@ bond_ethdev_tx_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	return num_tx_total;
 }
 
+#ifdef RTE_MBUF_REFCNT
 static uint16_t
 bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 		uint16_t nb_pkts)
@@ -355,6 +358,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 
 	return num_tx_total;
 }
+#endif
 
 void
 link_properties_set(struct rte_eth_dev *bonded_eth_dev,
@@ -431,7 +435,9 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
 	switch (internals->mode) {
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++) {
 			if (mac_address_set(&rte_eth_devices[internals->slaves[i]],
 					bonded_eth_dev->data->mac_addrs)) {
@@ -488,9 +494,11 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)
 	case BONDING_MODE_BALANCE:
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_balance;
 		break;
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_burst_broadcast;
 		break;
+#endif
 	default:
 		return -1;
 	}
@@ -874,7 +882,9 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
 	/* Promiscuous mode is propagated to all slaves */
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++)
 			rte_eth_promiscuous_enable(internals->slaves[i]);
 		break;
@@ -898,7 +908,9 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
 	/* Promiscuous mode is propagated to all slaves */
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++)
 			rte_eth_promiscuous_disable(internals->slaves[i]);
 		break;
-- 
1.7.4.1

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

* Re: [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT
  2014-10-22 10:28 [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT Declan Doherty
@ 2014-10-22 10:47 ` De Lara Guarch, Pablo
  2014-10-22 12:59 ` [dpdk-dev] [PATCH v2] " Declan Doherty
  1 sibling, 0 replies; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2014-10-22 10:47 UTC (permalink / raw)
  To: Doherty, Declan, dev

Hi Declan,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Declan Doherty
> Sent: Wednesday, October 22, 2014 11:29 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is
> built without RTE_MBUF_REFCNT
> 
> Link bonding broadcast mode requires refcnt parameter in the mbuf struct to
> allow efficient transmission of duplicated mbufs on slave ports.
> 
> This patch disables broadcast mode when the complication option
> RTE_MBUF_REFCNT
> is disabled to allow clean building of the bonding library
> 
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> ---
>  app/test/test_link_bonding.c            |    9 ++++++++-
>  lib/librte_pmd_bond/rte_eth_bond.h      |    3 ++-
>  lib/librte_pmd_bond/rte_eth_bond_args.c |    2 ++
>  lib/librte_pmd_bond/rte_eth_bond_pmd.c  |   12 ++++++++++++
>  4 files changed, 24 insertions(+), 2 deletions(-)
> 

As suggested by Thomas in my other patch (disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n),
 it may be useful to include a warning in the link bonding Makefile, letting the user know 
that broadcast mode is disabled due to that option not set.

Thanks,
Pablo

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

* [dpdk-dev] [PATCH v2] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT
  2014-10-22 10:28 [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT Declan Doherty
  2014-10-22 10:47 ` De Lara Guarch, Pablo
@ 2014-10-22 12:59 ` Declan Doherty
  2014-10-22 13:54   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Declan Doherty @ 2014-10-22 12:59 UTC (permalink / raw)
  To: dev

--V2: Adds warning message to makefile, to notify user of disabling of broadcast 
mode 

Link bonding broadcast mode requires refcnt parameter in the mbuf struct to 
allow efficient transmission of duplicated mbufs on slave ports. 

This patch disables broadcast mode when the complication option RTE_MBUF_REFCNT
is disabled to allow clean building of the bonding library


Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 app/test/test_link_bonding.c            |  9 ++++++++-
 lib/librte_pmd_bond/Makefile            |  4 ++++
 lib/librte_pmd_bond/rte_eth_bond.h      |  3 ++-
 lib/librte_pmd_bond/rte_eth_bond_args.c |  2 ++
 lib/librte_pmd_bond/rte_eth_bond_pmd.c  | 12 ++++++++++++
 5 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index db5b180..214d2a2 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -788,7 +788,10 @@ test_set_bonding_mode(void)
 	int bonding_modes[] = { BONDING_MODE_ROUND_ROBIN,
 							BONDING_MODE_ACTIVE_BACKUP,
 							BONDING_MODE_BALANCE,
-							BONDING_MODE_BROADCAST };
+#ifdef RTE_MBUF_REFCNT
+							BONDING_MODE_BROADCAST
+#endif
+							};
 
 	/* Test supported link bonding modes */
 	for (i = 0; i < (int)RTE_DIM(bonding_modes);	i++) {
@@ -3227,6 +3230,7 @@ test_balance_verify_slave_link_status_change_behaviour(void)
 	return remove_slaves_and_stop_bonded_device();
 }
 
+#ifdef RTE_MBUF_REFCNT
 /** Broadcast Mode Tests */
 
 static int
@@ -3704,6 +3708,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)
 	/* Clean up and remove slaves from bonded device */
 	return remove_slaves_and_stop_bonded_device();
 }
+#endif
 
 static int
 test_reconfigure_bonded_device(void)
@@ -3797,11 +3802,13 @@ static struct unit_test_suite link_bonding_test_suite  = {
 		TEST_CASE(test_balance_verify_promiscuous_enable_disable),
 		TEST_CASE(test_balance_verify_mac_assignment),
 		TEST_CASE(test_balance_verify_slave_link_status_change_behaviour),
+#ifdef RTE_MBUF_REFCNT
 		TEST_CASE(test_broadcast_tx_burst),
 		TEST_CASE(test_broadcast_rx_burst),
 		TEST_CASE(test_broadcast_verify_promiscuous_enable_disable),
 		TEST_CASE(test_broadcast_verify_mac_assignment),
 		TEST_CASE(test_broadcast_verify_slave_link_status_change_behaviour),
+#endif
 		TEST_CASE(test_reconfigure_bonded_device),
 		TEST_CASE(test_close_bonded_device),
 
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 953d75e..d4e10bf 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -46,6 +46,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += rte_eth_bond_api.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += rte_eth_bond_pmd.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += rte_eth_bond_args.c
 
+ifeq ($(CONFIG_RTE_MBUF_REFCNT),n)
+$(info WARNING: Link Bonding Broadcast mode is disabled because it needs MBUF_REFCNT.)
+endif
+
 #
 # Export include files
 #
diff --git a/lib/librte_pmd_bond/rte_eth_bond.h b/lib/librte_pmd_bond/rte_eth_bond.h
index bd59780..344ca1e 100644
--- a/lib/librte_pmd_bond/rte_eth_bond.h
+++ b/lib/librte_pmd_bond/rte_eth_bond.h
@@ -71,11 +71,12 @@ extern "C" {
  * slaves using one of three available transmit policies - l2, l2+3 or l3+4.
  * See BALANCE_XMIT_POLICY macros definitions for further details on transmit
  * policies. */
+#ifdef RTE_MBUF_REFCNT
 #define BONDING_MODE_BROADCAST			(3)
 /**< Broadcast (Mode 3).
  * In this mode all transmitted packets will be transmitted on all available
  * active slaves of the bonded. */
-
+#endif
 /* Balance Mode Transmit Policies */
 #define BALANCE_XMIT_POLICY_LAYER2		(0)
 /**< Layer 2 (Ethernet MAC) */
diff --git a/lib/librte_pmd_bond/rte_eth_bond_args.c b/lib/librte_pmd_bond/rte_eth_bond_args.c
index 11d9816..05a2b07 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_args.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_args.c
@@ -169,7 +169,9 @@ bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused,
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_ACTIVE_BACKUP:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		return 0;
 	default:
 		return -1;
diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index 08d3b5f..147028b 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -61,7 +61,9 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 
 	switch (internals->mode) {
 	case BONDING_MODE_ROUND_ROBIN:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 	case BONDING_MODE_BALANCE:
 		for (i = 0; i < internals->active_slave_count && nb_pkts; i++) {
 			/* Offset of pointer to *bufs increases as packets are received
@@ -318,6 +320,7 @@ bond_ethdev_tx_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	return num_tx_total;
 }
 
+#ifdef RTE_MBUF_REFCNT
 static uint16_t
 bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 		uint16_t nb_pkts)
@@ -355,6 +358,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
 
 	return num_tx_total;
 }
+#endif
 
 void
 link_properties_set(struct rte_eth_dev *bonded_eth_dev,
@@ -431,7 +435,9 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
 	switch (internals->mode) {
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++) {
 			if (mac_address_set(&rte_eth_devices[internals->slaves[i]],
 					bonded_eth_dev->data->mac_addrs)) {
@@ -488,9 +494,11 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)
 	case BONDING_MODE_BALANCE:
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_balance;
 		break;
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
 		eth_dev->tx_pkt_burst = bond_ethdev_tx_burst_broadcast;
 		break;
+#endif
 	default:
 		return -1;
 	}
@@ -874,7 +882,9 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
 	/* Promiscuous mode is propagated to all slaves */
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++)
 			rte_eth_promiscuous_enable(internals->slaves[i]);
 		break;
@@ -898,7 +908,9 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
 	/* Promiscuous mode is propagated to all slaves */
 	case BONDING_MODE_ROUND_ROBIN:
 	case BONDING_MODE_BALANCE:
+#ifdef RTE_MBUF_REFCNT
 	case BONDING_MODE_BROADCAST:
+#endif
 		for (i = 0; i < internals->slave_count; i++)
 			rte_eth_promiscuous_disable(internals->slaves[i]);
 		break;
-- 
1.7.12.2

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

* Re: [dpdk-dev] [PATCH v2] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT
  2014-10-22 12:59 ` [dpdk-dev] [PATCH v2] " Declan Doherty
@ 2014-10-22 13:54   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-10-22 13:54 UTC (permalink / raw)
  To: Declan Doherty; +Cc: dev

> --V2: Adds warning message to makefile, to notify user of disabling of broadcast 
> mode 
> 
> Link bonding broadcast mode requires refcnt parameter in the mbuf struct to 
> allow efficient transmission of duplicated mbufs on slave ports. 
> 
> This patch disables broadcast mode when the complication option RTE_MBUF_REFCNT
> is disabled to allow clean building of the bonding library
> 
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied

Thanks
-- 
Thomas

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

end of thread, other threads:[~2014-10-22 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-22 10:28 [dpdk-dev] [PATCH] bond: disabling broadcast mode when dpdk is built without RTE_MBUF_REFCNT Declan Doherty
2014-10-22 10:47 ` De Lara Guarch, Pablo
2014-10-22 12:59 ` [dpdk-dev] [PATCH v2] " Declan Doherty
2014-10-22 13:54   ` Thomas Monjalon

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).