File: ip4_rewrite_priv.h

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (69 lines) | stat: -rw-r--r-- 1,581 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(C) 2020 Marvell International Ltd.
 */
#ifndef __INCLUDE_IP4_REWRITE_PRIV_H__
#define __INCLUDE_IP4_REWRITE_PRIV_H__

#include <rte_common.h>

#define RTE_GRAPH_IP4_REWRITE_MAX_NH 64
#define RTE_GRAPH_IP4_REWRITE_MAX_LEN 56

/**
 * @internal
 *
 * Ipv4 rewrite next hop header data structure. Used to store port specific
 * rewrite data.
 */
struct ip4_rewrite_nh_header {
	uint16_t rewrite_len; /**< Header rewrite length. */
	uint16_t tx_node;     /**< Tx node next index identifier. */
	uint16_t enabled;     /**< NH enable flag */
	uint16_t rsvd;
	union {
		struct {
			struct rte_ether_addr dst;
			/**< Destination mac address. */
			struct rte_ether_addr src;
			/**< Source mac address. */
		};
		uint8_t rewrite_data[RTE_GRAPH_IP4_REWRITE_MAX_LEN];
		/**< Generic rewrite data */
	};
};

/**
 * @internal
 *
 * Ipv4 node main data structure.
 */
struct ip4_rewrite_node_main {
	struct ip4_rewrite_nh_header nh[RTE_GRAPH_IP4_REWRITE_MAX_NH];
	/**< Array of next hop header data */
	uint16_t next_index[RTE_MAX_ETHPORTS];
	/**< Next index of each configured port. */
};

/**
 * @internal
 *
 * Get the ipv4 rewrite node.
 *
 * @return
 *   Pointer to the ipv4 rewrite node.
 */
struct rte_node_register *ip4_rewrite_node_get(void);

/**
 * @internal
 *
 * Set the Edge index of a given port_id.
 *
 * @param port_id
 *   Ethernet port identifier.
 * @param next_index
 *   Edge index of the Given Tx node.
 */
int ip4_rewrite_set_next(uint16_t port_id, uint16_t next_index);

#endif /* __INCLUDE_IP4_REWRITE_PRIV_H__ */