DPDK  18.05.1
rte_eth_bond_alb.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4 
5 #ifndef RTE_ETH_BOND_ALB_H_
6 #define RTE_ETH_BOND_ALB_H_
7 
8 #include <rte_ether.h>
9 #include <rte_arp.h>
10 
11 #define ALB_HASH_TABLE_SIZE 256
12 #define ALB_NULL_INDEX 0xFFFFFFFF
13 
14 struct client_data {
16  struct ether_addr app_mac;
18  uint32_t app_ip;
20  struct ether_addr cli_mac;
22  uint32_t cli_ip;
25  uint16_t slave_idx;
27  uint8_t in_use;
29  uint8_t ntt;
32  struct vlan_hdr vlan[2];
34  uint8_t vlan_count;
36 };
37 
38 struct mode_alb_private {
39  struct client_data client_table[ALB_HASH_TABLE_SIZE];
41  struct rte_mempool *mempool;
43  uint8_t ntt;
45  uint32_t last_slave;
47  rte_spinlock_t lock;
48 };
49 
58 int
59 bond_mode_alb_enable(struct rte_eth_dev *bond_dev);
60 
70 void
71 bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,
72  struct bond_dev_private *internals);
73 
87 uint16_t
88 bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
89  struct bond_dev_private *internals);
90 
101 uint16_t
102 bond_mode_alb_arp_upd(struct client_data *client_info,
103  struct rte_mbuf *pkt, struct bond_dev_private *internals);
104 
110 void
111 bond_mode_alb_client_list_upd(struct rte_eth_dev *bond_dev);
112 
113 #endif /* RTE_ETH_BOND_ALB_H_ */