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__
11 #include <rte_common.h>
13 #define RTE_GRAPH_IP4_REWRITE_MAX_NH 64
14 #define RTE_GRAPH_IP4_REWRITE_MAX_LEN 56
19 * Ipv4 rewrite next hop header data structure. Used to store port specific
22 struct ip4_rewrite_nh_header {
23 uint16_t rewrite_len; /**< Header rewrite length. */
24 uint16_t tx_node; /**< Tx node next index identifier. */
25 uint16_t enabled; /**< NH enable flag */
29 struct rte_ether_addr dst;
30 /**< Destination mac address. */
31 struct rte_ether_addr src;
32 /**< Source mac address. */
34 uint8_t rewrite_data[RTE_GRAPH_IP4_REWRITE_MAX_LEN];
35 /**< Generic rewrite data */
42 * Ipv4 node main data structure.
44 struct ip4_rewrite_node_main {
45 struct ip4_rewrite_nh_header nh[RTE_GRAPH_IP4_REWRITE_MAX_NH];
46 /**< Array of next hop header data */
47 uint16_t next_index[RTE_MAX_ETHPORTS];
48 /**< Next index of each configured port. */
54 * Get the ipv4 rewrite node.
57 * Pointer to the ipv4 rewrite node.
59 struct rte_node_register *ip4_rewrite_node_get(void);
64 * Set the Edge index of a given port_id.
67 * Ethernet port identifier.
69 * Edge index of the Given Tx node.
71 int ip4_rewrite_set_next(uint16_t port_id, uint16_t next_index);
77 #endif /* __INCLUDE_IP4_REWRITE_PRIV_H__ */