1130803Smarcel/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 298944Sobrien/* QLogic qed NIC Driver 3130803Smarcel * Copyright (c) 2015-2017 QLogic Corporation 4130803Smarcel */ 598944Sobrien 698944Sobrien#ifndef _QED_VF_H 798944Sobrien#define _QED_VF_H 898944Sobrien 998944Sobrien#include "qed_l2.h" 1098944Sobrien#include "qed_mcp.h" 1198944Sobrien 1298944Sobrien#define T_ETH_INDIRECTION_TABLE_SIZE 128 1398944Sobrien#define T_ETH_RSS_KEY_SIZE 10 1498944Sobrien 1598944Sobrienstruct vf_pf_resc_request { 1698944Sobrien u8 num_rxqs; 1798944Sobrien u8 num_txqs; 1898944Sobrien u8 num_sbs; 1998944Sobrien u8 num_mac_filters; 2098944Sobrien u8 num_vlan_filters; 2198944Sobrien u8 num_mc_filters; 2298944Sobrien u8 num_cids; 2398944Sobrien u8 padding; 2498944Sobrien}; 2598944Sobrien 2698944Sobrienstruct hw_sb_info { 27130803Smarcel u16 hw_sb_id; 2898944Sobrien u8 sb_qid; 2998944Sobrien u8 padding[5]; 3098944Sobrien}; 31130803Smarcel 32130803Smarcel#define TLV_BUFFER_SIZE 1024 33130803Smarcel 3498944Sobrienenum { 35130803Smarcel PFVF_STATUS_WAITING, 36130803Smarcel PFVF_STATUS_SUCCESS, 37130803Smarcel PFVF_STATUS_FAILURE, 38130803Smarcel PFVF_STATUS_NOT_SUPPORTED, 3998944Sobrien PFVF_STATUS_NO_RESOURCE, 4098944Sobrien PFVF_STATUS_FORCED, 41130803Smarcel PFVF_STATUS_MALICIOUS, 42130803Smarcel}; 43130803Smarcel 44130803Smarcel/* vf pf channel tlvs */ 4598944Sobrien/* general tlv header (used for both vf->pf request and pf->vf response) */ 4698944Sobrienstruct channel_tlv { 4798944Sobrien u16 type; 4898944Sobrien u16 length; 4998944Sobrien}; 5098944Sobrien 5198944Sobrien/* header of first vf->pf tlv carries the offset used to calculate response 5298944Sobrien * buffer address 5398944Sobrien */ 5498944Sobrienstruct vfpf_first_tlv { 5598944Sobrien struct channel_tlv tl; 5698944Sobrien u32 padding; 5798944Sobrien u64 reply_address; 58130803Smarcel}; 59130803Smarcel 6098944Sobrien/* header of pf->vf tlvs, carries the status of handling the request */ 6198944Sobrienstruct pfvf_tlv { 6298944Sobrien struct channel_tlv tl; 6398944Sobrien u8 status; 6498944Sobrien u8 padding[3]; 65130803Smarcel}; 6698944Sobrien 6798944Sobrien/* response tlv used for most tlvs */ 6898944Sobrienstruct pfvf_def_resp_tlv { 69130803Smarcel struct pfvf_tlv hdr; 70130803Smarcel}; 71130803Smarcel 7298944Sobrien/* used to terminate and pad a tlv list */ 7398944Sobrienstruct channel_list_end_tlv { 7498944Sobrien struct channel_tlv tl; 7598944Sobrien u8 padding[4]; 7698944Sobrien}; 7798944Sobrien 7898944Sobrien#define VFPF_ACQUIRE_OS_LINUX (0) 7998944Sobrien#define VFPF_ACQUIRE_OS_WINDOWS (1) 8098944Sobrien#define VFPF_ACQUIRE_OS_ESX (2) 81130803Smarcel#define VFPF_ACQUIRE_OS_SOLARIS (3) 82130803Smarcel#define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4) 83130803Smarcel 8498944Sobrienstruct vfpf_acquire_tlv { 8598944Sobrien struct vfpf_first_tlv first_tlv; 86130803Smarcel 8798944Sobrien struct vf_pf_vfdev_info { 8898944Sobrien#define VFPF_ACQUIRE_CAP_PRE_FP_HSI BIT(0) /* VF pre-FP hsi version */ 89130803Smarcel#define VFPF_ACQUIRE_CAP_100G BIT(1) /* VF can support 100g */ 9098944Sobrien /* A requirement for supporting multi-Tx queues on a single queue-zone, 9198944Sobrien * VF would pass qids as additional information whenever passing queue 9298944Sobrien * references. 9398944Sobrien */ 94130803Smarcel#define VFPF_ACQUIRE_CAP_QUEUE_QIDS BIT(2) 95130803Smarcel 96130803Smarcel /* The VF is using the physical bar. While this is mostly internal 97130803Smarcel * to the VF, might affect the number of CIDs supported assuming 9898944Sobrien * QUEUE_QIDS is set. 9998944Sobrien */ 10098944Sobrien#define VFPF_ACQUIRE_CAP_PHYSICAL_BAR BIT(3) 10198944Sobrien u64 capabilities; 10298944Sobrien u8 fw_major; 103130803Smarcel u8 fw_minor; 104130803Smarcel u8 fw_revision; 105130803Smarcel u8 fw_engineering; 10698944Sobrien u32 driver_version; 10798944Sobrien u16 opaque_fid; /* ME register value */ 10898944Sobrien u8 os_type; /* VFPF_ACQUIRE_OS_* value */ 10998944Sobrien u8 eth_fp_hsi_major; 110130803Smarcel u8 eth_fp_hsi_minor; 111130803Smarcel u8 padding[3]; 112130803Smarcel } vfdev_info; 11398944Sobrien 11498944Sobrien struct vf_pf_resc_request resc_request; 11598944Sobrien 11698944Sobrien u64 bulletin_addr; 11798944Sobrien u32 bulletin_size; 118130803Smarcel u32 padding; 11998944Sobrien}; 120130803Smarcel 12198944Sobrien/* receive side scaling tlv */ 12298944Sobrienstruct vfpf_vport_update_rss_tlv { 12398944Sobrien struct channel_tlv tl; 12498944Sobrien 12598944Sobrien u8 update_rss_flags; 12698944Sobrien#define VFPF_UPDATE_RSS_CONFIG_FLAG BIT(0) 12798944Sobrien#define VFPF_UPDATE_RSS_CAPS_FLAG BIT(1) 12898944Sobrien#define VFPF_UPDATE_RSS_IND_TABLE_FLAG BIT(2) 12998944Sobrien#define VFPF_UPDATE_RSS_KEY_FLAG BIT(3) 13098944Sobrien 13198944Sobrien u8 rss_enable; 132130803Smarcel u8 rss_caps; 13398944Sobrien u8 rss_table_size_log; /* The table size is 2 ^ rss_table_size_log */ 13498944Sobrien u16 rss_ind_table[T_ETH_INDIRECTION_TABLE_SIZE]; 13598944Sobrien u32 rss_key[T_ETH_RSS_KEY_SIZE]; 13698944Sobrien}; 13798944Sobrien 13898944Sobrienstruct pfvf_storm_stats { 13998944Sobrien u32 address; 14098944Sobrien u32 len; 14198944Sobrien}; 14298944Sobrien 14398944Sobrienstruct pfvf_stats_info { 14498944Sobrien struct pfvf_storm_stats mstats; 14598944Sobrien struct pfvf_storm_stats pstats; 14698944Sobrien struct pfvf_storm_stats tstats; 14798944Sobrien struct pfvf_storm_stats ustats; 14898944Sobrien}; 14998944Sobrien 15098944Sobrienstruct pfvf_acquire_resp_tlv { 15198944Sobrien struct pfvf_tlv hdr; 15298944Sobrien 15398944Sobrien struct pf_vf_pfdev_info { 15498944Sobrien u32 chip_num; 15598944Sobrien u32 mfw_ver; 15698944Sobrien 15798944Sobrien u16 fw_major; 15898944Sobrien u16 fw_minor; 15998944Sobrien u16 fw_rev; 16098944Sobrien u16 fw_eng; 16198944Sobrien 16298944Sobrien u64 capabilities; 16398944Sobrien#define PFVF_ACQUIRE_CAP_DEFAULT_UNTAGGED BIT(0) 16498944Sobrien#define PFVF_ACQUIRE_CAP_100G BIT(1) /* If set, 100g PF */ 16598944Sobrien/* There are old PF versions where the PF might mistakenly override the sanity 16698944Sobrien * mechanism [version-based] and allow a VF that can't be supported to pass 16798944Sobrien * the acquisition phase. 16898944Sobrien * To overcome this, PFs now indicate that they're past that point and the new 16998944Sobrien * VFs would fail probe on the older PFs that fail to do so. 17098944Sobrien */ 171130803Smarcel#define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE BIT(2) 17298944Sobrien 17398944Sobrien /* PF expects queues to be received with additional qids */ 174130803Smarcel#define PFVF_ACQUIRE_CAP_QUEUE_QIDS BIT(3) 17598944Sobrien 17698944Sobrien u16 db_size; 177130803Smarcel u8 indices_per_sb; 17898944Sobrien u8 os_type; 17998944Sobrien 18098944Sobrien /* These should match the PF's qed_dev values */ 18198944Sobrien u16 chip_rev; 18298944Sobrien u8 dev_type; 18398944Sobrien 18498944Sobrien /* Doorbell bar size configured in HW: log(size) or 0 */ 185130803Smarcel u8 bar_size; 186130803Smarcel 18798944Sobrien struct pfvf_stats_info stats_info; 18898944Sobrien 18998944Sobrien u8 port_mac[ETH_ALEN]; 19098944Sobrien 19198944Sobrien /* It's possible PF had to configure an older fastpath HSI 19298944Sobrien * [in case VF is newer than PF]. This is communicated back 19398944Sobrien * to the VF. It can also be used in case of error due to 19498944Sobrien * non-matching versions to shed light in VF about failure. 19598944Sobrien */ 19698944Sobrien u8 major_fp_hsi; 19798944Sobrien u8 minor_fp_hsi; 19898944Sobrien } pfdev_info; 19998944Sobrien 20098944Sobrien struct pf_vf_resc { 20198944Sobrien#define PFVF_MAX_QUEUES_PER_VF 16 20298944Sobrien#define PFVF_MAX_SBS_PER_VF 16 20398944Sobrien struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF]; 20498944Sobrien u8 hw_qid[PFVF_MAX_QUEUES_PER_VF]; 20598944Sobrien u8 cid[PFVF_MAX_QUEUES_PER_VF]; 20698944Sobrien 20798944Sobrien u8 num_rxqs; 20898944Sobrien u8 num_txqs; 209130803Smarcel u8 num_sbs; 210130803Smarcel u8 num_mac_filters; 21198944Sobrien u8 num_vlan_filters; 21298944Sobrien u8 num_mc_filters; 21398944Sobrien u8 num_cids; 21498944Sobrien u8 padding; 21598944Sobrien } resc; 21698944Sobrien 217130803Smarcel u32 bulletin_size; 218130803Smarcel u32 padding; 219130803Smarcel}; 22098944Sobrien 22198944Sobrienstruct pfvf_start_queue_resp_tlv { 22298944Sobrien struct pfvf_tlv hdr; 22398944Sobrien u32 offset; /* offset to consumer/producer of queue */ 22498944Sobrien u8 padding[4]; 22598944Sobrien}; 22698944Sobrien 22798944Sobrien/* Extended queue information - additional index for reference inside qzone. 22898944Sobrien * If communicated between VF/PF, each TLV relating to queues should be 22998944Sobrien * extended by one such [or have a future base TLV that already contains info]. 23098944Sobrien */ 23198944Sobrienstruct vfpf_qid_tlv { 23298944Sobrien struct channel_tlv tl; 23398944Sobrien u8 qid; 234130803Smarcel u8 padding[3]; 235130803Smarcel}; 236130803Smarcel 237130803Smarcel/* Setup Queue */ 238130803Smarcelstruct vfpf_start_rxq_tlv { 239104990Smp struct vfpf_first_tlv first_tlv; 240104990Smp 241104990Smp /* physical addresses */ 242104990Smp u64 rxq_addr; 243104990Smp u64 deprecated_sge_addr; 244104990Smp u64 cqe_pbl_addr; 245130803Smarcel 246130803Smarcel u16 cqe_pbl_size; 247130803Smarcel u16 hw_sb; 248130803Smarcel u16 rx_qid; 249130803Smarcel u16 hc_rate; /* desired interrupts per sec. */ 250130803Smarcel 25198944Sobrien u16 bd_max_bytes; 25298944Sobrien u16 stat_id; 25398944Sobrien u8 sb_index; 25498944Sobrien u8 padding[3]; 25598944Sobrien}; 25698944Sobrien 25798944Sobrienstruct vfpf_start_txq_tlv { 25898944Sobrien struct vfpf_first_tlv first_tlv; 25998944Sobrien 26098944Sobrien /* physical addresses */ 26198944Sobrien u64 pbl_addr; 26298944Sobrien u16 pbl_size; 26398944Sobrien u16 stat_id; 26498944Sobrien u16 tx_qid; 26598944Sobrien u16 hw_sb; 26698944Sobrien 26798944Sobrien u32 flags; /* VFPF_QUEUE_FLG_X flags */ 26898944Sobrien u16 hc_rate; /* desired interrupts per sec. */ 26998944Sobrien u8 sb_index; 27098944Sobrien u8 padding[3]; 27198944Sobrien}; 27298944Sobrien 27398944Sobrien/* Stop RX Queue */ 27498944Sobrienstruct vfpf_stop_rxqs_tlv { 27598944Sobrien struct vfpf_first_tlv first_tlv; 276130803Smarcel 277130803Smarcel u16 rx_qid; 27898944Sobrien 27998944Sobrien /* this field is deprecated and should *always* be set to '1' */ 28098944Sobrien u8 num_rxqs; 28198944Sobrien u8 cqe_completion; 28298944Sobrien u8 padding[4]; 28398944Sobrien}; 28498944Sobrien 285130803Smarcel/* Stop TX Queues */ 286130803Smarcelstruct vfpf_stop_txqs_tlv { 287130803Smarcel struct vfpf_first_tlv first_tlv; 28898944Sobrien 28998944Sobrien u16 tx_qid; 29098944Sobrien 29198944Sobrien /* this field is deprecated and should *always* be set to '1' */ 29298944Sobrien u8 num_txqs; 29398944Sobrien u8 padding[5]; 29498944Sobrien}; 29598944Sobrien 29698944Sobrienstruct vfpf_update_rxq_tlv { 29798944Sobrien struct vfpf_first_tlv first_tlv; 29898944Sobrien 29998944Sobrien u64 deprecated_sge_addr[PFVF_MAX_QUEUES_PER_VF]; 30098944Sobrien 301130803Smarcel u16 rx_qid; 302130803Smarcel u8 num_rxqs; 30398944Sobrien u8 flags; 30498944Sobrien#define VFPF_RXQ_UPD_INIT_SGE_DEPRECATE_FLAG BIT(0) 30598944Sobrien#define VFPF_RXQ_UPD_COMPLETE_CQE_FLAG BIT(1) 30698944Sobrien#define VFPF_RXQ_UPD_COMPLETE_EVENT_FLAG BIT(2) 307130803Smarcel 308130803Smarcel u8 padding[4]; 30998944Sobrien}; 31098944Sobrien 31198944Sobrien/* Set Queue Filters */ 31298944Sobrienstruct vfpf_q_mac_vlan_filter { 31398944Sobrien u32 flags; 314130803Smarcel#define VFPF_Q_FILTER_DEST_MAC_VALID 0x01 315130803Smarcel#define VFPF_Q_FILTER_VLAN_TAG_VALID 0x02 31698944Sobrien#define VFPF_Q_FILTER_SET_MAC 0x100 /* set/clear */ 31798944Sobrien 31898944Sobrien u8 mac[ETH_ALEN]; 31998944Sobrien u16 vlan_tag; 32098944Sobrien 32198944Sobrien u8 padding[4]; 32298944Sobrien}; 32398944Sobrien 32498944Sobrien/* Start a vport */ 32598944Sobrienstruct vfpf_vport_start_tlv { 32698944Sobrien struct vfpf_first_tlv first_tlv; 32798944Sobrien 32898944Sobrien u64 sb_addr[PFVF_MAX_SBS_PER_VF]; 32998944Sobrien 33098944Sobrien u32 tpa_mode; 331130803Smarcel u16 dep1; 33298944Sobrien u16 mtu; 33398944Sobrien 33498944Sobrien u8 vport_id; 33598944Sobrien u8 inner_vlan_removal; 33698944Sobrien 33798944Sobrien u8 only_untagged; 33898944Sobrien u8 max_buffers_per_cqe; 33998944Sobrien 340130803Smarcel u8 padding[4]; 34198944Sobrien}; 34298944Sobrien 34398944Sobrien/* Extended tlvs - need to add rss, mcast, accept mode tlvs */ 34498944Sobrienstruct vfpf_vport_update_activate_tlv { 34598944Sobrien struct channel_tlv tl; 34698944Sobrien u8 update_rx; 34798944Sobrien u8 update_tx; 34898944Sobrien u8 active_rx; 34998944Sobrien u8 active_tx; 35098944Sobrien}; 35198944Sobrien 35298944Sobrienstruct vfpf_vport_update_tx_switch_tlv { 35398944Sobrien struct channel_tlv tl; 35498944Sobrien u8 tx_switching; 35598944Sobrien u8 padding[3]; 35698944Sobrien}; 35798944Sobrien 35898944Sobrienstruct vfpf_vport_update_vlan_strip_tlv { 35998944Sobrien struct channel_tlv tl; 36098944Sobrien u8 remove_vlan; 36198944Sobrien u8 padding[3]; 36298944Sobrien}; 36398944Sobrien 36498944Sobrienstruct vfpf_vport_update_mcast_bin_tlv { 36598944Sobrien struct channel_tlv tl; 36698944Sobrien u8 padding[4]; 36798944Sobrien 36898944Sobrien /* There are only 256 approx bins, and in HSI they're divided into 36998944Sobrien * 32-bit values. As old VFs used to set-bit to the values on its side, 37098944Sobrien * the upper half of the array is never expected to contain any data. 37198944Sobrien */ 37298944Sobrien u64 bins[4]; 37398944Sobrien u64 obsolete_bins[4]; 37498944Sobrien}; 37598944Sobrien 37698944Sobrienstruct vfpf_vport_update_accept_param_tlv { 37798944Sobrien struct channel_tlv tl; 378130803Smarcel u8 update_rx_mode; 37998944Sobrien u8 update_tx_mode; 38098944Sobrien u8 rx_accept_filter; 38198944Sobrien u8 tx_accept_filter; 38298944Sobrien}; 38398944Sobrien 38498944Sobrienstruct vfpf_vport_update_accept_any_vlan_tlv { 38598944Sobrien struct channel_tlv tl; 38698944Sobrien u8 update_accept_any_vlan_flg; 38798944Sobrien u8 accept_any_vlan; 38898944Sobrien 38998944Sobrien u8 padding[2]; 39098944Sobrien}; 39198944Sobrien 39298944Sobrienstruct vfpf_vport_update_sge_tpa_tlv { 39398944Sobrien struct channel_tlv tl; 39498944Sobrien 39598944Sobrien u16 sge_tpa_flags; 39698944Sobrien#define VFPF_TPA_IPV4_EN_FLAG BIT(0) 39798944Sobrien#define VFPF_TPA_IPV6_EN_FLAG BIT(1) 39898944Sobrien#define VFPF_TPA_PKT_SPLIT_FLAG BIT(2) 39998944Sobrien#define VFPF_TPA_HDR_DATA_SPLIT_FLAG BIT(3) 400130803Smarcel#define VFPF_TPA_GRO_CONSIST_FLAG BIT(4) 40198944Sobrien 40298944Sobrien u8 update_sge_tpa_flags; 40398944Sobrien#define VFPF_UPDATE_SGE_DEPRECATED_FLAG BIT(0) 40498944Sobrien#define VFPF_UPDATE_TPA_EN_FLAG BIT(1) 40598944Sobrien#define VFPF_UPDATE_TPA_PARAM_FLAG BIT(2) 40698944Sobrien 40798944Sobrien u8 max_buffers_per_cqe; 40898944Sobrien 40998944Sobrien u16 deprecated_sge_buff_size; 41098944Sobrien u16 tpa_max_size; 41198944Sobrien u16 tpa_min_size_to_start; 41298944Sobrien u16 tpa_min_size_to_cont; 41398944Sobrien 41498944Sobrien u8 tpa_max_aggs_num; 41598944Sobrien u8 padding[7]; 41698944Sobrien}; 41798944Sobrien 41898944Sobrien/* Primary tlv as a header for various extended tlvs for 41998944Sobrien * various functionalities in vport update ramrod. 42098944Sobrien */ 42198944Sobrienstruct vfpf_vport_update_tlv { 42298944Sobrien struct vfpf_first_tlv first_tlv; 42398944Sobrien}; 42498944Sobrien 42598944Sobrienstruct vfpf_ucast_filter_tlv { 42698944Sobrien struct vfpf_first_tlv first_tlv; 42798944Sobrien 42898944Sobrien u8 opcode; 42998944Sobrien u8 type; 43098944Sobrien 43198944Sobrien u8 mac[ETH_ALEN]; 432130803Smarcel 433130803Smarcel u16 vlan; 434130803Smarcel u16 padding[3]; 43598944Sobrien}; 43698944Sobrien 43798944Sobrien/* tunnel update param tlv */ 43898944Sobrienstruct vfpf_update_tunn_param_tlv { 439130803Smarcel struct vfpf_first_tlv first_tlv; 44098944Sobrien 44198944Sobrien u8 tun_mode_update_mask; 44298944Sobrien u8 tunn_mode; 44398944Sobrien u8 update_tun_cls; 444130803Smarcel u8 vxlan_clss; 445130803Smarcel u8 l2gre_clss; 446130803Smarcel u8 ipgre_clss; 447130803Smarcel u8 l2geneve_clss; 448130803Smarcel u8 ipgeneve_clss; 449130803Smarcel u8 update_geneve_port; 450130803Smarcel u8 update_vxlan_port; 451130803Smarcel u16 geneve_port; 45298944Sobrien u16 vxlan_port; 45398944Sobrien u8 padding[2]; 45498944Sobrien}; 45598944Sobrien 456130803Smarcelstruct pfvf_update_tunn_param_tlv { 457130803Smarcel struct pfvf_tlv hdr; 45898944Sobrien 459130803Smarcel u16 tunn_feature_mask; 460130803Smarcel u8 vxlan_mode; 461130803Smarcel u8 l2geneve_mode; 46298944Sobrien u8 ipgeneve_mode; 463130803Smarcel u8 l2gre_mode; 464130803Smarcel u8 ipgre_mode; 465130803Smarcel u8 vxlan_clss; 466130803Smarcel u8 l2gre_clss; 467130803Smarcel u8 ipgre_clss; 468130803Smarcel u8 l2geneve_clss; 469130803Smarcel u8 ipgeneve_clss; 470130803Smarcel u16 vxlan_udp_port; 471130803Smarcel u16 geneve_udp_port; 47298944Sobrien}; 47398944Sobrien 47498944Sobrienstruct tlv_buffer_size { 47598944Sobrien u8 tlv_buffer[TLV_BUFFER_SIZE]; 47698944Sobrien}; 47798944Sobrien 47898944Sobrienstruct vfpf_update_coalesce { 47998944Sobrien struct vfpf_first_tlv first_tlv; 48098944Sobrien u16 rx_coal; 48198944Sobrien u16 tx_coal; 48298944Sobrien u16 qid; 48398944Sobrien u8 padding[2]; 48498944Sobrien}; 48598944Sobrien 48698944Sobrienstruct vfpf_read_coal_req_tlv { 48798944Sobrien struct vfpf_first_tlv first_tlv; 48898944Sobrien u16 qid; 48998944Sobrien u8 is_rx; 49098944Sobrien u8 padding[5]; 49198944Sobrien}; 49298944Sobrien 49398944Sobrienstruct pfvf_read_coal_resp_tlv { 494130803Smarcel struct pfvf_tlv hdr; 49598944Sobrien u16 coal; 496130803Smarcel u8 padding[6]; 49798944Sobrien}; 49898944Sobrien 49998944Sobrienstruct vfpf_bulletin_update_mac_tlv { 500130803Smarcel struct vfpf_first_tlv first_tlv; 501130803Smarcel u8 mac[ETH_ALEN]; 50298944Sobrien u8 padding[2]; 50398944Sobrien}; 50498944Sobrien 50598944Sobrienunion vfpf_tlvs { 50698944Sobrien struct vfpf_first_tlv first_tlv; 507130803Smarcel struct vfpf_acquire_tlv acquire; 50898944Sobrien struct vfpf_start_rxq_tlv start_rxq; 50998944Sobrien struct vfpf_start_txq_tlv start_txq; 51098944Sobrien struct vfpf_stop_rxqs_tlv stop_rxqs; 51198944Sobrien struct vfpf_stop_txqs_tlv stop_txqs; 51298944Sobrien struct vfpf_update_rxq_tlv update_rxq; 51398944Sobrien struct vfpf_vport_start_tlv start_vport; 51498944Sobrien struct vfpf_vport_update_tlv vport_update; 51598944Sobrien struct vfpf_ucast_filter_tlv ucast_filter; 51698944Sobrien struct vfpf_update_tunn_param_tlv tunn_param_update; 51798944Sobrien struct vfpf_update_coalesce update_coalesce; 51898944Sobrien struct vfpf_read_coal_req_tlv read_coal_req; 51998944Sobrien struct vfpf_bulletin_update_mac_tlv bulletin_update_mac; 52098944Sobrien struct tlv_buffer_size tlv_buf_size; 52198944Sobrien}; 52298944Sobrien 52398944Sobrienunion pfvf_tlvs { 52498944Sobrien struct pfvf_def_resp_tlv default_resp; 52598944Sobrien struct pfvf_acquire_resp_tlv acquire_resp; 52698944Sobrien struct tlv_buffer_size tlv_buf_size; 52798944Sobrien struct pfvf_start_queue_resp_tlv queue_start; 52898944Sobrien struct pfvf_update_tunn_param_tlv tunn_param_resp; 52998944Sobrien struct pfvf_read_coal_resp_tlv read_coal_resp; 53098944Sobrien}; 53198944Sobrien 53298944Sobrienenum qed_bulletin_bit { 53398944Sobrien /* Alert the VF that a forced MAC was set by the PF */ 53498944Sobrien MAC_ADDR_FORCED = 0, 53598944Sobrien /* Alert the VF that a forced VLAN was set by the PF */ 53698944Sobrien VLAN_ADDR_FORCED = 2, 53798944Sobrien 53898944Sobrien /* Indicate that `default_only_untagged' contains actual data */ 53998944Sobrien VFPF_BULLETIN_UNTAGGED_DEFAULT = 3, 54098944Sobrien VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED = 4, 54198944Sobrien 54298944Sobrien /* Alert the VF that suggested mac was sent by the PF. 54398944Sobrien * MAC_ADDR will be disabled in case MAC_ADDR_FORCED is set. 54498944Sobrien */ 54598944Sobrien VFPF_BULLETIN_MAC_ADDR = 5 54698944Sobrien}; 54798944Sobrien 54898944Sobrienstruct qed_bulletin_content { 54998944Sobrien /* crc of structure to ensure is not in mid-update */ 55098944Sobrien u32 crc; 55198944Sobrien 55298944Sobrien u32 version; 55398944Sobrien 55498944Sobrien /* bitmap indicating which fields hold valid values */ 555130803Smarcel u64 valid_bitmap; 55698944Sobrien 55798944Sobrien /* used for MAC_ADDR or MAC_ADDR_FORCED */ 55898944Sobrien u8 mac[ETH_ALEN]; 559130803Smarcel 560130803Smarcel /* If valid, 1 => only untagged Rx if no vlan is configured */ 56198944Sobrien u8 default_only_untagged; 56298944Sobrien u8 padding; 563130803Smarcel 56498944Sobrien /* The following is a 'copy' of qed_mcp_link_state, 56598944Sobrien * qed_mcp_link_params and qed_mcp_link_capabilities. Since it's 56698944Sobrien * possible the structs will increase further along the road we cannot 56798944Sobrien * have it here; Instead we need to have all of its fields. 568130803Smarcel */ 569130803Smarcel u8 req_autoneg; 57098944Sobrien u8 req_autoneg_pause; 57198944Sobrien u8 req_forced_rx; 57298944Sobrien u8 req_forced_tx; 573130803Smarcel u8 padding2[4]; 57498944Sobrien 57598944Sobrien u32 req_adv_speed; 57698944Sobrien u32 req_forced_speed; 57798944Sobrien u32 req_loopback; 57898944Sobrien u32 padding3; 57998944Sobrien 58098944Sobrien u8 link_up; 58198944Sobrien u8 full_duplex; 58298944Sobrien u8 autoneg; 58398944Sobrien u8 autoneg_complete; 58498944Sobrien u8 parallel_detection; 585130803Smarcel u8 pfc_enabled; 58698944Sobrien u8 partner_tx_flow_ctrl_en; 58798944Sobrien u8 partner_rx_flow_ctrl_en; 588130803Smarcel u8 partner_adv_pause; 58998944Sobrien u8 sfp_tx_fault; 590130803Smarcel u16 vxlan_udp_port; 59198944Sobrien u16 geneve_udp_port; 59298944Sobrien u8 padding4[2]; 593130803Smarcel 59498944Sobrien u32 speed; 59598944Sobrien u32 partner_adv_speed; 596130803Smarcel 59798944Sobrien u32 capability_speed; 59898944Sobrien 59998944Sobrien /* Forced vlan */ 60098944Sobrien u16 pvid; 601130803Smarcel u16 padding5; 60298944Sobrien}; 60398944Sobrien 60498944Sobrienstruct qed_bulletin { 60598944Sobrien dma_addr_t phys; 60698944Sobrien struct qed_bulletin_content *p_virt; 60798944Sobrien u32 size; 60898944Sobrien}; 60998944Sobrien 61098944Sobrienenum { 61198944Sobrien CHANNEL_TLV_NONE, /* ends tlv sequence */ 61298944Sobrien CHANNEL_TLV_ACQUIRE, 61398944Sobrien CHANNEL_TLV_VPORT_START, 61498944Sobrien CHANNEL_TLV_VPORT_UPDATE, 61598944Sobrien CHANNEL_TLV_VPORT_TEARDOWN, 61698944Sobrien CHANNEL_TLV_START_RXQ, 61798944Sobrien CHANNEL_TLV_START_TXQ, 61898944Sobrien CHANNEL_TLV_STOP_RXQS, 61998944Sobrien CHANNEL_TLV_STOP_TXQS, 62098944Sobrien CHANNEL_TLV_UPDATE_RXQ, 62198944Sobrien CHANNEL_TLV_INT_CLEANUP, 62298944Sobrien CHANNEL_TLV_CLOSE, 62398944Sobrien CHANNEL_TLV_RELEASE, 62498944Sobrien CHANNEL_TLV_LIST_END, 62598944Sobrien CHANNEL_TLV_UCAST_FILTER, 62698944Sobrien CHANNEL_TLV_VPORT_UPDATE_ACTIVATE, 62798944Sobrien CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH, 62898944Sobrien CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP, 62998944Sobrien CHANNEL_TLV_VPORT_UPDATE_MCAST, 63098944Sobrien CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM, 63198944Sobrien CHANNEL_TLV_VPORT_UPDATE_RSS, 63298944Sobrien CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN, 63398944Sobrien CHANNEL_TLV_VPORT_UPDATE_SGE_TPA, 63498944Sobrien CHANNEL_TLV_UPDATE_TUNN_PARAM, 63598944Sobrien CHANNEL_TLV_COALESCE_UPDATE, 636130803Smarcel CHANNEL_TLV_QID, 63798944Sobrien CHANNEL_TLV_COALESCE_READ, 63898944Sobrien CHANNEL_TLV_BULLETIN_UPDATE_MAC, 63998944Sobrien CHANNEL_TLV_MAX, 64098944Sobrien 64198944Sobrien /* Required for iterating over vport-update tlvs. 64298944Sobrien * Will break in case non-sequential vport-update tlvs. 64398944Sobrien */ 64498944Sobrien CHANNEL_TLV_VPORT_UPDATE_MAX = CHANNEL_TLV_VPORT_UPDATE_SGE_TPA + 1, 64598944Sobrien}; 64698944Sobrien 64798944Sobrien/* Default number of CIDs [total of both Rx and Tx] to be requested 64898944Sobrien * by default, and maximum possible number. 64998944Sobrien */ 650130803Smarcel#define QED_ETH_VF_DEFAULT_NUM_CIDS (32) 65198944Sobrien#define QED_ETH_VF_MAX_NUM_CIDS (250) 652130803Smarcel 653130803Smarcel/* This data is held in the qed_hwfn structure for VFs only. */ 654130803Smarcelstruct qed_vf_iov { 65598944Sobrien union vfpf_tlvs *vf2pf_request; 65698944Sobrien dma_addr_t vf2pf_request_phys; 65798944Sobrien union pfvf_tlvs *pf2vf_reply; 65898944Sobrien dma_addr_t pf2vf_reply_phys; 65998944Sobrien 66098944Sobrien /* Should be taken whenever the mailbox buffers are accessed */ 66198944Sobrien struct mutex mutex; 66298944Sobrien u8 *offset; 66398944Sobrien 66498944Sobrien /* Bulletin Board */ 66598944Sobrien struct qed_bulletin bulletin; 66698944Sobrien struct qed_bulletin_content bulletin_shadow; 66798944Sobrien 66898944Sobrien /* we set aside a copy of the acquire response */ 66998944Sobrien struct pfvf_acquire_resp_tlv acquire_resp; 67098944Sobrien 671 /* In case PF originates prior to the fp-hsi version comparison, 672 * this has to be propagated as it affects the fastpath. 673 */ 674 bool b_pre_fp_hsi; 675 676 /* Current day VFs are passing the SBs physical address on vport 677 * start, and as they lack an IGU mapping they need to store the 678 * addresses of previously registered SBs. 679 * Even if we were to change configuration flow, due to backward 680 * compatibility [with older PFs] we'd still need to store these. 681 */ 682 struct qed_sb_info *sbs_info[PFVF_MAX_SBS_PER_VF]; 683 684 /* Determines whether VF utilizes doorbells via limited register 685 * bar or via the doorbell bar. 686 */ 687 bool b_doorbell_bar; 688}; 689 690/** 691 * qed_vf_pf_set_coalesce(): VF - Set Rx/Tx coalesce per VF's relative queue. 692 * Coalesce value '0' will omit the 693 * configuration. 694 * 695 * @p_hwfn: HW device data. 696 * @rx_coal: coalesce value in micro second for rx queue. 697 * @tx_coal: coalesce value in micro second for tx queue. 698 * @p_cid: queue cid. 699 * 700 * Return: Int. 701 * 702 **/ 703int qed_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn, 704 u16 rx_coal, 705 u16 tx_coal, struct qed_queue_cid *p_cid); 706 707/** 708 * qed_vf_pf_get_coalesce(): VF - Get coalesce per VF's relative queue. 709 * 710 * @p_hwfn: HW device data. 711 * @p_coal: coalesce value in micro second for VF queues. 712 * @p_cid: queue cid. 713 * 714 * Return: Int. 715 **/ 716int qed_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn, 717 u16 *p_coal, struct qed_queue_cid *p_cid); 718 719#ifdef CONFIG_QED_SRIOV 720/** 721 * qed_vf_read_bulletin(): Read the VF bulletin and act on it if needed. 722 * 723 * @p_hwfn: HW device data. 724 * @p_change: qed fills 1 iff bulletin board has changed, 0 otherwise. 725 * 726 * Return: enum _qed_status. 727 */ 728int qed_vf_read_bulletin(struct qed_hwfn *p_hwfn, u8 *p_change); 729 730/** 731 * qed_vf_get_link_params(): Get link parameters for VF from qed 732 * 733 * @p_hwfn: HW device data. 734 * @params: the link params structure to be filled for the VF. 735 * 736 * Return: Void. 737 */ 738void qed_vf_get_link_params(struct qed_hwfn *p_hwfn, 739 struct qed_mcp_link_params *params); 740 741/** 742 * qed_vf_get_link_state(): Get link state for VF from qed. 743 * 744 * @p_hwfn: HW device data. 745 * @link: the link state structure to be filled for the VF 746 * 747 * Return: Void. 748 */ 749void qed_vf_get_link_state(struct qed_hwfn *p_hwfn, 750 struct qed_mcp_link_state *link); 751 752/** 753 * qed_vf_get_link_caps(): Get link capabilities for VF from qed. 754 * 755 * @p_hwfn: HW device data. 756 * @p_link_caps: the link capabilities structure to be filled for the VF 757 * 758 * Return: Void. 759 */ 760void qed_vf_get_link_caps(struct qed_hwfn *p_hwfn, 761 struct qed_mcp_link_capabilities *p_link_caps); 762 763/** 764 * qed_vf_get_num_rxqs(): Get number of Rx queues allocated for VF by qed 765 * 766 * @p_hwfn: HW device data. 767 * @num_rxqs: allocated RX queues 768 * 769 * Return: Void. 770 */ 771void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs); 772 773/** 774 * qed_vf_get_num_txqs(): Get number of Rx queues allocated for VF by qed 775 * 776 * @p_hwfn: HW device data. 777 * @num_txqs: allocated RX queues 778 * 779 * Return: Void. 780 */ 781void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs); 782 783/** 784 * qed_vf_get_num_cids(): Get number of available connections 785 * [both Rx and Tx] for VF 786 * 787 * @p_hwfn: HW device data. 788 * @num_cids: allocated number of connections 789 * 790 * Return: Void. 791 */ 792void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids); 793 794/** 795 * qed_vf_get_port_mac(): Get port mac address for VF. 796 * 797 * @p_hwfn: HW device data. 798 * @port_mac: destination location for port mac 799 * 800 * Return: Void. 801 */ 802void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac); 803 804/** 805 * qed_vf_get_num_vlan_filters(): Get number of VLAN filters allocated 806 * for VF by qed. 807 * 808 * @p_hwfn: HW device data. 809 * @num_vlan_filters: allocated VLAN filters 810 * 811 * Return: Void. 812 */ 813void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn, 814 u8 *num_vlan_filters); 815 816/** 817 * qed_vf_get_num_mac_filters(): Get number of MAC filters allocated 818 * for VF by qed 819 * 820 * @p_hwfn: HW device data. 821 * @num_mac_filters: allocated MAC filters 822 * 823 * Return: Void. 824 */ 825void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters); 826 827/** 828 * qed_vf_check_mac(): Check if VF can set a MAC address 829 * 830 * @p_hwfn: HW device data. 831 * @mac: Mac. 832 * 833 * Return: bool. 834 */ 835bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac); 836 837/** 838 * qed_vf_get_fw_version(): Set firmware version information 839 * in dev_info from VFs acquire response tlv 840 * 841 * @p_hwfn: HW device data. 842 * @fw_major: FW major. 843 * @fw_minor: FW minor. 844 * @fw_rev: FW rev. 845 * @fw_eng: FW eng. 846 * 847 * Return: Void. 848 */ 849void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn, 850 u16 *fw_major, u16 *fw_minor, 851 u16 *fw_rev, u16 *fw_eng); 852 853/** 854 * qed_vf_hw_prepare(): hw preparation for VF sends ACQUIRE message 855 * 856 * @p_hwfn: HW device data. 857 * 858 * Return: Int. 859 */ 860int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn); 861 862/** 863 * qed_vf_pf_rxq_start(): start the RX Queue by sending a message to the PF 864 * 865 * @p_hwfn: HW device data. 866 * @p_cid: Only relative fields are relevant 867 * @bd_max_bytes: maximum number of bytes per bd 868 * @bd_chain_phys_addr: physical address of bd chain 869 * @cqe_pbl_addr: physical address of pbl 870 * @cqe_pbl_size: pbl size 871 * @pp_prod: pointer to the producer to be used in fastpath 872 * 873 * Return: Int. 874 */ 875int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn, 876 struct qed_queue_cid *p_cid, 877 u16 bd_max_bytes, 878 dma_addr_t bd_chain_phys_addr, 879 dma_addr_t cqe_pbl_addr, 880 u16 cqe_pbl_size, void __iomem **pp_prod); 881 882/** 883 * qed_vf_pf_txq_start(): VF - start the TX queue by sending a message to the 884 * PF. 885 * 886 * @p_hwfn: HW device data. 887 * @p_cid: CID. 888 * @pbl_addr: PBL address. 889 * @pbl_size: PBL Size. 890 * @pp_doorbell: pointer to address to which to write the doorbell too. 891 * 892 * Return: Int. 893 */ 894int 895qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn, 896 struct qed_queue_cid *p_cid, 897 dma_addr_t pbl_addr, 898 u16 pbl_size, void __iomem **pp_doorbell); 899 900/** 901 * qed_vf_pf_rxq_stop(): VF - stop the RX queue by sending a message to the PF. 902 * 903 * @p_hwfn: HW device data. 904 * @p_cid: CID. 905 * @cqe_completion: CQE Completion. 906 * 907 * Return: Int. 908 */ 909int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn, 910 struct qed_queue_cid *p_cid, bool cqe_completion); 911 912/** 913 * qed_vf_pf_txq_stop(): VF - stop the TX queue by sending a message to the PF. 914 * 915 * @p_hwfn: HW device data. 916 * @p_cid: CID. 917 * 918 * Return: Int. 919 */ 920int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid); 921 922/** 923 * qed_vf_pf_vport_update(): VF - send a vport update command. 924 * 925 * @p_hwfn: HW device data. 926 * @p_params: Params 927 * 928 * Return: Int. 929 */ 930int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn, 931 struct qed_sp_vport_update_params *p_params); 932 933/** 934 * qed_vf_pf_reset(): VF - send a close message to PF. 935 * 936 * @p_hwfn: HW device data. 937 * 938 * Return: enum _qed_status 939 */ 940int qed_vf_pf_reset(struct qed_hwfn *p_hwfn); 941 942/** 943 * qed_vf_pf_release(): VF - free vf`s memories. 944 * 945 * @p_hwfn: HW device data. 946 * 947 * Return: enum _qed_status 948 */ 949int qed_vf_pf_release(struct qed_hwfn *p_hwfn); 950 951/** 952 * qed_vf_get_igu_sb_id(): Get the IGU SB ID for a given 953 * sb_id. For VFs igu sbs don't have to be contiguous 954 * 955 * @p_hwfn: HW device data. 956 * @sb_id: SB ID. 957 * 958 * Return: INLINE u16 959 */ 960u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id); 961 962/** 963 * qed_vf_set_sb_info(): Stores [or removes] a configured sb_info. 964 * 965 * @p_hwfn: HW device data. 966 * @sb_id: zero-based SB index [for fastpath] 967 * @p_sb: may be NULL [during removal]. 968 * 969 * Return: Void. 970 */ 971void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn, 972 u16 sb_id, struct qed_sb_info *p_sb); 973 974/** 975 * qed_vf_pf_vport_start(): perform vport start for VF. 976 * 977 * @p_hwfn: HW device data. 978 * @vport_id: Vport ID. 979 * @mtu: MTU. 980 * @inner_vlan_removal: Innter VLAN removal. 981 * @tpa_mode: TPA mode 982 * @max_buffers_per_cqe: Max buffer pre CQE. 983 * @only_untagged: default behavior regarding vlan acceptance 984 * 985 * Return: enum _qed_status 986 */ 987int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn, 988 u8 vport_id, 989 u16 mtu, 990 u8 inner_vlan_removal, 991 enum qed_tpa_mode tpa_mode, 992 u8 max_buffers_per_cqe, u8 only_untagged); 993 994/** 995 * qed_vf_pf_vport_stop(): stop the VF's vport 996 * 997 * @p_hwfn: HW device data. 998 * 999 * Return: enum _qed_status 1000 */ 1001int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn); 1002 1003int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn, 1004 struct qed_filter_ucast *p_param); 1005 1006void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn, 1007 struct qed_filter_mcast *p_filter_cmd); 1008 1009/** 1010 * qed_vf_pf_int_cleanup(): clean the SB of the VF 1011 * 1012 * @p_hwfn: HW device data. 1013 * 1014 * Return: enum _qed_status 1015 */ 1016int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn); 1017 1018/** 1019 * __qed_vf_get_link_params(): return the link params in a given bulletin board 1020 * 1021 * @p_hwfn: HW device data. 1022 * @p_params: pointer to a struct to fill with link params 1023 * @p_bulletin: Bulletin. 1024 * 1025 * Return: Void. 1026 */ 1027void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn, 1028 struct qed_mcp_link_params *p_params, 1029 struct qed_bulletin_content *p_bulletin); 1030 1031/** 1032 * __qed_vf_get_link_state(): return the link state in a given bulletin board 1033 * 1034 * @p_hwfn: HW device data. 1035 * @p_link: pointer to a struct to fill with link state 1036 * @p_bulletin: Bulletin. 1037 * 1038 * Return: Void. 1039 */ 1040void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn, 1041 struct qed_mcp_link_state *p_link, 1042 struct qed_bulletin_content *p_bulletin); 1043 1044/** 1045 * __qed_vf_get_link_caps(): return the link capabilities in a given 1046 * bulletin board 1047 * 1048 * @p_hwfn: HW device data. 1049 * @p_link_caps: pointer to a struct to fill with link capabilities 1050 * @p_bulletin: Bulletin. 1051 * 1052 * Return: Void. 1053 */ 1054void __qed_vf_get_link_caps(struct qed_hwfn *p_hwfn, 1055 struct qed_mcp_link_capabilities *p_link_caps, 1056 struct qed_bulletin_content *p_bulletin); 1057 1058void qed_iov_vf_task(struct work_struct *work); 1059void qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun); 1060int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn, 1061 struct qed_tunnel_info *p_tunn); 1062 1063u32 qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn, enum BAR_ID bar_id); 1064/** 1065 * qed_vf_pf_bulletin_update_mac(): Ask PF to update the MAC address in 1066 * it's bulletin board 1067 * 1068 * @p_hwfn: HW device data. 1069 * @p_mac: mac address to be updated in bulletin board 1070 * 1071 * Return: Int. 1072 */ 1073int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, const u8 *p_mac); 1074 1075#else 1076static inline void qed_vf_get_link_params(struct qed_hwfn *p_hwfn, 1077 struct qed_mcp_link_params *params) 1078{ 1079} 1080 1081static inline void qed_vf_get_link_state(struct qed_hwfn *p_hwfn, 1082 struct qed_mcp_link_state *link) 1083{ 1084} 1085 1086static inline void 1087qed_vf_get_link_caps(struct qed_hwfn *p_hwfn, 1088 struct qed_mcp_link_capabilities *p_link_caps) 1089{ 1090} 1091 1092static inline void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs) 1093{ 1094} 1095 1096static inline void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs) 1097{ 1098} 1099 1100static inline void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids) 1101{ 1102} 1103 1104static inline void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac) 1105{ 1106} 1107 1108static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn, 1109 u8 *num_vlan_filters) 1110{ 1111} 1112 1113static inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, 1114 u8 *num_mac_filters) 1115{ 1116} 1117 1118static inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac) 1119{ 1120 return false; 1121} 1122 1123static inline void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn, 1124 u16 *fw_major, u16 *fw_minor, 1125 u16 *fw_rev, u16 *fw_eng) 1126{ 1127} 1128 1129static inline int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) 1130{ 1131 return -EINVAL; 1132} 1133 1134static inline int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn, 1135 struct qed_queue_cid *p_cid, 1136 u16 bd_max_bytes, 1137 dma_addr_t bd_chain_phys_adr, 1138 dma_addr_t cqe_pbl_addr, 1139 u16 cqe_pbl_size, void __iomem **pp_prod) 1140{ 1141 return -EINVAL; 1142} 1143 1144static inline int qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn, 1145 struct qed_queue_cid *p_cid, 1146 dma_addr_t pbl_addr, 1147 u16 pbl_size, void __iomem **pp_doorbell) 1148{ 1149 return -EINVAL; 1150} 1151 1152static inline int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn, 1153 struct qed_queue_cid *p_cid, 1154 bool cqe_completion) 1155{ 1156 return -EINVAL; 1157} 1158 1159static inline int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn, 1160 struct qed_queue_cid *p_cid) 1161{ 1162 return -EINVAL; 1163} 1164 1165static inline int 1166qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn, 1167 struct qed_sp_vport_update_params *p_params) 1168{ 1169 return -EINVAL; 1170} 1171 1172static inline int qed_vf_pf_reset(struct qed_hwfn *p_hwfn) 1173{ 1174 return -EINVAL; 1175} 1176 1177static inline int qed_vf_pf_release(struct qed_hwfn *p_hwfn) 1178{ 1179 return -EINVAL; 1180} 1181 1182static inline u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id) 1183{ 1184 return 0; 1185} 1186 1187static inline void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn, u16 sb_id, 1188 struct qed_sb_info *p_sb) 1189{ 1190} 1191 1192static inline int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn, 1193 u8 vport_id, 1194 u16 mtu, 1195 u8 inner_vlan_removal, 1196 enum qed_tpa_mode tpa_mode, 1197 u8 max_buffers_per_cqe, 1198 u8 only_untagged) 1199{ 1200 return -EINVAL; 1201} 1202 1203static inline int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn) 1204{ 1205 return -EINVAL; 1206} 1207 1208static inline int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn, 1209 struct qed_filter_ucast *p_param) 1210{ 1211 return -EINVAL; 1212} 1213 1214static inline void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn, 1215 struct qed_filter_mcast *p_filter_cmd) 1216{ 1217} 1218 1219static inline int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn) 1220{ 1221 return -EINVAL; 1222} 1223 1224static inline void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn, 1225 struct qed_mcp_link_params 1226 *p_params, 1227 struct qed_bulletin_content 1228 *p_bulletin) 1229{ 1230} 1231 1232static inline void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn, 1233 struct qed_mcp_link_state *p_link, 1234 struct qed_bulletin_content 1235 *p_bulletin) 1236{ 1237} 1238 1239static inline void 1240__qed_vf_get_link_caps(struct qed_hwfn *p_hwfn, 1241 struct qed_mcp_link_capabilities *p_link_caps, 1242 struct qed_bulletin_content *p_bulletin) 1243{ 1244} 1245 1246static inline void qed_iov_vf_task(struct work_struct *work) 1247{ 1248} 1249 1250static inline void 1251qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun) 1252{ 1253} 1254 1255static inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn, 1256 struct qed_tunnel_info *p_tunn) 1257{ 1258 return -EINVAL; 1259} 1260 1261static inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, 1262 const u8 *p_mac) 1263{ 1264 return -EINVAL; 1265} 1266 1267static inline u32 1268qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn, 1269 enum BAR_ID bar_id) 1270{ 1271 return 0; 1272} 1273#endif 1274 1275#endif 1276