1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2019-2021 Xilinx, Inc.
4 * Copyright(c) 2019 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
10 #ifndef _SFC_REPR_PROXY_H
11 #define _SFC_REPR_PROXY_H
16 #include <rte_mempool.h>
26 /* Number of supported RxQs with different mbuf memory pools */
27 #define SFC_REPR_PROXY_NB_RXQ_MIN (1)
28 #define SFC_REPR_PROXY_NB_RXQ_MAX (1)
30 /* One TxQ is required and sufficient for port representors support */
31 #define SFC_REPR_PROXY_NB_TXQ_MIN (1)
32 #define SFC_REPR_PROXY_NB_TXQ_MAX (1)
34 struct sfc_repr_proxy_rxq {
35 struct rte_ring *ring;
36 struct rte_mempool *mb_pool;
39 struct sfc_repr_proxy_txq {
40 struct rte_ring *ring;
43 struct sfc_repr_proxy_port {
44 TAILQ_ENTRY(sfc_repr_proxy_port) entries;
47 efx_mport_id_t egress_mport;
48 struct sfc_repr_proxy_rxq rxq[SFC_REPR_RXQ_MAX];
49 struct sfc_repr_proxy_txq txq[SFC_REPR_TXQ_MAX];
52 struct sfc_repr_proxy_dp_rxq {
53 struct rte_mempool *mp;
54 unsigned int ref_count;
57 enum sfc_repr_proxy_mbox_op {
58 SFC_REPR_PROXY_MBOX_ADD_PORT,
59 SFC_REPR_PROXY_MBOX_DEL_PORT,
62 struct sfc_repr_proxy_mbox {
63 struct sfc_repr_proxy_port *port;
64 enum sfc_repr_proxy_mbox_op op;
70 TAILQ_HEAD(sfc_repr_proxy_ports, sfc_repr_proxy_port);
72 struct sfc_repr_proxy {
73 uint32_t service_core_id;
75 efx_mport_id_t mport_alias;
76 struct sfc_repr_proxy_ports ports;
78 struct sfc_repr_proxy_dp_rxq dp_rxq[SFC_REPR_PROXY_NB_RXQ_MAX];
80 struct sfc_repr_proxy_mbox mbox;
85 int sfc_repr_proxy_attach(struct sfc_adapter *sa);
86 void sfc_repr_proxy_pre_detach(struct sfc_adapter *sa);
87 void sfc_repr_proxy_detach(struct sfc_adapter *sa);
88 int sfc_repr_proxy_start(struct sfc_adapter *sa);
89 void sfc_repr_proxy_stop(struct sfc_adapter *sa);
94 #endif /* _SFC_REPR_PROXY_H */