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