1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2020 Marvell International Ltd.
4 #ifndef __INCLUDE_IP4_REWRITE_PRIV_H__
5 #define __INCLUDE_IP4_REWRITE_PRIV_H__
7 #include <rte_common.h>
9 #define RTE_GRAPH_IP4_REWRITE_MAX_NH 64
10 #define RTE_GRAPH_IP4_REWRITE_MAX_LEN 56
15 * Ipv4 rewrite next hop header data structure. Used to store port specific
18 struct ip4_rewrite_nh_header {
19 uint16_t rewrite_len; /**< Header rewrite length. */
20 uint16_t tx_node; /**< Tx node next index identifier. */
21 uint16_t enabled; /**< NH enable flag */
25 struct rte_ether_addr dst;
26 /**< Destination mac address. */
27 struct rte_ether_addr src;
28 /**< Source mac address. */
30 uint8_t rewrite_data[RTE_GRAPH_IP4_REWRITE_MAX_LEN];
31 /**< Generic rewrite data */
38 * Ipv4 node main data structure.
40 struct ip4_rewrite_node_main {
41 struct ip4_rewrite_nh_header nh[RTE_GRAPH_IP4_REWRITE_MAX_NH];
42 /**< Array of next hop header data */
43 uint16_t next_index[RTE_MAX_ETHPORTS];
44 /**< Next index of each configured port. */
50 * Get the ipv4 rewrite node.
53 * Pointer to the ipv4 rewrite node.
55 struct rte_node_register *ip4_rewrite_node_get(void);
60 * Set the Edge index of a given port_id.
63 * Ethernet port identifier.
65 * Edge index of the Given Tx node.
67 int ip4_rewrite_set_next(uint16_t port_id, uint16_t next_index);
69 #endif /* __INCLUDE_IP4_REWRITE_PRIV_H__ */