2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
31 #ifndef __ECORE_SRIOV_API_H__
32 #define __ECORE_SRIOV_API_H__
34 #include "common_hsi.h"
35 #include "ecore_status.h"
37 #define ECORE_ETH_VF_NUM_MAC_FILTERS 1
38 #define ECORE_ETH_VF_NUM_VLAN_FILTERS 2
39 #define ECORE_VF_ARRAY_LENGTH (3)
41 #define IS_VF(p_dev) ((p_dev)->b_is_vf)
42 #define IS_PF(p_dev) (!((p_dev)->b_is_vf))
43 #ifdef CONFIG_ECORE_SRIOV
44 #define IS_PF_SRIOV(p_hwfn) (!!((p_hwfn)->p_dev->p_iov_info))
46 #define IS_PF_SRIOV(p_hwfn) (0)
48 #define IS_PF_SRIOV_ALLOC(p_hwfn) (!!((p_hwfn)->pf_iov_info))
49 #define IS_PF_PDA(p_hwfn) 0 /* @@TBD Michalk */
51 /* @@@ TBD MichalK - what should this number be*/
52 #define ECORE_MAX_VF_CHAINS_PER_PF 16
54 /* vport update extended feature tlvs flags */
55 enum ecore_iov_vport_update_flag {
56 ECORE_IOV_VP_UPDATE_ACTIVATE = 0,
57 ECORE_IOV_VP_UPDATE_VLAN_STRIP = 1,
58 ECORE_IOV_VP_UPDATE_TX_SWITCH = 2,
59 ECORE_IOV_VP_UPDATE_MCAST = 3,
60 ECORE_IOV_VP_UPDATE_ACCEPT_PARAM = 4,
61 ECORE_IOV_VP_UPDATE_RSS = 5,
62 ECORE_IOV_VP_UPDATE_ACCEPT_ANY_VLAN = 6,
63 ECORE_IOV_VP_UPDATE_SGE_TPA = 7,
64 ECORE_IOV_VP_UPDATE_MAX = 8,
67 /*PF to VF STATUS is part of vfpf-channel API
68 and must be forward compatible */
69 enum ecore_iov_pf_to_vf_status {
70 PFVF_STATUS_WAITING = 0,
73 PFVF_STATUS_NOT_SUPPORTED,
74 PFVF_STATUS_NO_RESOURCE,
76 PFVF_STATUS_MALICIOUS,
79 struct ecore_mcp_link_params;
80 struct ecore_mcp_link_state;
81 struct ecore_mcp_link_capabilities;
83 /* These defines are used by the hw-channel; should never change order */
84 #define VFPF_ACQUIRE_OS_LINUX (0)
85 #define VFPF_ACQUIRE_OS_WINDOWS (1)
86 #define VFPF_ACQUIRE_OS_ESX (2)
87 #define VFPF_ACQUIRE_OS_SOLARIS (3)
88 #define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
89 #define VFPF_ACQUIRE_OS_FREEBSD (5)
91 struct ecore_vf_acquire_sw_info {
96 struct ecore_public_vf_info {
97 /* These copies will later be reflected in the bulletin board,
98 * but this copy should be newer.
100 u8 forced_mac[ETH_ALEN];
104 struct ecore_iov_vf_init_params {
107 /* Number of requested Queues; Currently, don't support different
108 * number of Rx/Tx queues.
110 /* TODO - remove this limitation */
113 /* Allow the client to choose which qzones to use for Rx/Tx,
114 * and which queue_base to use for Tx queues on a per-queue basis.
115 * Notice values should be relative to the PF resources.
117 u16 req_rx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
118 u16 req_tx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
122 /* Should be set in case RSS is going to be used for VF */
126 #ifdef CONFIG_ECORE_SW_CHANNEL
127 /* This is SW channel related only... */
129 VF_PF_UNKNOWN_STATE = 0,
130 VF_PF_WAIT_FOR_START_REQUEST = 1,
131 VF_PF_WAIT_FOR_NEXT_CHUNK_OF_REQUEST = 2,
132 VF_PF_REQUEST_IN_PROCESSING = 3,
133 VF_PF_RESPONSE_READY = 4,
136 struct ecore_iov_sw_mbx {
137 enum mbx_state mbx_state;
147 * @brief Get the vf sw mailbox params
152 * @return struct ecore_iov_sw_mbx*
154 struct ecore_iov_sw_mbx*
155 ecore_iov_get_vf_sw_mbx(struct ecore_hwfn *p_hwfn,
159 /* This struct is part of ecore_dev and contains data relevant to all hwfns;
160 * Initialized only if SR-IOV cpabability is exposed in PCIe config space.
162 struct ecore_hw_sriov_info {
163 /* standard SRIOV capability fields, mostly for debugging */
164 int pos; /* capability position */
165 int nres; /* number of resources */
166 u32 cap; /* SR-IOV Capabilities */
167 u16 ctrl; /* SR-IOV Control */
168 u16 total_vfs; /* total VFs associated with the PF */
169 u16 num_vfs; /* number of vfs that have been started */
170 u16 initial_vfs; /* initial VFs associated with the PF */
171 u16 nr_virtfn; /* number of VFs available */
172 u16 offset; /* first VF Routing ID offset */
173 u16 stride; /* following VF stride */
174 u16 vf_device_id; /* VF device id */
175 u32 pgsz; /* page size for BAR alignment */
176 u8 link; /* Function Dependency Link */
181 #ifdef CONFIG_ECORE_SRIOV
184 * @brief mark/clear all VFs before/after an incoming PCIe sriov
190 void ecore_iov_set_vfs_to_disable(struct ecore_dev *p_dev,
194 * @brief mark/clear chosen VF before/after an incoming PCIe
201 void ecore_iov_set_vf_to_disable(struct ecore_dev *p_dev,
206 * @brief ecore_iov_init_hw_for_vf - initialize the HW for
207 * enabling access of a VF. Also includes preparing the
208 * IGU for VF access. This needs to be called AFTER hw is
209 * initialized and BEFORE VF is loaded inside the VM.
215 * @return enum _ecore_status_t
218 ecore_iov_init_hw_for_vf(struct ecore_hwfn *p_hwfn,
219 struct ecore_ptt *p_ptt,
220 struct ecore_iov_vf_init_params *p_params);
223 * @brief ecore_iov_process_mbx_req - process a request received
230 void ecore_iov_process_mbx_req(struct ecore_hwfn *p_hwfn,
231 struct ecore_ptt *p_ptt,
235 * @brief ecore_iov_release_hw_for_vf - called once upper layer
236 * knows VF is done with - can release any resources
237 * allocated for VF at this point. this must be done once
238 * we know VF is no longer loaded in VM.
244 * @return enum _ecore_status_t
246 enum _ecore_status_t ecore_iov_release_hw_for_vf(struct ecore_hwfn *p_hwfn,
247 struct ecore_ptt *p_ptt,
251 * @brief ecore_iov_set_vf_ctx - set a context for a given VF
257 * @return enum _ecore_status_t
259 enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn *p_hwfn,
264 * @brief FLR cleanup for all VFs
269 * @return enum _ecore_status_t
271 enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
272 struct ecore_ptt *p_ptt);
275 * @brief FLR cleanup for single VF
281 * @return enum _ecore_status_t
284 ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
285 struct ecore_ptt *p_ptt,
289 * @brief Update the bulletin with link information. Notice this does NOT
290 * send a bulletin update, only updates the PF's bulletin.
294 * @param params - the link params to use for the VF link configuration
295 * @param link - the link output to use for the VF link configuration
296 * @param p_caps - the link default capabilities.
298 void ecore_iov_set_link(struct ecore_hwfn *p_hwfn,
300 struct ecore_mcp_link_params *params,
301 struct ecore_mcp_link_state *link,
302 struct ecore_mcp_link_capabilities *p_caps);
305 * @brief Returns link information as perceived by VF.
309 * @param p_params - the link params visible to vf.
310 * @param p_link - the link state visible to vf.
311 * @param p_caps - the link default capabilities visible to vf.
313 void ecore_iov_get_link(struct ecore_hwfn *p_hwfn,
315 struct ecore_mcp_link_params *params,
316 struct ecore_mcp_link_state *link,
317 struct ecore_mcp_link_capabilities *p_caps);
320 * @brief return if the VF is pending FLR
327 bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,
332 * @brief Check if given VF ID @vfid is valid
333 * w.r.t. @b_enabled_only value
334 * if b_enabled_only = true - only enabled VF id is valid
335 * else any VF id less than max_vfs is valid
338 * @param rel_vf_id - Relative VF ID
339 * @param b_enabled_only - consider only enabled VF
340 * @param b_non_malicious - true iff we want to validate vf isn't malicious.
342 * @return bool - true for valid VF ID
344 bool ecore_iov_is_valid_vfid(struct ecore_hwfn *p_hwfn,
346 bool b_enabled_only, bool b_non_malicious);
350 * @brief Get VF's public info structure
353 * @param vfid - Relative VF ID
354 * @param b_enabled_only - false if want to access even if vf is disabled
356 * @return struct ecore_public_vf_info *
358 struct ecore_public_vf_info*
359 ecore_iov_get_public_vf_info(struct ecore_hwfn *p_hwfn,
360 u16 vfid, bool b_enabled_only);
363 * @brief fills a bitmask of all VFs which have pending unhandled
368 void ecore_iov_pf_get_pending_events(struct ecore_hwfn *p_hwfn,
372 * @brief Copy VF's message to PF's buffer
378 * @return enum _ecore_status_t
380 enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn *p_hwfn,
381 struct ecore_ptt *ptt,
384 * @brief Set forced MAC address in PFs copy of bulletin board
385 * and configures FW/HW to support the configuration.
391 void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn *p_hwfn,
395 * @brief Set MAC address in PFs copy of bulletin board without
402 enum _ecore_status_t ecore_iov_bulletin_set_mac(struct ecore_hwfn *p_hwfn,
406 * @brief Set default behaviour of VF in case no vlans are configured for it
407 * whether to accept only untagged traffic or all.
408 * Must be called prior to the VF vport-start.
411 * @param b_untagged_only
414 * @return ECORE_SUCCESS if configuration would stick.
417 ecore_iov_bulletin_set_forced_untagged_default(struct ecore_hwfn *p_hwfn,
418 bool b_untagged_only,
422 * @brief Get VFs opaque fid.
428 void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn *p_hwfn, int vfid,
432 * @brief Set forced VLAN [pvid] in PFs copy of bulletin board
433 * and configures FW/HW to support the configuration.
434 * Setting of pvid 0 would clear the feature.
439 void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn *p_hwfn,
443 * @brief Check if VF has VPORT instance. This can be used
444 * to check if VPORT is active.
448 bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn *p_hwfn, int vfid);
451 * @brief PF posts the bulletin to the VF
457 * @return enum _ecore_status_t
459 enum _ecore_status_t ecore_iov_post_vf_bulletin(struct ecore_hwfn *p_hwfn,
461 struct ecore_ptt *p_ptt);
464 * @brief Check if given VF (@vfid) is marked as stopped
469 * @return bool : true if stopped
471 bool ecore_iov_is_vf_stopped(struct ecore_hwfn *p_hwfn, int vfid);
474 * @brief Configure VF anti spoofing
478 * @param val - spoofchk value - true/false
480 * @return enum _ecore_status_t
482 enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn *p_hwfn,
486 * @brief Get VF's configured spoof value.
491 * @return bool - spoofchk value - true/false
493 bool ecore_iov_spoofchk_get(struct ecore_hwfn *p_hwfn, int vfid);
496 * @brief Check for SRIOV sanity by PF.
501 * @return bool - true if sanity checks passes, else false
503 bool ecore_iov_pf_sanity_check(struct ecore_hwfn *p_hwfn, int vfid);
506 * @brief Get the num of VF chains.
512 u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn *p_hwfn);
515 * @brief Get vf request mailbox params
519 * @param pp_req_virt_addr
520 * @param p_req_virt_size
522 void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn *p_hwfn,
524 void **pp_req_virt_addr,
525 u16 *p_req_virt_size);
528 * @brief Get vf mailbox params
532 * @param pp_reply_virt_addr
533 * @param p_reply_virt_size
535 void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn *p_hwfn,
537 void **pp_reply_virt_addr,
538 u16 *p_reply_virt_size);
541 * @brief Validate if the given length is a valid vfpf message
548 bool ecore_iov_is_valid_vfpf_msg_length(u32 length);
551 * @brief Return the max pfvf message length
555 u32 ecore_iov_pfvf_msg_length(void);
558 * @brief Returns forced MAC address if one is configured
563 * @return OSAL_NULL if mac isn't forced; Otherwise, returns MAC.
565 u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn *p_hwfn,
569 * @brief Returns pvid if one is configured
574 * @return 0 if no pvid is configured, otherwise the pvid.
576 u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn *p_hwfn,
579 * @brief Configure VFs tx rate
584 * @param val - tx rate value in Mb/sec.
586 * @return enum _ecore_status_t
588 enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn *p_hwfn,
589 struct ecore_ptt *p_ptt,
593 * @brief - Retrieves the statistics associated with a VF
598 * @param p_stats - this will be filled with the VF statistics
600 * @return ECORE_SUCCESS iff statistics were retrieved. Error otherwise.
602 enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn *p_hwfn,
603 struct ecore_ptt *p_ptt,
605 struct ecore_eth_stats *p_stats);
608 * @brief - Retrieves num of rxqs chains
613 * @return num of rxqs chains.
615 u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn *p_hwfn,
619 * @brief - Retrieves num of active rxqs chains
626 u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn *p_hwfn,
630 * @brief - Retrieves ctx pointer
637 void *ecore_iov_get_vf_ctx(struct ecore_hwfn *p_hwfn,
641 * @brief - Retrieves VF`s num sbs
648 u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn *p_hwfn,
652 * @brief - Returm true if VF is waiting for acquire
659 bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn *p_hwfn,
663 * @brief - Returm true if VF is acquired but not initialized
670 bool ecore_iov_is_vf_acquired_not_initialized(struct ecore_hwfn *p_hwfn,
674 * @brief - Returm true if VF is acquired and initialized
681 bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn,
685 * @brief - Returm true if VF has started in FW
692 bool ecore_iov_is_vf_started(struct ecore_hwfn *p_hwfn,
696 * @brief - Get VF's vport min rate configured.
700 * @return - rate in Mbps
702 int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid);
705 * @brief - Configure min rate for VF's vport.
708 * @param - rate in Mbps
712 enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev,
718 * @brief ecore_pf_configure_vf_queue_coalesce - PF configure coalesce parameters
719 * of VFs for Rx and Tx queue.
720 * While the API allows setting coalescing per-qid, all queues sharing a SB
721 * should be in same range [i.e., either 0-0x7f, 0x80-0xff or 0x100-0x1ff]
722 * otherwise configuration would break.
725 * @param rx_coal - Rx Coalesce value in micro seconds.
726 * @param tx_coal - TX Coalesce value in micro seconds.
733 ecore_iov_pf_configure_vf_queue_coalesce(struct ecore_hwfn *p_hwfn,
734 u16 rx_coal, u16 tx_coal,
738 * @brief - Given a VF index, return index of next [including that] active VF.
743 * @return MAX_NUM_VFS_E4 in case no further active VFs, otherwise index.
745 u16 ecore_iov_get_next_active_vf(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);
746 void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn *p_hwfn, int vfid,
747 u16 vxlan_port, u16 geneve_port);
749 #ifdef CONFIG_ECORE_SW_CHANNEL
751 * @brief Set whether PF should communicate with VF using SW/HW channel
752 * Needs to be called for an enabled VF before acquire is over
753 * [latest good point for doing that is OSAL_IOV_VF_ACQUIRE()]
756 * @param vfid - relative vf index
757 * @param b_is_hw - true iff PF is to use HW channel for communication
759 void ecore_iov_set_vf_hw_channel(struct ecore_hwfn *p_hwfn, int vfid,
764 static OSAL_INLINE void ecore_iov_set_vfs_to_disable(struct ecore_dev OSAL_UNUSED *p_dev, u8 OSAL_UNUSED to_disable) {}
765 static OSAL_INLINE void ecore_iov_set_vf_to_disable(struct ecore_dev OSAL_UNUSED *p_dev, u16 OSAL_UNUSED rel_vf_id, u8 OSAL_UNUSED to_disable) {}
766 static OSAL_INLINE enum _ecore_status_t ecore_iov_init_hw_for_vf(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, struct ecore_iov_vf_init_params OSAL_UNUSED *p_params) {return ECORE_INVAL;}
767 static OSAL_INLINE void ecore_iov_process_mbx_req(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, int OSAL_UNUSED vfid) {}
768 static OSAL_INLINE enum _ecore_status_t ecore_iov_release_hw_for_vf(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, u16 OSAL_UNUSED rel_vf_id) {return ECORE_SUCCESS;}
769 static OSAL_INLINE enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED vf_id, OSAL_UNUSED void *ctx) {return ECORE_INVAL;}
770 static OSAL_INLINE enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt) {return ECORE_INVAL;}
771 static OSAL_INLINE enum _ecore_status_t ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, u16 OSAL_UNUSED rel_vf_id) {return ECORE_INVAL;}
772 static OSAL_INLINE void ecore_iov_set_link(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED vfid, struct ecore_mcp_link_params OSAL_UNUSED *params, struct ecore_mcp_link_state OSAL_UNUSED *link, struct ecore_mcp_link_capabilities OSAL_UNUSED *p_caps) {}
773 static OSAL_INLINE void ecore_iov_get_link(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED vfid, struct ecore_mcp_link_params OSAL_UNUSED *params, struct ecore_mcp_link_state OSAL_UNUSED *link, struct ecore_mcp_link_capabilities OSAL_UNUSED *p_caps) {}
774 static OSAL_INLINE bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return false;}
776 static OSAL_INLINE bool
777 ecore_iov_is_valid_vfid(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED rel_vf_id,
778 bool OSAL_UNUSED b_enabled_only,
779 bool OSAL_UNUSED b_non_malicious)
784 static OSAL_INLINE struct ecore_public_vf_info* ecore_iov_get_public_vf_info(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED vfid, bool OSAL_UNUSED b_enabled_only) {return OSAL_NULL;}
785 static OSAL_INLINE void ecore_iov_pf_add_pending_events(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u8 OSAL_UNUSED vfid) {}
786 static OSAL_INLINE void ecore_iov_pf_get_and_clear_pending_events(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u64 OSAL_UNUSED *events) {}
787 static OSAL_INLINE enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *ptt, int OSAL_UNUSED vfid) {return ECORE_INVAL;}
788 static OSAL_INLINE void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u8 OSAL_UNUSED *mac, int OSAL_UNUSED vfid) {}
789 static OSAL_INLINE enum _ecore_status_t ecore_iov_bulletin_set_mac(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u8 OSAL_UNUSED *mac, OSAL_UNUSED int vfid) {return ECORE_INVAL;}
790 static OSAL_INLINE enum _ecore_status_t ecore_iov_bulletin_set_forced_untagged_default(struct ecore_hwfn OSAL_UNUSED *p_hwfn, bool OSAL_UNUSED b_untagged_only, int OSAL_UNUSED vfid) {return ECORE_INVAL;}
791 static OSAL_INLINE void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid, u16 OSAL_UNUSED *opaque_fid) {}
792 static OSAL_INLINE void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn OSAL_UNUSED p_hwfn, u16 OSAL_UNUSED pvid, int OSAL_UNUSED vfid) {}
794 static OSAL_INLINE bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid) {return false;}
795 static OSAL_INLINE enum _ecore_status_t ecore_iov_post_vf_bulletin(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid, struct ecore_ptt OSAL_UNUSED *p_ptt) {return ECORE_INVAL;}
796 static OSAL_INLINE bool ecore_iov_is_vf_stopped(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid) {return false;}
797 static OSAL_INLINE enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid, bool OSAL_UNUSED val) {return ECORE_INVAL;}
798 static OSAL_INLINE bool ecore_iov_spoofchk_get(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid) {return false;}
799 static OSAL_INLINE bool ecore_iov_pf_sanity_check(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid) {return false;}
800 static OSAL_INLINE u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn OSAL_UNUSED *p_hwfn) {return 0;}
801 static OSAL_INLINE void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id, void OSAL_UNUSED **pp_req_virt_addr, u16 OSAL_UNUSED *p_req_virt_size) {}
802 static OSAL_INLINE void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id, void OSAL_UNUSED **pp_reply_virt_addr, u16 OSAL_UNUSED *p_reply_virt_size) {}
803 static OSAL_INLINE bool ecore_iov_is_valid_vfpf_msg_length(u32 OSAL_UNUSED length) {return false;}
804 static OSAL_INLINE u32 ecore_iov_pfvf_msg_length(void) {return 0;}
805 static OSAL_INLINE u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return OSAL_NULL;}
806 static OSAL_INLINE u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return 0;}
807 static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, int OSAL_UNUSED vfid, int OSAL_UNUSED val) { return ECORE_INVAL; }
808 static OSAL_INLINE enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn OSAL_UNUSED *p_hwfn, struct ecore_ptt OSAL_UNUSED *p_ptt, int OSAL_UNUSED vfid, struct ecore_eth_stats OSAL_UNUSED *p_stats) { return ECORE_INVAL; }
810 static OSAL_INLINE u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return 0;}
811 static OSAL_INLINE u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return 0;}
812 static OSAL_INLINE void *ecore_iov_get_vf_ctx(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return OSAL_NULL;}
813 static OSAL_INLINE u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return 0;}
814 static OSAL_INLINE bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return false;}
815 static OSAL_INLINE bool ecore_iov_is_vf_acquired_not_initialized(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return false;}
816 static OSAL_INLINE bool ecore_iov_is_vf_initialized(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) {return false;}
817 static OSAL_INLINE int ecore_iov_get_vf_min_rate(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid) { return 0; }
818 static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev OSAL_UNUSED *p_dev, int OSAL_UNUSED vfid, OSAL_UNUSED u32 rate) { return ECORE_INVAL; }
820 static OSAL_INLINE void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn OSAL_UNUSED *p_hwfn, int OSAL_UNUSED vfid, u16 OSAL_UNUSED vxlan_port, u16 OSAL_UNUSED geneve_port) { return; }
821 static OSAL_INLINE u16 ecore_iov_get_next_active_vf(struct ecore_hwfn OSAL_UNUSED *p_hwfn, u16 OSAL_UNUSED rel_vf_id) { return MAX_NUM_VFS_E4; }
823 #ifdef CONFIG_ECORE_SW_CHANNEL
824 static OSAL_INLINE void
825 ecore_iov_set_vf_hw_channel(struct ecore_hwfn OSAL_UNUSED *p_hwfn,
826 int OSAL_UNUSED vfid, bool OSAL_UNUSED b_is_hw) {}
830 #define ecore_for_each_vf(_p_hwfn, _i) \
831 for (_i = ecore_iov_get_next_active_vf(_p_hwfn, 0); \
832 _i < MAX_NUM_VFS_E4; \
833 _i = ecore_iov_get_next_active_vf(_p_hwfn, _i + 1))