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