]>
git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/dpdk/drivers/net/sfc/sfc_ev.h
4 * Copyright (c) 2016-2017 Solarflare Communications Inc.
7 * This software was jointly developed between OKTET Labs (under contract
8 * for Solarflare) and Solarflare Communications, Inc.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #include <rte_ethdev.h>
45 /* Number of entries in the management event queue */
46 #define SFC_MGMT_EVQ_ENTRIES (EFX_EVQ_MINNEVS)
53 SFC_EVQ_UNINITIALIZED
= 0,
62 SFC_EVQ_TYPE_MGMT
= 0,
70 /* Used on datapath */
72 const efx_ev_callbacks_t
*callbacks
;
73 unsigned int read_ptr
;
76 struct sfc_dp_rxq
*dp_rxq
;
77 struct sfc_dp_txq
*dp_txq
;
79 /* Not used on datapath */
80 struct sfc_adapter
*sa
;
81 unsigned int evq_index
;
82 enum sfc_evq_state init_state
;
83 enum sfc_evq_type type
;
88 * Functions below define event queue to transmit/receive queue and vice
90 * Own event queue is allocated for management, each Rx and each Tx queue.
91 * Zero event queue is used for management events.
92 * Rx event queues from 1 to RxQ number follow management event queue.
93 * Tx event queues follow Rx event queues.
96 static inline unsigned int
97 sfc_evq_index_by_rxq_sw_index(__rte_unused
struct sfc_adapter
*sa
,
98 unsigned int rxq_sw_index
)
100 return 1 + rxq_sw_index
;
103 static inline unsigned int
104 sfc_evq_index_by_txq_sw_index(struct sfc_adapter
*sa
, unsigned int txq_sw_index
)
106 return 1 + sa
->eth_dev
->data
->nb_rx_queues
+ txq_sw_index
;
109 int sfc_ev_attach(struct sfc_adapter
*sa
);
110 void sfc_ev_detach(struct sfc_adapter
*sa
);
111 int sfc_ev_start(struct sfc_adapter
*sa
);
112 void sfc_ev_stop(struct sfc_adapter
*sa
);
114 int sfc_ev_qinit(struct sfc_adapter
*sa
,
115 enum sfc_evq_type type
, unsigned int type_index
,
116 unsigned int entries
, int socket_id
, struct sfc_evq
**evqp
);
117 void sfc_ev_qfini(struct sfc_evq
*evq
);
118 int sfc_ev_qstart(struct sfc_evq
*evq
, unsigned int hw_index
);
119 void sfc_ev_qstop(struct sfc_evq
*evq
);
121 int sfc_ev_qprime(struct sfc_evq
*evq
);
122 void sfc_ev_qpoll(struct sfc_evq
*evq
);
124 void sfc_ev_mgmt_qpoll(struct sfc_adapter
*sa
);
129 #endif /* _SFC_EV_H_ */