1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
8 extern uint16_t nb_devices
;
9 extern uint16_t udp_port
;
10 extern uint8_t filter_idx
;
11 extern uint16_t ports
[RTE_MAX_ETHPORTS
];
12 extern struct ether_addr ports_eth_addr
[RTE_MAX_ETHPORTS
];
13 extern uint32_t enable_stats
;
14 extern struct device_statistics dev_statistics
[MAX_DEVICES
];
15 extern uint8_t rx_decap
;
16 extern uint8_t tx_encap
;
18 typedef int (*ol_port_configure_t
)(uint16_t port
,
19 struct rte_mempool
*mbuf_pool
);
21 typedef int (*ol_tunnel_setup_t
)(struct vhost_dev
*vdev
,
24 typedef void (*ol_tunnel_destroy_t
)(struct vhost_dev
*vdev
);
26 typedef int (*ol_tx_handle_t
)(uint16_t port_id
, uint16_t queue_id
,
27 struct rte_mbuf
**tx_pkts
, uint16_t nb_pkts
);
29 typedef int (*ol_rx_handle_t
)(int vid
, struct rte_mbuf
**pkts
,
32 typedef int (*ol_param_handle
)(int vid
);
34 struct ol_switch_ops
{
35 ol_port_configure_t port_configure
;
36 ol_tunnel_setup_t tunnel_setup
;
37 ol_tunnel_destroy_t tunnel_destroy
;
38 ol_tx_handle_t tx_handle
;
39 ol_rx_handle_t rx_handle
;
40 ol_param_handle param_handle
;
44 vxlan_port_init(uint16_t port
, struct rte_mempool
*mbuf_pool
);
47 vxlan_link(struct vhost_dev
*vdev
, struct rte_mbuf
*m
);
50 vxlan_unlink(struct vhost_dev
*vdev
);
53 vxlan_tx_pkts(uint16_t port_id
, uint16_t queue_id
,
54 struct rte_mbuf
**tx_pkts
, uint16_t nb_pkts
);
56 vxlan_rx_pkts(int vid
, struct rte_mbuf
**pkts
, uint32_t count
);
58 #endif /* VXLAN_SETUP_H_ */