f049d821e07a0d4e15705884c490c3d2b6d53234
[dpdk.git] / drivers / net / qede / base / ecore_proto_if.h
1 /*
2  * Copyright (c) 2016 - 2018 Cavium Inc.
3  * All rights reserved.
4  * www.cavium.com
5  *
6  * See LICENSE.qede_pmd for copyright and licensing details.
7  */
8
9 #ifndef __ECORE_PROTO_IF_H__
10 #define __ECORE_PROTO_IF_H__
11
12 /*
13  * PF parameters (according to personality/protocol)
14  */
15
16 #define ECORE_ROCE_PROTOCOL_INDEX       (3)
17
18 struct ecore_eth_pf_params {
19         /* The following parameters are used during HW-init
20          * and these parameters need to be passed as arguments
21          * to update_pf_params routine invoked before slowpath start
22          */
23         u16     num_cons;
24
25         /* per-VF number of CIDs */
26         u8      num_vf_cons;
27 #define ETH_PF_PARAMS_VF_CONS_DEFAULT   (32)
28
29         /* To enable arfs, previous to HW-init a positive number needs to be
30          * set [as filters require allocated searcher ILT memory].
31          * This will set the maximal number of configured steering-filters.
32          */
33         u32     num_arfs_filters;
34
35         /* To allow VF to change its MAC despite of PF set forced MAC. */
36         bool    allow_vf_mac_change;
37 };
38
39 /* Most of the parameters below are described in the FW iSCSI / TCP HSI */
40 struct ecore_iscsi_pf_params {
41         u64             glbl_q_params_addr;
42         u64             bdq_pbl_base_addr[2];
43         u16             cq_num_entries;
44         u16             cmdq_num_entries;
45         u32             two_msl_timer;
46         u16             tx_sws_timer;
47         /* The following parameters are used during HW-init
48          * and these parameters need to be passed as arguments
49          * to update_pf_params routine invoked before slowpath start
50          */
51         u16             num_cons;
52         u16             num_tasks;
53
54         /* The following parameters are used during protocol-init */
55         u16             half_way_close_timeout;
56         u16             bdq_xoff_threshold[2];
57         u16             bdq_xon_threshold[2];
58         u16             cmdq_xoff_threshold;
59         u16             cmdq_xon_threshold;
60         u16             rq_buffer_size;
61
62         u8              num_sq_pages_in_ring;
63         u8              num_r2tq_pages_in_ring;
64         u8              num_uhq_pages_in_ring;
65         u8              num_queues;
66         u8              log_page_size;
67         u8              rqe_log_size;
68         u8              max_fin_rt;
69         u8              gl_rq_pi;
70         u8              gl_cmd_pi;
71         u8              debug_mode;
72         u8              ll2_ooo_queue_id;
73         u8              ooo_enable;
74
75         u8              is_target;
76         u8              bdq_pbl_num_entries[2];
77         u8              disable_stats_collection;
78 };
79
80 enum ecore_rdma_protocol {
81         ECORE_RDMA_PROTOCOL_DEFAULT,
82         ECORE_RDMA_PROTOCOL_ROCE,
83         ECORE_RDMA_PROTOCOL_IWARP,
84 };
85
86 struct ecore_rdma_pf_params {
87         /* Supplied to ECORE during resource allocation (may affect the ILT and
88          * the doorbell BAR).
89          */
90         u32             min_dpis;       /* number of requested DPIs */
91         u32             num_mrs;        /* number of requested memory regions*/
92         u32             num_qps;        /* number of requested Queue Pairs */
93         u32             num_srqs;       /* number of requested SRQ */
94         u8              roce_edpm_mode; /* see QED_ROCE_EDPM_MODE_ENABLE */
95         u8              gl_pi;          /* protocol index */
96
97         /* Will allocate rate limiters to be used with QPs */
98         u8              enable_dcqcn;
99
100         /* TCP port number used for the iwarp traffic */
101         u16             iwarp_port;
102         enum ecore_rdma_protocol rdma_protocol;
103 };
104
105 struct ecore_pf_params {
106         struct ecore_eth_pf_params      eth_pf_params;
107         struct ecore_iscsi_pf_params    iscsi_pf_params;
108         struct ecore_rdma_pf_params     rdma_pf_params;
109 };
110
111 #endif