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++) {
return remove_slaves_and_stop_bonded_device();
}
+#ifdef RTE_MBUF_REFCNT
/** Broadcast Mode Tests */
static int
/* Clean up and remove slaves from bonded device */
return remove_slaves_and_stop_bonded_device();
}
+#endif
static int
test_reconfigure_bonded_device(void)
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),
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
#
* 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) */
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;
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
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)
return num_tx_total;
}
+#endif
void
link_properties_set(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)) {
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;
}
/* 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;
/* 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;