[v6,07/14] net/bonding: create new rte flow header file
Checks
Commit Message
From: Long Wu <long.wu@corigine.com>
Move the flow code to a new head file to make flow related
code more clean and make the code architecture more reasonable
in the future. There is no functional change, just moving
verbatim code around.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: James Hershaw <james.hershaw@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/bonding/eth_bond_private.h | 13 -------------
drivers/net/bonding/rte_eth_bond_api.c | 1 +
drivers/net/bonding/rte_eth_bond_flow.c | 1 +
drivers/net/bonding/rte_eth_bond_flow.h | 22 ++++++++++++++++++++++
drivers/net/bonding/rte_eth_bond_pmd.c | 1 +
5 files changed, 25 insertions(+), 13 deletions(-)
create mode 100644 drivers/net/bonding/rte_eth_bond_flow.h
@@ -9,10 +9,8 @@
#include <sys/queue.h>
#include <ethdev_driver.h>
-#include <rte_flow.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
-#include <rte_flow_driver.h>
#include "rte_eth_bond.h"
#include "eth_bond_8023ad_private.h"
@@ -47,8 +45,6 @@ extern const char *pmd_bond_init_valid_arguments[];
extern struct rte_vdev_driver pmd_bond_drv;
-extern const struct rte_flow_ops bond_flow_ops;
-
/** Port Queue Mapping Structure */
struct bond_rx_queue {
uint16_t queue_id;
@@ -94,15 +90,6 @@ struct bond_member_details {
uint16_t reta_size;
};
-struct rte_flow {
- TAILQ_ENTRY(rte_flow) next;
- /* Members flows */
- struct rte_flow *flows[RTE_MAX_ETHPORTS];
- /* Flow description for synchronization */
- struct rte_flow_conv_rule rule;
- uint8_t rule_data[];
-};
-
typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts,
uint16_t member_count, uint16_t *members);
@@ -12,6 +12,7 @@
#include <rte_kvargs.h>
#include "rte_eth_bond.h"
+#include "rte_eth_bond_flow.h"
#include "eth_bond_private.h"
#include "eth_bond_8023ad_private.h"
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2018 Mellanox Technologies, Ltd
*/
+#include "rte_eth_bond_flow.h"
#include <stddef.h>
#include <string.h>
new file mode 100644
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Corigine, Inc.
+ */
+
+#ifndef _RTE_ETH_BOND_FLOW_H_
+#define _RTE_ETH_BOND_FLOW_H_
+
+#include <rte_flow.h>
+#include <rte_flow_driver.h>
+
+extern const struct rte_flow_ops bond_flow_ops;
+
+struct rte_flow {
+ TAILQ_ENTRY(rte_flow) next;
+ struct rte_flow *flows[RTE_MAX_ETHPORTS];
+ /**< Member ports flows */
+ struct rte_flow_conv_rule rule;
+ /**< Flow description for synchronization */
+ uint8_t rule_data[];
+};
+
+#endif /* _RTE_ETH_BOND_FLOW_H_ */
@@ -21,6 +21,7 @@
#include <rte_string_fns.h>
#include "rte_eth_bond.h"
+#include "rte_eth_bond_flow.h"
#include "eth_bond_private.h"
#include "eth_bond_8023ad_private.h"