Yuval Mintz | 4ad79e1 | 2015-07-22 09:16:23 +0300 | [diff] [blame] | 1 | /* bnx2x_sriov.h: QLogic Everest network driver. |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 2 | * |
Yuval Mintz | 247fa82 | 2013-01-14 05:11:50 +0000 | [diff] [blame] | 3 | * Copyright 2009-2013 Broadcom Corporation |
Yuval Mintz | 4ad79e1 | 2015-07-22 09:16:23 +0300 | [diff] [blame] | 4 | * Copyright 2014 QLogic Corporation |
| 5 | * All rights reserved |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 6 | * |
Yuval Mintz | 4ad79e1 | 2015-07-22 09:16:23 +0300 | [diff] [blame] | 7 | * Unless you and QLogic execute a separate written software license |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 8 | * agreement governing use of this software, this software is licensed to you |
| 9 | * under the terms of the GNU General Public License version 2, available |
| 10 | * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"). |
| 11 | * |
| 12 | * Notwithstanding the above, under no circumstances may you combine this |
Yuval Mintz | 4ad79e1 | 2015-07-22 09:16:23 +0300 | [diff] [blame] | 13 | * software in any way with any other QLogic software provided under a |
| 14 | * license other than the GPL, without QLogic's express prior written |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 15 | * consent. |
| 16 | * |
Ariel Elior | 08f6dd8 | 2014-05-27 13:11:36 +0300 | [diff] [blame] | 17 | * Maintained by: Ariel Elior <ariel.elior@qlogic.com> |
| 18 | * Written by: Shmulik Ravid |
| 19 | * Ariel Elior <ariel.elior@qlogic.com> |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 20 | */ |
| 21 | #ifndef BNX2X_SRIOV_H |
| 22 | #define BNX2X_SRIOV_H |
| 23 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 24 | #include "bnx2x_vfpf.h" |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 25 | #include "bnx2x.h" |
| 26 | |
| 27 | enum sample_bulletin_result { |
| 28 | PFVF_BULLETIN_UNCHANGED, |
| 29 | PFVF_BULLETIN_UPDATED, |
| 30 | PFVF_BULLETIN_CRC_ERR |
| 31 | }; |
| 32 | |
| 33 | #ifdef CONFIG_BNX2X_SRIOV |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 34 | |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 35 | extern struct workqueue_struct *bnx2x_iov_wq; |
| 36 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 37 | /* The bnx2x device structure holds vfdb structure described below. |
| 38 | * The VF array is indexed by the relative vfid. |
| 39 | */ |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 40 | #define BNX2X_VF_MAX_QUEUES 16 |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 41 | #define BNX2X_VF_MAX_TPA_AGG_QUEUES 8 |
| 42 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 43 | struct bnx2x_sriov { |
| 44 | u32 first_vf_in_pf; |
| 45 | |
| 46 | /* standard SRIOV capability fields, mostly for debugging */ |
| 47 | int pos; /* capability position */ |
| 48 | int nres; /* number of resources */ |
| 49 | u32 cap; /* SR-IOV Capabilities */ |
| 50 | u16 ctrl; /* SR-IOV Control */ |
| 51 | u16 total; /* total VFs associated with the PF */ |
| 52 | u16 initial; /* initial VFs associated with the PF */ |
| 53 | u16 nr_virtfn; /* number of VFs available */ |
| 54 | u16 offset; /* first VF Routing ID offset */ |
| 55 | u16 stride; /* following VF stride */ |
| 56 | u32 pgsz; /* page size for BAR alignment */ |
| 57 | u8 link; /* Function Dependency Link */ |
| 58 | }; |
| 59 | |
| 60 | /* bars */ |
| 61 | struct bnx2x_vf_bar { |
| 62 | u64 bar; |
| 63 | u32 size; |
| 64 | }; |
| 65 | |
Ariel Elior | f1929b0 | 2013-01-01 05:22:41 +0000 | [diff] [blame] | 66 | struct bnx2x_vf_bar_info { |
| 67 | struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS]; |
| 68 | u8 nr_bars; |
| 69 | }; |
| 70 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 71 | /* vf queue (used both for rx or tx) */ |
| 72 | struct bnx2x_vf_queue { |
| 73 | struct eth_context *cxt; |
| 74 | |
| 75 | /* MACs object */ |
| 76 | struct bnx2x_vlan_mac_obj mac_obj; |
| 77 | |
| 78 | /* VLANs object */ |
| 79 | struct bnx2x_vlan_mac_obj vlan_obj; |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 80 | |
| 81 | /* VLAN-MACs object */ |
| 82 | struct bnx2x_vlan_mac_obj vlan_mac_obj; |
| 83 | |
Yuval Mintz | e8379c7 | 2014-01-05 18:33:54 +0200 | [diff] [blame] | 84 | unsigned long accept_flags; /* last accept flags configured */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 85 | |
| 86 | /* Queue Slow-path State object */ |
| 87 | struct bnx2x_queue_sp_obj sp_obj; |
| 88 | |
| 89 | u32 cid; |
| 90 | u16 index; |
| 91 | u16 sb_idx; |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 92 | bool is_leading; |
Yuval Mintz | 3a3534e | 2014-02-12 18:19:54 +0200 | [diff] [blame] | 93 | bool sp_initialized; |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 94 | }; |
| 95 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 96 | /* struct bnx2x_vf_queue_construct_params - prepare queue construction |
| 97 | * parameters: q-init, q-setup and SB index |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 98 | */ |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 99 | struct bnx2x_vf_queue_construct_params { |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 100 | struct bnx2x_queue_state_params qstate; |
| 101 | struct bnx2x_queue_setup_params prep_qsetup; |
| 102 | }; |
| 103 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 104 | /* forward */ |
| 105 | struct bnx2x_virtf; |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 106 | |
| 107 | /* VFOP definitions */ |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 108 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 109 | struct bnx2x_vf_mac_vlan_filter { |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 110 | int type; |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 111 | #define BNX2X_VF_FILTER_MAC BIT(0) |
| 112 | #define BNX2X_VF_FILTER_VLAN BIT(1) |
| 113 | #define BNX2X_VF_FILTER_VLAN_MAC \ |
| 114 | (BNX2X_VF_FILTER_MAC | BNX2X_VF_FILTER_VLAN) /*shortcut*/ |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 115 | |
| 116 | bool add; |
Michal Schmidt | 78d5505 | 2017-03-03 17:08:32 +0100 | [diff] [blame] | 117 | bool applied; |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 118 | u8 *mac; |
| 119 | u16 vid; |
| 120 | }; |
| 121 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 122 | struct bnx2x_vf_mac_vlan_filters { |
| 123 | int count; |
| 124 | struct bnx2x_vf_mac_vlan_filter filters[]; |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 125 | }; |
| 126 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 127 | /* vf context */ |
| 128 | struct bnx2x_virtf { |
| 129 | u16 cfg_flags; |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 130 | #define VF_CFG_STATS_COALESCE 0x1 |
| 131 | #define VF_CFG_EXT_BULLETIN 0x2 |
| 132 | #define VF_CFG_VLAN_FILTER 0x4 |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 133 | u8 link_cfg; /* IFLA_VF_LINK_STATE_AUTO |
| 134 | * IFLA_VF_LINK_STATE_ENABLE |
| 135 | * IFLA_VF_LINK_STATE_DISABLE |
| 136 | */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 137 | u8 state; |
| 138 | #define VF_FREE 0 /* VF ready to be acquired holds no resc */ |
Yuval Mintz | 16a5fd9 | 2013-06-02 00:06:18 +0000 | [diff] [blame] | 139 | #define VF_ACQUIRED 1 /* VF acquired, but not initialized */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 140 | #define VF_ENABLED 2 /* VF Enabled */ |
| 141 | #define VF_RESET 3 /* VF FLR'd, pending cleanup */ |
| 142 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 143 | bool flr_clnup_stage; /* true during flr cleanup */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 144 | |
| 145 | /* dma */ |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 146 | dma_addr_t fw_stat_map; |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 147 | u16 stats_stride; |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 148 | dma_addr_t bulletin_map; |
| 149 | |
| 150 | /* Allocated resources counters. Before the VF is acquired, the |
| 151 | * counters hold the following values: |
| 152 | * |
| 153 | * - xxq_count = 0 as the queues memory is not allocated yet. |
| 154 | * |
| 155 | * - sb_count = The number of status blocks configured for this VF in |
| 156 | * the IGU CAM. Initially read during probe. |
| 157 | * |
| 158 | * - xx_rules_count = The number of rules statically and equally |
| 159 | * allocated for each VF, during PF load. |
| 160 | */ |
| 161 | struct vf_pf_resc_request alloc_resc; |
| 162 | #define vf_rxq_count(vf) ((vf)->alloc_resc.num_rxqs) |
| 163 | #define vf_txq_count(vf) ((vf)->alloc_resc.num_txqs) |
| 164 | #define vf_sb_count(vf) ((vf)->alloc_resc.num_sbs) |
| 165 | #define vf_mac_rules_cnt(vf) ((vf)->alloc_resc.num_mac_filters) |
| 166 | #define vf_vlan_rules_cnt(vf) ((vf)->alloc_resc.num_vlan_filters) |
| 167 | #define vf_mc_rules_cnt(vf) ((vf)->alloc_resc.num_mc_filters) |
| 168 | |
| 169 | u8 sb_count; /* actual number of SBs */ |
| 170 | u8 igu_base_id; /* base igu status block id */ |
| 171 | |
| 172 | struct bnx2x_vf_queue *vfqs; |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 173 | #define LEADING_IDX 0 |
| 174 | #define bnx2x_vfq_is_leading(vfq) ((vfq)->index == LEADING_IDX) |
| 175 | #define bnx2x_vfq(vf, nr, var) ((vf)->vfqs[(nr)].var) |
| 176 | #define bnx2x_leading_vfq(vf, var) ((vf)->vfqs[LEADING_IDX].var) |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 177 | |
| 178 | u8 index; /* index in the vf array */ |
| 179 | u8 abs_vfid; |
| 180 | u8 sp_cl_id; |
| 181 | u32 error; /* 0 means all's-well */ |
| 182 | |
| 183 | /* BDF */ |
| 184 | unsigned int bus; |
| 185 | unsigned int devfn; |
| 186 | |
| 187 | /* bars */ |
| 188 | struct bnx2x_vf_bar bars[PCI_SRIOV_NUM_BARS]; |
| 189 | |
| 190 | /* set-mac ramrod state 1-pending, 0-done */ |
| 191 | unsigned long filter_state; |
| 192 | |
| 193 | /* leading rss client id ~~ the client id of the first rxq, must be |
| 194 | * set for each txq. |
| 195 | */ |
| 196 | int leading_rss; |
| 197 | |
| 198 | /* MCAST object */ |
| 199 | struct bnx2x_mcast_obj mcast_obj; |
| 200 | |
| 201 | /* RSS configuration object */ |
| 202 | struct bnx2x_rss_config_obj rss_conf_obj; |
| 203 | |
| 204 | /* slow-path operations */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 205 | struct mutex op_mutex; /* one vfop at a time mutex */ |
| 206 | enum channel_tlvs op_current; |
Yuval Mintz | 02dc402 | 2014-12-04 12:52:06 +0200 | [diff] [blame] | 207 | |
| 208 | u8 fp_hsi; |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 209 | |
| 210 | struct bnx2x_credit_pool_obj vf_vlans_pool; |
| 211 | struct bnx2x_credit_pool_obj vf_macs_pool; |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 212 | }; |
| 213 | |
| 214 | #define BNX2X_NR_VIRTFN(bp) ((bp)->vfdb->sriov.nr_virtfn) |
| 215 | |
| 216 | #define for_each_vf(bp, var) \ |
| 217 | for ((var) = 0; (var) < BNX2X_NR_VIRTFN(bp); (var)++) |
| 218 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 219 | #define for_each_vfq(vf, var) \ |
| 220 | for ((var) = 0; (var) < vf_rxq_count(vf); (var)++) |
| 221 | |
| 222 | #define for_each_vf_sb(vf, var) \ |
| 223 | for ((var) = 0; (var) < vf_sb_count(vf); (var)++) |
| 224 | |
Ariel Elior | b93288d | 2013-01-01 05:22:35 +0000 | [diff] [blame] | 225 | #define is_vf_multi(vf) (vf_rxq_count(vf) > 1) |
| 226 | |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 227 | #define HW_VF_HANDLE(bp, abs_vfid) \ |
| 228 | (u16)(BP_ABS_FUNC((bp)) | (1<<3) | ((u16)(abs_vfid) << 4)) |
| 229 | |
| 230 | #define FW_PF_MAX_HANDLE 8 |
| 231 | |
| 232 | #define FW_VF_HANDLE(abs_vfid) \ |
| 233 | (abs_vfid + FW_PF_MAX_HANDLE) |
| 234 | |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 235 | #define GET_NUM_VFS_PER_PATH(bp) 64 /* use max possible value */ |
| 236 | #define GET_NUM_VFS_PER_PF(bp) ((bp)->vfdb ? (bp)->vfdb->sriov.total \ |
| 237 | : 0) |
| 238 | #define VF_MAC_CREDIT_CNT 1 |
| 239 | #define VF_VLAN_CREDIT_CNT 2 /* VLAN0 + 'real' VLAN */ |
| 240 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 241 | /* locking and unlocking the channel mutex */ |
| 242 | void bnx2x_lock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 243 | enum channel_tlvs tlv); |
| 244 | |
| 245 | void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 246 | enum channel_tlvs expected_tlv); |
| 247 | |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 248 | /* VF mail box (aka vf-pf channel) */ |
| 249 | |
| 250 | /* a container for the bi-directional vf<-->pf messages. |
| 251 | * The actual response will be placed according to the offset parameter |
| 252 | * provided in the request |
| 253 | */ |
| 254 | |
| 255 | #define MBX_MSG_ALIGN 8 |
| 256 | #define MBX_MSG_ALIGNED_SIZE (roundup(sizeof(struct bnx2x_vf_mbx_msg), \ |
| 257 | MBX_MSG_ALIGN)) |
| 258 | |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 259 | struct bnx2x_vf_mbx_msg { |
| 260 | union vfpf_tlvs req; |
| 261 | union pfvf_tlvs resp; |
| 262 | }; |
| 263 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 264 | struct bnx2x_vf_mbx { |
| 265 | struct bnx2x_vf_mbx_msg *msg; |
| 266 | dma_addr_t msg_mapping; |
| 267 | |
| 268 | /* VF GPA address */ |
| 269 | u32 vf_addr_lo; |
| 270 | u32 vf_addr_hi; |
| 271 | |
| 272 | struct vfpf_first_tlv first_tlv; /* saved VF request header */ |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 273 | }; |
| 274 | |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 275 | struct bnx2x_vf_sp { |
| 276 | union { |
| 277 | struct eth_classify_rules_ramrod_data e2; |
| 278 | } mac_rdata; |
| 279 | |
| 280 | union { |
| 281 | struct eth_classify_rules_ramrod_data e2; |
| 282 | } vlan_rdata; |
| 283 | |
| 284 | union { |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 285 | struct eth_classify_rules_ramrod_data e2; |
| 286 | } vlan_mac_rdata; |
| 287 | |
| 288 | union { |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 289 | struct eth_filter_rules_ramrod_data e2; |
| 290 | } rx_mode_rdata; |
| 291 | |
| 292 | union { |
| 293 | struct eth_multicast_rules_ramrod_data e2; |
| 294 | } mcast_rdata; |
| 295 | |
| 296 | union { |
| 297 | struct client_init_ramrod_data init_data; |
| 298 | struct client_update_ramrod_data update_data; |
| 299 | } q_data; |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 300 | |
| 301 | union { |
| 302 | struct eth_rss_update_ramrod_data e2; |
| 303 | } rss_rdata; |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 304 | }; |
| 305 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 306 | struct hw_dma { |
| 307 | void *addr; |
| 308 | dma_addr_t mapping; |
| 309 | size_t size; |
| 310 | }; |
| 311 | |
| 312 | struct bnx2x_vfdb { |
| 313 | #define BP_VFDB(bp) ((bp)->vfdb) |
| 314 | /* vf array */ |
| 315 | struct bnx2x_virtf *vfs; |
Yuval Mintz | 58fee00 | 2014-08-17 16:47:50 +0300 | [diff] [blame] | 316 | #define BP_VF(bp, idx) ((BP_VFDB(bp) && (bp)->vfdb->vfs) ? \ |
| 317 | &((bp)->vfdb->vfs[idx]) : NULL) |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 318 | #define bnx2x_vf(bp, idx, var) ((bp)->vfdb->vfs[idx].var) |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 319 | |
| 320 | /* queue array - for all vfs */ |
| 321 | struct bnx2x_vf_queue *vfqs; |
| 322 | |
| 323 | /* vf HW contexts */ |
| 324 | struct hw_dma context[BNX2X_VF_CIDS/ILT_PAGE_CIDS]; |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 325 | #define BP_VF_CXT_PAGE(bp, i) (&(bp)->vfdb->context[i]) |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 326 | |
| 327 | /* SR-IOV information */ |
| 328 | struct bnx2x_sriov sriov; |
| 329 | struct hw_dma mbx_dma; |
| 330 | #define BP_VF_MBX_DMA(bp) (&((bp)->vfdb->mbx_dma)) |
| 331 | struct bnx2x_vf_mbx mbxs[BNX2X_MAX_NUM_OF_VFS]; |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 332 | #define BP_VF_MBX(bp, vfid) (&((bp)->vfdb->mbxs[vfid])) |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 333 | |
Ariel Elior | abc5a02 | 2013-01-01 05:22:43 +0000 | [diff] [blame] | 334 | struct hw_dma bulletin_dma; |
| 335 | #define BP_VF_BULLETIN_DMA(bp) (&((bp)->vfdb->bulletin_dma)) |
| 336 | #define BP_VF_BULLETIN(bp, vf) \ |
| 337 | (((struct pf_vf_bulletin_content *)(BP_VF_BULLETIN_DMA(bp)->addr)) \ |
| 338 | + (vf)) |
| 339 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 340 | struct hw_dma sp_dma; |
| 341 | #define bnx2x_vf_sp(bp, vf, field) ((bp)->vfdb->sp_dma.addr + \ |
| 342 | (vf)->index * sizeof(struct bnx2x_vf_sp) + \ |
| 343 | offsetof(struct bnx2x_vf_sp, field)) |
| 344 | #define bnx2x_vf_sp_map(bp, vf, field) ((bp)->vfdb->sp_dma.mapping + \ |
| 345 | (vf)->index * sizeof(struct bnx2x_vf_sp) + \ |
| 346 | offsetof(struct bnx2x_vf_sp, field)) |
| 347 | |
| 348 | #define FLRD_VFS_DWORDS (BNX2X_MAX_NUM_OF_VFS / 32) |
| 349 | u32 flrd_vfs[FLRD_VFS_DWORDS]; |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 350 | |
| 351 | /* the number of msix vectors belonging to this PF designated for VFs */ |
| 352 | u16 vf_sbs_pool; |
| 353 | u16 first_vf_igu_entry; |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 354 | |
| 355 | /* sp_rtnl synchronization */ |
| 356 | struct mutex event_mutex; |
| 357 | u64 event_occur; |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 358 | |
| 359 | /* bulletin board update synchronization */ |
| 360 | struct mutex bulletin_mutex; |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 361 | }; |
| 362 | |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 363 | /* queue access */ |
| 364 | static inline struct bnx2x_vf_queue *vfq_get(struct bnx2x_virtf *vf, u8 index) |
| 365 | { |
| 366 | return &(vf->vfqs[index]); |
| 367 | } |
| 368 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 369 | /* FW ids */ |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 370 | static inline u8 vf_igu_sb(struct bnx2x_virtf *vf, u16 sb_idx) |
| 371 | { |
| 372 | return vf->igu_base_id + sb_idx; |
| 373 | } |
| 374 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 375 | static inline u8 vf_hc_qzone(struct bnx2x_virtf *vf, u16 sb_idx) |
| 376 | { |
| 377 | return vf_igu_sb(vf, sb_idx); |
| 378 | } |
| 379 | |
| 380 | static u8 vfq_cl_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q) |
| 381 | { |
| 382 | return vf->igu_base_id + q->index; |
| 383 | } |
| 384 | |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 385 | static inline u8 vfq_stat_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q) |
| 386 | { |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 387 | if (vf->cfg_flags & VF_CFG_STATS_COALESCE) |
| 388 | return vf->leading_rss; |
| 389 | else |
| 390 | return vfq_cl_id(vf, q); |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 391 | } |
| 392 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 393 | static inline u8 vfq_qzone_id(struct bnx2x_virtf *vf, struct bnx2x_vf_queue *q) |
| 394 | { |
| 395 | return vfq_cl_id(vf, q); |
| 396 | } |
| 397 | |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 398 | /* global iov routines */ |
| 399 | int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line); |
| 400 | int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, int num_vfs_param); |
| 401 | void bnx2x_iov_remove_one(struct bnx2x *bp); |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 402 | void bnx2x_iov_free_mem(struct bnx2x *bp); |
| 403 | int bnx2x_iov_alloc_mem(struct bnx2x *bp); |
| 404 | int bnx2x_iov_nic_init(struct bnx2x *bp); |
Ariel Elior | f1929b0 | 2013-01-01 05:22:41 +0000 | [diff] [blame] | 405 | int bnx2x_iov_chip_cleanup(struct bnx2x *bp); |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 406 | void bnx2x_iov_init_dq(struct bnx2x *bp); |
| 407 | void bnx2x_iov_init_dmae(struct bnx2x *bp); |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 408 | void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid, |
| 409 | struct bnx2x_queue_sp_obj **q_obj); |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 410 | int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem); |
Ariel Elior | 67c431a | 2013-01-01 05:22:36 +0000 | [diff] [blame] | 411 | void bnx2x_iov_adjust_stats_req(struct bnx2x *bp); |
| 412 | void bnx2x_iov_storm_stats_update(struct bnx2x *bp); |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 413 | /* global vf mailbox routines */ |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 414 | void bnx2x_vf_mbx(struct bnx2x *bp); |
| 415 | void bnx2x_vf_mbx_schedule(struct bnx2x *bp, |
| 416 | struct vf_pf_event_data *vfpf_event); |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 417 | void bnx2x_vf_enable_mbx(struct bnx2x *bp, u8 abs_vfid); |
Ariel Elior | 954ea74 | 2013-01-01 05:22:38 +0000 | [diff] [blame] | 418 | |
| 419 | /* CORE VF API */ |
| 420 | typedef u8 bnx2x_mac_addr_t[ETH_ALEN]; |
| 421 | |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 422 | /* acquire */ |
| 423 | int bnx2x_vf_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, |
Ariel Elior | b93288d | 2013-01-01 05:22:35 +0000 | [diff] [blame] | 424 | struct vf_pf_resc_request *resc); |
| 425 | /* init */ |
| 426 | int bnx2x_vf_init(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 427 | dma_addr_t *sb_map); |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 428 | |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 429 | /* VFOP queue construction helpers */ |
| 430 | void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 431 | struct bnx2x_queue_init_params *init_params, |
| 432 | struct bnx2x_queue_setup_params *setup_params, |
| 433 | u16 q_idx, u16 sb_idx); |
| 434 | |
| 435 | void bnx2x_vfop_qctor_dump_rx(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 436 | struct bnx2x_queue_init_params *init_params, |
| 437 | struct bnx2x_queue_setup_params *setup_params, |
| 438 | u16 q_idx, u16 sb_idx); |
| 439 | |
| 440 | void bnx2x_vfop_qctor_prep(struct bnx2x *bp, |
| 441 | struct bnx2x_virtf *vf, |
| 442 | struct bnx2x_vf_queue *q, |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 443 | struct bnx2x_vf_queue_construct_params *p, |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 444 | unsigned long q_type); |
Ariel Elior | 954ea74 | 2013-01-01 05:22:38 +0000 | [diff] [blame] | 445 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 446 | int bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 447 | struct bnx2x_vf_mac_vlan_filters *filters, |
| 448 | int qid, bool drv_only); |
Ariel Elior | 954ea74 | 2013-01-01 05:22:38 +0000 | [diff] [blame] | 449 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 450 | int bnx2x_vf_queue_setup(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid, |
| 451 | struct bnx2x_vf_queue_construct_params *qctor); |
Ariel Elior | 8db573b | 2013-01-01 05:22:37 +0000 | [diff] [blame] | 452 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 453 | int bnx2x_vf_queue_teardown(struct bnx2x *bp, struct bnx2x_virtf *vf, int qid); |
Ariel Elior | 463a68a | 2013-01-01 05:22:39 +0000 | [diff] [blame] | 454 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 455 | int bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 456 | bnx2x_mac_addr_t *mcasts, int mc_num, bool drv_only); |
Ariel Elior | 954ea74 | 2013-01-01 05:22:38 +0000 | [diff] [blame] | 457 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 458 | int bnx2x_vf_rxmode(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 459 | int qid, unsigned long accept_flags); |
Ariel Elior | 954ea74 | 2013-01-01 05:22:38 +0000 | [diff] [blame] | 460 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 461 | int bnx2x_vf_close(struct bnx2x *bp, struct bnx2x_virtf *vf); |
Ariel Elior | 99e9d21 | 2013-01-01 05:22:40 +0000 | [diff] [blame] | 462 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 463 | int bnx2x_vf_free(struct bnx2x *bp, struct bnx2x_virtf *vf); |
Ariel Elior | f1929b0 | 2013-01-01 05:22:41 +0000 | [diff] [blame] | 464 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 465 | int bnx2x_vf_rss_update(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 466 | struct bnx2x_config_rss_params *rss); |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 467 | |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 468 | int bnx2x_vf_tpa_update(struct bnx2x *bp, struct bnx2x_virtf *vf, |
| 469 | struct vfpf_tpa_tlv *tlv, |
| 470 | struct bnx2x_queue_update_tpa_params *params); |
Michal Kalderon | 14a94eb | 2014-02-12 18:19:53 +0200 | [diff] [blame] | 471 | |
Ariel Elior | f1929b0 | 2013-01-01 05:22:41 +0000 | [diff] [blame] | 472 | /* VF release ~ VF close + VF release-resources |
| 473 | * |
| 474 | * Release is the ultimate SW shutdown and is called whenever an |
| 475 | * irrecoverable error is encountered. |
| 476 | */ |
Yuval Mintz | 2dc33bb | 2014-03-23 18:12:25 +0200 | [diff] [blame] | 477 | int bnx2x_vf_release(struct bnx2x *bp, struct bnx2x_virtf *vf); |
Ariel Elior | 290ca2b | 2013-01-01 05:22:31 +0000 | [diff] [blame] | 478 | int bnx2x_vf_idx_by_abs_fid(struct bnx2x *bp, u16 abs_vfid); |
Ariel Elior | 8ca5e17 | 2013-01-01 05:22:34 +0000 | [diff] [blame] | 479 | u8 bnx2x_vf_max_queue_cnt(struct bnx2x *bp, struct bnx2x_virtf *vf); |
Ariel Elior | d16132c | 2013-01-01 05:22:42 +0000 | [diff] [blame] | 480 | |
| 481 | /* FLR routines */ |
| 482 | |
Ariel Elior | b56e967 | 2013-01-01 05:22:32 +0000 | [diff] [blame] | 483 | /* VF FLR helpers */ |
| 484 | int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid); |
| 485 | void bnx2x_vf_enable_access(struct bnx2x *bp, u8 abs_vfid); |
Ariel Elior | d16132c | 2013-01-01 05:22:42 +0000 | [diff] [blame] | 486 | |
| 487 | /* Handles an FLR (or VF_DISABLE) notification form the MCP */ |
| 488 | void bnx2x_vf_handle_flr_event(struct bnx2x *bp); |
| 489 | |
Ariel Elior | fd1fc79 | 2013-01-01 05:22:33 +0000 | [diff] [blame] | 490 | bool bnx2x_tlv_supported(u16 tlvtype); |
| 491 | |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 492 | u32 bnx2x_crc_vf_bulletin(struct pf_vf_bulletin_content *bulletin); |
Ariel Elior | abc5a02 | 2013-01-01 05:22:43 +0000 | [diff] [blame] | 493 | int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf); |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 494 | void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin, |
| 495 | bool support_long); |
Ariel Elior | abc5a02 | 2013-01-01 05:22:43 +0000 | [diff] [blame] | 496 | |
Ariel Elior | abc5a02 | 2013-01-01 05:22:43 +0000 | [diff] [blame] | 497 | enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp); |
| 498 | |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 499 | /* VF side vfpf channel functions */ |
| 500 | int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count); |
| 501 | int bnx2x_vfpf_release(struct bnx2x *bp); |
| 502 | int bnx2x_vfpf_release(struct bnx2x *bp); |
| 503 | int bnx2x_vfpf_init(struct bnx2x *bp); |
| 504 | void bnx2x_vfpf_close_vf(struct bnx2x *bp); |
Ariel Elior | 60cad4e | 2013-09-04 14:09:22 +0300 | [diff] [blame] | 505 | int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
| 506 | bool is_leading); |
Dmitry Kravkov | f8f4f61 | 2013-04-24 01:45:00 +0000 | [diff] [blame] | 507 | int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set); |
Ariel Elior | 60cad4e | 2013-09-04 14:09:22 +0300 | [diff] [blame] | 508 | int bnx2x_vfpf_config_rss(struct bnx2x *bp, |
| 509 | struct bnx2x_config_rss_params *params); |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 510 | int bnx2x_vfpf_set_mcast(struct net_device *dev); |
| 511 | int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp); |
| 512 | |
| 513 | static inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf, |
| 514 | size_t buf_len) |
| 515 | { |
| 516 | strlcpy(buf, bp->acquire_resp.pfdev_info.fw_ver, buf_len); |
| 517 | } |
| 518 | |
| 519 | static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp, |
| 520 | struct bnx2x_fastpath *fp) |
| 521 | { |
| 522 | return PXP_VF_ADDR_USDM_QUEUES_START + |
| 523 | bp->acquire_resp.resc.hw_qid[fp->index] * |
| 524 | sizeof(struct ustorm_queue_zone_data); |
| 525 | } |
| 526 | |
| 527 | enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp); |
Yuval Mintz | 37173488 | 2013-06-24 11:04:10 +0300 | [diff] [blame] | 528 | void bnx2x_timer_sriov(struct bnx2x *bp); |
Dmitry Kravkov | 1d6f3cd | 2013-03-27 01:05:17 +0000 | [diff] [blame] | 529 | void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp); |
Yuval Mintz | e2a367f | 2014-04-24 19:29:52 +0300 | [diff] [blame] | 530 | void bnx2x_vf_pci_dealloc(struct bnx2x *bp); |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 531 | int bnx2x_vf_pci_alloc(struct bnx2x *bp); |
Ariel Elior | 3c76fef | 2013-03-11 05:17:46 +0000 | [diff] [blame] | 532 | int bnx2x_enable_sriov(struct bnx2x *bp); |
| 533 | void bnx2x_disable_sriov(struct bnx2x *bp); |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 534 | static inline int bnx2x_vf_headroom(struct bnx2x *bp) |
| 535 | { |
Ariel Elior | b9871bc | 2013-09-04 14:09:21 +0300 | [diff] [blame] | 536 | return bp->vfdb->sriov.nr_virtfn * BNX2X_CIDS_PER_VF; |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 537 | } |
Ariel Elior | 3ec9f9c | 2013-03-11 05:17:45 +0000 | [diff] [blame] | 538 | void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp); |
Ariel Elior | 3c76fef | 2013-03-11 05:17:46 +0000 | [diff] [blame] | 539 | int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs); |
Ariel Elior | 78c3bcc | 2013-06-20 17:39:08 +0300 | [diff] [blame] | 540 | void bnx2x_iov_channel_down(struct bnx2x *bp); |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 541 | |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 542 | void bnx2x_iov_task(struct work_struct *work); |
| 543 | |
| 544 | void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag); |
| 545 | |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 546 | void bnx2x_iov_link_update(struct bnx2x *bp); |
| 547 | int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx); |
| 548 | |
| 549 | int bnx2x_set_vf_link_state(struct net_device *dev, int vf, int link_state); |
| 550 | |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 551 | int bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add); |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 552 | #else /* CONFIG_BNX2X_SRIOV */ |
| 553 | |
Yuval Mintz | ce7fa78 | 2015-07-30 14:30:29 +0300 | [diff] [blame] | 554 | #define GET_NUM_VFS_PER_PATH(bp) 0 |
| 555 | #define GET_NUM_VFS_PER_PF(bp) 0 |
| 556 | #define VF_MAC_CREDIT_CNT 0 |
| 557 | #define VF_VLAN_CREDIT_CNT 0 |
| 558 | |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 559 | static inline void bnx2x_iov_set_queue_sp_obj(struct bnx2x *bp, int vf_cid, |
| 560 | struct bnx2x_queue_sp_obj **q_obj) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 561 | static inline void bnx2x_vf_handle_flr_event(struct bnx2x *bp) {} |
| 562 | static inline int bnx2x_iov_eq_sp_event(struct bnx2x *bp, |
| 563 | union event_ring_elem *elem) {return 1; } |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 564 | static inline void bnx2x_vf_mbx(struct bnx2x *bp) {} |
| 565 | static inline void bnx2x_vf_mbx_schedule(struct bnx2x *bp, |
| 566 | struct vf_pf_event_data *vfpf_event) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 567 | static inline int bnx2x_iov_init_ilt(struct bnx2x *bp, u16 line) {return line; } |
| 568 | static inline void bnx2x_iov_init_dq(struct bnx2x *bp) {} |
| 569 | static inline int bnx2x_iov_alloc_mem(struct bnx2x *bp) {return 0; } |
Yuval Mintz | 580d9d0 | 2013-01-23 03:21:51 +0000 | [diff] [blame] | 570 | static inline void bnx2x_iov_free_mem(struct bnx2x *bp) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 571 | static inline int bnx2x_iov_chip_cleanup(struct bnx2x *bp) {return 0; } |
| 572 | static inline void bnx2x_iov_init_dmae(struct bnx2x *bp) {} |
| 573 | static inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, |
| 574 | int num_vfs_param) {return 0; } |
| 575 | static inline void bnx2x_iov_remove_one(struct bnx2x *bp) {} |
Ariel Elior | 3c76fef | 2013-03-11 05:17:46 +0000 | [diff] [blame] | 576 | static inline int bnx2x_enable_sriov(struct bnx2x *bp) {return 0; } |
| 577 | static inline void bnx2x_disable_sriov(struct bnx2x *bp) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 578 | static inline int bnx2x_vfpf_acquire(struct bnx2x *bp, |
| 579 | u8 tx_count, u8 rx_count) {return 0; } |
| 580 | static inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; } |
| 581 | static inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; } |
| 582 | static inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {} |
Ariel Elior | 60cad4e | 2013-09-04 14:09:22 +0300 | [diff] [blame] | 583 | static inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, bool is_leading) {return 0; } |
Dmitry Kravkov | f8f4f61 | 2013-04-24 01:45:00 +0000 | [diff] [blame] | 584 | static inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, |
| 585 | u8 vf_qid, bool set) {return 0; } |
Dmitry Kravkov | 9b0be65 | 2013-09-06 10:35:28 +0300 | [diff] [blame] | 586 | static inline int bnx2x_vfpf_config_rss(struct bnx2x *bp, |
| 587 | struct bnx2x_config_rss_params *params) {return 0; } |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 588 | static inline int bnx2x_vfpf_set_mcast(struct net_device *dev) {return 0; } |
| 589 | static inline int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) {return 0; } |
| 590 | static inline int bnx2x_iov_nic_init(struct bnx2x *bp) {return 0; } |
| 591 | static inline int bnx2x_vf_headroom(struct bnx2x *bp) {return 0; } |
| 592 | static inline void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) {} |
| 593 | static inline void bnx2x_vf_fill_fw_str(struct bnx2x *bp, char *buf, |
| 594 | size_t buf_len) {} |
| 595 | static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp, |
| 596 | struct bnx2x_fastpath *fp) {return 0; } |
| 597 | static inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp) |
| 598 | { |
| 599 | return PFVF_BULLETIN_UNCHANGED; |
| 600 | } |
Yuval Mintz | 37173488 | 2013-06-24 11:04:10 +0300 | [diff] [blame] | 601 | static inline void bnx2x_timer_sriov(struct bnx2x *bp) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 602 | |
Dmitry Kravkov | 1d6f3cd | 2013-03-27 01:05:17 +0000 | [diff] [blame] | 603 | static inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp) |
| 604 | { |
| 605 | return NULL; |
| 606 | } |
| 607 | |
Randy Dunlap | 6255558 | 2014-05-10 11:33:54 -0700 | [diff] [blame] | 608 | static inline void bnx2x_vf_pci_dealloc(struct bnx2x *bp) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 609 | static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; } |
Ariel Elior | 3ec9f9c | 2013-03-11 05:17:45 +0000 | [diff] [blame] | 610 | static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {} |
Ariel Elior | 3c76fef | 2013-03-11 05:17:46 +0000 | [diff] [blame] | 611 | static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; } |
Ariel Elior | 78c3bcc | 2013-06-20 17:39:08 +0300 | [diff] [blame] | 612 | static inline void bnx2x_iov_channel_down(struct bnx2x *bp) {} |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 613 | |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 614 | static inline void bnx2x_iov_task(struct work_struct *work) {} |
Yuval Mintz | 19915f5 | 2014-03-26 09:06:29 +0200 | [diff] [blame] | 615 | static inline void bnx2x_schedule_iov_task(struct bnx2x *bp, enum bnx2x_iov_flag flag) {} |
Dmitry Kravkov | 6495d15 | 2014-06-26 14:31:04 +0300 | [diff] [blame] | 616 | static inline void bnx2x_iov_link_update(struct bnx2x *bp) {} |
| 617 | static inline int bnx2x_iov_link_update_vf(struct bnx2x *bp, int idx) {return 0; } |
| 618 | |
| 619 | static inline int bnx2x_set_vf_link_state(struct net_device *dev, int vf, |
| 620 | int link_state) {return 0; } |
| 621 | struct pf_vf_bulletin_content; |
| 622 | static inline void bnx2x_vf_bulletin_finalize(struct pf_vf_bulletin_content *bulletin, |
| 623 | bool support_long) {} |
Yuval Mintz | 370d4a2 | 2014-03-23 18:12:24 +0200 | [diff] [blame] | 624 | |
Yuval Mintz | 05cc5a3 | 2015-07-29 15:52:46 +0300 | [diff] [blame] | 625 | static inline int bnx2x_vfpf_update_vlan(struct bnx2x *bp, u16 vid, u8 vf_qid, bool add) {return 0; } |
| 626 | |
Ariel Elior | 6411280 | 2013-01-07 00:50:23 +0000 | [diff] [blame] | 627 | #endif /* CONFIG_BNX2X_SRIOV */ |
Ariel Elior | 1ab4434 | 2013-01-01 05:22:23 +0000 | [diff] [blame] | 628 | #endif /* bnx2x_sriov.h */ |