Skip to contentSkip to conversation

net/bond: burst mode hash calculation

PATCH Superseded Declan Doherty 2 participants 4 messages Dec 1, 2017 – Jan 10, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bond: burst mode hash calculation

change the xmit_hash functions to handle bursts of packet instead of packet at a time. Updating effect tx_burst functions.

---
 drivers/net/bonding/rte_eth_bond_api.c     |   3 -
 drivers/net/bonding/rte_eth_bond_pmd.c     | 582 ++++++++++++++++++-----------
 drivers/net/bonding/rte_eth_bond_private.h |  22 +-
 3 files changed, 376 insertions(+), 231 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +0 -3
index 980e636..60f5c9c 100644
@@ -667,15 +667,12 @@ rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy)
 	switch (policy) {
 	case BALANCE_XMIT_POLICY_LAYER2:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l2_hash;
 		break;
 	case BALANCE_XMIT_POLICY_LAYER23:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l23_hash;
 		break;
 	case BALANCE_XMIT_POLICY_LAYER34:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l34_hash;
 		break;
 
 	default:
drivers/net/bonding/rte_eth_bond_pmd.c +363 -219

709 lines not on this page · raw message

drivers/net/bonding/rte_eth_bond_private.h +13 -9
index 1392da9..3dc2e5a 100644
@@ -109,8 +109,8 @@ struct bond_slave_details {
 	uint16_t reta_size;
 };
 
-
-typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count);
+typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
 /** Link Bonding PMD device private configuration Structure */
 struct bond_dev_private {
@@ -126,7 +126,7 @@ struct bond_dev_private {
 
 	uint8_t balance_xmit_policy;
 	/**< Transmit policy - l2 / l23 / l34 for operation in balance mode */
-	xmit_hash_t xmit_hash;
+	burst_xmit_hash_t burst_xmit_hash;
 	/**< Transmit policy hash function */
 
 	uint8_t user_defined_mac;
@@ -245,14 +245,18 @@ void
 slave_add(struct bond_dev_private *internals,
 		struct rte_eth_dev *slave_eth_dev);
 
-uint16_t
-xmit_l2_hash(const struct rte_mbuf *buf, uint8_t slave_count);
+void
+burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
-uint16_t
-xmit_l23_hash(const struct rte_mbuf *buf, uint8_t slave_count);
+void
+burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
+
+void
+burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
-uint16_t
-xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count);
 
 void
 bond_ethdev_primary_set(struct bond_dev_private *internals,
Signature · 1 line
2.9.4
#1 lore raw
Quoted 5 lines · Declan Doherty

change the xmit_hash functions to handle bursts of packet instead of packet at a time. Updating effect tx_burst functions.

Hi Declan,

Your other patch [1] conflicts with this one, can you please rebase this one on top of next-net?

[1]
d8f42bd5f407 ("net/bonding: do not drop LACPDUs on slaves Tx failure")

#2 lore raw

PATCH v2 1/1 net/bond: burst mode hash calculation

In reply to Declan Doherty

change the xmit_hash functions to handle bursts of packet instead of single packets at a time, and update the affected tx_burst functions.

---
V2: rebased to HEAD of next-net

 drivers/net/bonding/rte_eth_bond_api.c     |   3 -
 drivers/net/bonding/rte_eth_bond_pmd.c     | 580 ++++++++++++++++++-----------
 drivers/net/bonding/rte_eth_bond_private.h |  22 +-
 3 files changed, 369 insertions(+), 236 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +0 -3
index 703bb39..ed880cd 100644
@@ -694,15 +694,12 @@ rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy)
 	switch (policy) {
 	case BALANCE_XMIT_POLICY_LAYER2:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l2_hash;
 		break;
 	case BALANCE_XMIT_POLICY_LAYER23:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l23_hash;
 		break;
 	case BALANCE_XMIT_POLICY_LAYER34:
 		internals->balance_xmit_policy = policy;
-		internals->xmit_hash = xmit_l34_hash;
 		break;
 
 	default:
drivers/net/bonding/rte_eth_bond_pmd.c +356 -224

713 lines not on this page · raw message

drivers/net/bonding/rte_eth_bond_private.h +13 -9
index a5cfa6a..3ee8edc 100644
@@ -109,8 +109,8 @@ struct bond_slave_details {
 	uint16_t reta_size;
 };
 
-
-typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count);
+typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
 /** Link Bonding PMD device private configuration Structure */
 struct bond_dev_private {
@@ -126,7 +126,7 @@ struct bond_dev_private {
 
 	uint8_t balance_xmit_policy;
 	/**< Transmit policy - l2 / l23 / l34 for operation in balance mode */
-	xmit_hash_t xmit_hash;
+	burst_xmit_hash_t burst_xmit_hash;
 	/**< Transmit policy hash function */
 
 	uint8_t user_defined_mac;
@@ -248,14 +248,18 @@ void
 slave_add(struct bond_dev_private *internals,
 		struct rte_eth_dev *slave_eth_dev);
 
-uint16_t
-xmit_l2_hash(const struct rte_mbuf *buf, uint8_t slave_count);
+void
+burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
-uint16_t
-xmit_l23_hash(const struct rte_mbuf *buf, uint8_t slave_count);
+void
+burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
+
+void
+burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
+		uint8_t slave_count, uint16_t *slaves);
 
-uint16_t
-xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count);
 
 void
 bond_ethdev_primary_set(struct bond_dev_private *internals,
Signature · 1 line
2.9.4