]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/dpdk/drivers/net/liquidio/base/lio_23xx_vf.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / seastar / dpdk / drivers / net / liquidio / base / lio_23xx_vf.h
1 /*
2 * BSD LICENSE
3 *
4 * Copyright(c) 2017 Cavium, Inc.. All rights reserved.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name of Cavium, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _LIO_23XX_VF_H_
35 #define _LIO_23XX_VF_H_
36
37 #include <stdio.h>
38
39 #include "lio_struct.h"
40
41 static const struct lio_config default_cn23xx_conf = {
42 .card_type = LIO_23XX,
43 .card_name = LIO_23XX_NAME,
44 /** IQ attributes */
45 .iq = {
46 .max_iqs = CN23XX_CFG_IO_QUEUES,
47 .pending_list_size =
48 (CN23XX_MAX_IQ_DESCRIPTORS * CN23XX_CFG_IO_QUEUES),
49 .instr_type = OCTEON_64BYTE_INSTR,
50 },
51
52 /** OQ attributes */
53 .oq = {
54 .max_oqs = CN23XX_CFG_IO_QUEUES,
55 .info_ptr = OCTEON_OQ_INFOPTR_MODE,
56 .refill_threshold = CN23XX_OQ_REFIL_THRESHOLD,
57 },
58
59 .num_nic_ports = CN23XX_DEFAULT_NUM_PORTS,
60 .num_def_rx_descs = CN23XX_MAX_OQ_DESCRIPTORS,
61 .num_def_tx_descs = CN23XX_MAX_IQ_DESCRIPTORS,
62 .def_rx_buf_size = CN23XX_OQ_BUF_SIZE,
63 };
64
65 static inline const struct lio_config *
66 lio_get_conf(struct lio_device *lio_dev)
67 {
68 const struct lio_config *default_lio_conf = NULL;
69
70 /* check the LIO Device model & return the corresponding lio
71 * configuration
72 */
73 default_lio_conf = &default_cn23xx_conf;
74
75 if (default_lio_conf == NULL) {
76 lio_dev_err(lio_dev, "Configuration verification failed\n");
77 return NULL;
78 }
79
80 return default_lio_conf;
81 }
82
83 /** Turns off the input and output queues for the device
84 * @param lio_dev which device io queues to disable
85 */
86 int cn23xx_vf_set_io_queues_off(struct lio_device *lio_dev);
87
88 #define CN23XX_VF_BUSY_READING_REG_LOOP_COUNT 100000
89
90 void cn23xx_vf_ask_pf_to_do_flr(struct lio_device *lio_dev);
91
92 int cn23xx_pfvf_handshake(struct lio_device *lio_dev);
93
94 int cn23xx_vf_setup_device(struct lio_device *lio_dev);
95
96 void cn23xx_vf_handle_mbox(struct lio_device *lio_dev);
97 #endif /* _LIO_23XX_VF_H_ */