9506 Want support for QLogic QL41000/45000 series devices
[unleashed.git] / usr / src / uts / common / io / qede / 579xx / drivers / ecore / ecore_iov_api.h
blobf6fc6899c71458e034732a0211109b35c7eaf667
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1, (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1, (the "License").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 #ifndef __ECORE_SRIOV_API_H__
37 #define __ECORE_SRIOV_API_H__
39 #include "common_hsi.h"
40 #include "ecore_status.h"
42 #define ECORE_ETH_VF_NUM_MAC_FILTERS 1
43 #define ECORE_ETH_VF_NUM_VLAN_FILTERS 2
44 #define ECORE_VF_ARRAY_LENGTH (3)
46 #define IS_VF(p_dev) ((p_dev)->b_is_vf)
47 #define IS_PF(p_dev) (!((p_dev)->b_is_vf))
48 #ifdef CONFIG_ECORE_SRIOV
49 #define IS_PF_SRIOV(p_hwfn) (!!((p_hwfn)->p_dev->p_iov_info))
50 #else
51 #define IS_PF_SRIOV(p_hwfn) (0)
52 #endif
53 #define IS_PF_SRIOV_ALLOC(p_hwfn) (!!((p_hwfn)->pf_iov_info))
54 #define IS_PF_PDA(p_hwfn) 0 /* @@TBD Michalk */
56 /* @@@ TBD MichalK - what should this number be*/
57 #define ECORE_MAX_VF_CHAINS_PER_PF 16
59 /* vport update extended feature tlvs flags */
60 enum ecore_iov_vport_update_flag {
61 ECORE_IOV_VP_UPDATE_ACTIVATE = 0,
62 ECORE_IOV_VP_UPDATE_VLAN_STRIP = 1,
63 ECORE_IOV_VP_UPDATE_TX_SWITCH = 2,
64 ECORE_IOV_VP_UPDATE_MCAST = 3,
65 ECORE_IOV_VP_UPDATE_ACCEPT_PARAM = 4,
66 ECORE_IOV_VP_UPDATE_RSS = 5,
67 ECORE_IOV_VP_UPDATE_ACCEPT_ANY_VLAN = 6,
68 ECORE_IOV_VP_UPDATE_SGE_TPA = 7,
69 ECORE_IOV_VP_UPDATE_MAX = 8,
72 /*PF to VF STATUS is part of vfpf-channel API
73 and must be forward compatible */
74 enum ecore_iov_pf_to_vf_status {
75 PFVF_STATUS_WAITING = 0,
76 PFVF_STATUS_SUCCESS,
77 PFVF_STATUS_FAILURE,
78 PFVF_STATUS_NOT_SUPPORTED,
79 PFVF_STATUS_NO_RESOURCE,
80 PFVF_STATUS_FORCED,
81 PFVF_STATUS_MALICIOUS,
84 struct ecore_mcp_link_params;
85 struct ecore_mcp_link_state;
86 struct ecore_mcp_link_capabilities;
88 /* These defines are used by the hw-channel; should never change order */
89 #define VFPF_ACQUIRE_OS_LINUX (0)
90 #define VFPF_ACQUIRE_OS_WINDOWS (1)
91 #define VFPF_ACQUIRE_OS_ESX (2)
92 #define VFPF_ACQUIRE_OS_SOLARIS (3)
93 #define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
95 struct ecore_vf_acquire_sw_info {
96 u32 driver_version;
97 u8 os_type;
100 struct ecore_public_vf_info {
101 /* These copies will later be reflected in the bulletin board,
102 * but this copy should be newer.
104 u8 forced_mac[ETH_ALEN];
105 u16 forced_vlan;
108 struct ecore_iov_vf_init_params {
109 u16 rel_vf_id;
111 /* Number of requested Queues; Currently, don't support different
112 * number of Rx/Tx queues.
114 /* TODO - remove this limitation */
115 u16 num_queues;
117 /* Allow the client to choose which qzones to use for Rx/Tx,
118 * and which queue_base to use for Tx queues on a per-queue basis.
119 * Notice values should be relative to the PF resources.
121 u16 req_rx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
122 u16 req_tx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
124 u8 vport_id;
126 /* Should be set in case RSS is going to be used for VF */
127 u8 rss_eng_id;
130 #ifdef CONFIG_ECORE_SW_CHANNEL
131 /* This is SW channel related only... */
132 enum mbx_state {
133 VF_PF_UNKNOWN_STATE = 0,
134 VF_PF_WAIT_FOR_START_REQUEST = 1,
135 VF_PF_WAIT_FOR_NEXT_CHUNK_OF_REQUEST = 2,
136 VF_PF_REQUEST_IN_PROCESSING = 3,
137 VF_PF_RESPONSE_READY = 4,
140 struct ecore_iov_sw_mbx {
141 enum mbx_state mbx_state;
143 u32 request_size;
144 u32 request_offset;
146 u32 response_size;
147 u32 response_offset;
151 * @brief Get the vf sw mailbox params
153 * @param p_hwfn
154 * @param rel_vf_id
156 * @return struct ecore_iov_sw_mbx*
158 struct ecore_iov_sw_mbx*
159 ecore_iov_get_vf_sw_mbx(struct ecore_hwfn *p_hwfn,
160 u16 rel_vf_id);
161 #endif
163 /* This struct is part of ecore_dev and contains data relevant to all hwfns;
164 * Initialized only if SR-IOV cpabability is exposed in PCIe config space.
166 struct ecore_hw_sriov_info {
167 /* standard SRIOV capability fields, mostly for debugging */
168 int pos; /* capability position */
169 int nres; /* number of resources */
170 u32 cap; /* SR-IOV Capabilities */
171 u16 ctrl; /* SR-IOV Control */
172 u16 total_vfs; /* total VFs associated with the PF */
173 u16 num_vfs; /* number of vfs that have been started */
174 u16 initial_vfs; /* initial VFs associated with the PF */
175 u16 nr_virtfn; /* number of VFs available */
176 u16 offset; /* first VF Routing ID offset */
177 u16 stride; /* following VF stride */
178 u16 vf_device_id; /* VF device id */
179 u32 pgsz; /* page size for BAR alignment */
180 u8 link; /* Function Dependency Link */
182 u32 first_vf_in_pf;
185 #ifdef CONFIG_ECORE_SRIOV
186 #ifndef LINUX_REMOVE
188 * @brief mark/clear all VFs before/after an incoming PCIe sriov
189 * disable.
191 * @param p_dev
192 * @param to_disable
194 void ecore_iov_set_vfs_to_disable(struct ecore_dev *p_dev,
195 u8 to_disable);
198 * @brief mark/clear chosen VF before/after an incoming PCIe
199 * sriov disable.
201 * @param p_dev
202 * @param rel_vf_id
203 * @param to_disable
205 void ecore_iov_set_vf_to_disable(struct ecore_dev *p_dev,
206 u16 rel_vf_id,
207 u8 to_disable);
210 * @brief ecore_iov_init_hw_for_vf - initialize the HW for
211 * enabling access of a VF. Also includes preparing the
212 * IGU for VF access. This needs to be called AFTER hw is
213 * initialized and BEFORE VF is loaded inside the VM.
215 * @param p_hwfn
216 * @param p_ptt
217 * @param p_params
219 * @return enum _ecore_status_t
221 enum _ecore_status_t
222 ecore_iov_init_hw_for_vf(struct ecore_hwfn *p_hwfn,
223 struct ecore_ptt *p_ptt,
224 struct ecore_iov_vf_init_params *p_params);
227 * @brief ecore_iov_process_mbx_req - process a request received
228 * from the VF
230 * @param p_hwfn
231 * @param p_ptt
232 * @param vfid
234 void ecore_iov_process_mbx_req(struct ecore_hwfn *p_hwfn,
235 struct ecore_ptt *p_ptt,
236 int vfid);
239 * @brief ecore_iov_release_hw_for_vf - called once upper layer
240 * knows VF is done with - can release any resources
241 * allocated for VF at this point. this must be done once
242 * we know VF is no longer loaded in VM.
244 * @param p_hwfn
245 * @param p_ptt
246 * @param rel_vf_id
248 * @return enum _ecore_status_t
250 enum _ecore_status_t ecore_iov_release_hw_for_vf(struct ecore_hwfn *p_hwfn,
251 struct ecore_ptt *p_ptt,
252 u16 rel_vf_id);
255 * @brief ecore_iov_set_vf_ctx - set a context for a given VF
257 * @param p_hwfn
258 * @param vf_id
259 * @param ctx
261 * @return enum _ecore_status_t
263 enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn *p_hwfn,
264 u16 vf_id,
265 void *ctx);
268 * @brief FLR cleanup for all VFs
270 * @param p_hwfn
271 * @param p_ptt
273 * @return enum _ecore_status_t
275 enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
276 struct ecore_ptt *p_ptt);
279 * @brief FLR cleanup for single VF
281 * @param p_hwfn
282 * @param p_ptt
283 * @param rel_vf_id
285 * @return enum _ecore_status_t
287 enum _ecore_status_t
288 ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
289 struct ecore_ptt *p_ptt,
290 u16 rel_vf_id);
293 * @brief Update the bulletin with link information. Notice this does NOT
294 * send a bulletin update, only updates the PF's bulletin.
296 * @param p_hwfn
297 * @param p_vf
298 * @param params - the link params to use for the VF link configuration
299 * @param link - the link output to use for the VF link configuration
300 * @param p_caps - the link default capabilities.
302 void ecore_iov_set_link(struct ecore_hwfn *p_hwfn,
303 u16 vfid,
304 struct ecore_mcp_link_params *params,
305 struct ecore_mcp_link_state *link,
306 struct ecore_mcp_link_capabilities *p_caps);
309 * @brief Returns link information as perceived by VF.
311 * @param p_hwfn
312 * @param p_vf
313 * @param p_params - the link params visible to vf.
314 * @param p_link - the link state visible to vf.
315 * @param p_caps - the link default capabilities visible to vf.
317 void ecore_iov_get_link(struct ecore_hwfn *p_hwfn,
318 u16 vfid,
319 struct ecore_mcp_link_params *params,
320 struct ecore_mcp_link_state *link,
321 struct ecore_mcp_link_capabilities *p_caps);
324 * @brief return if the VF is pending FLR
326 * @param p_hwfn
327 * @param rel_vf_id
329 * @return bool
331 bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,
332 u16 rel_vf_id);
335 * @brief Check if given VF ID @vfid is valid
336 * w.r.t. @b_enabled_only value
337 * if b_enabled_only = true - only enabled VF id is valid
338 * else any VF id less than max_vfs is valid
340 * @param p_hwfn
341 * @param rel_vf_id - Relative VF ID
342 * @param b_enabled_only - consider only enabled VF
343 * @param b_non_malicious - true iff we want to validate vf isn't malicious.
345 * @return bool - true for valid VF ID
347 bool ecore_iov_is_valid_vfid(struct ecore_hwfn *p_hwfn,
348 int rel_vf_id,
349 bool b_enabled_only, bool b_non_malicious);
352 * @brief Get VF's public info structure
354 * @param p_hwfn
355 * @param vfid - Relative VF ID
356 * @param b_enabled_only - false if want to access even if vf is disabled
358 * @return struct ecore_public_vf_info *
360 struct ecore_public_vf_info*
361 ecore_iov_get_public_vf_info(struct ecore_hwfn *p_hwfn,
362 u16 vfid, bool b_enabled_only);
365 * @brief fills a bitmask of all VFs which have pending unhandled
366 * messages.
368 * @param p_hwfn
370 void ecore_iov_pf_get_pending_events(struct ecore_hwfn *p_hwfn,
371 u64 *events);
374 * @brief Copy VF's message to PF's buffer
376 * @param p_hwfn
377 * @param ptt
378 * @param vfid
380 * @return enum _ecore_status_t
382 enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn *p_hwfn,
383 struct ecore_ptt *ptt,
384 int vfid);
386 * @brief Set forced MAC address in PFs copy of bulletin board
387 * and configures FW/HW to support the configuration.
389 * @param p_hwfn
390 * @param mac
391 * @param vfid
393 void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn *p_hwfn,
394 u8 *mac, int vfid);
397 * @brief Set MAC address in PFs copy of bulletin board without
398 * configuring FW/HW.
400 * @param p_hwfn
401 * @param mac
402 * @param vfid
404 enum _ecore_status_t ecore_iov_bulletin_set_mac(struct ecore_hwfn *p_hwfn,
405 u8 *mac, int vfid);
408 * @brief Set default behaviour of VF in case no vlans are configured for it
409 * whether to accept only untagged traffic or all.
410 * Must be called prior to the VF vport-start.
412 * @param p_hwfn
413 * @param b_untagged_only
414 * @param vfid
416 * @return ECORE_SUCCESS if configuration would stick.
418 enum _ecore_status_t
419 ecore_iov_bulletin_set_forced_untagged_default(struct ecore_hwfn *p_hwfn,
420 bool b_untagged_only,
421 int vfid);
424 * @brief Get VFs opaque fid.
426 * @param p_hwfn
427 * @param vfid
428 * @param opaque_fid
430 void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn *p_hwfn, int vfid,
431 u16 *opaque_fid);
434 * @brief Set forced VLAN [pvid] in PFs copy of bulletin board
435 * and configures FW/HW to support the configuration.
436 * Setting of pvid 0 would clear the feature.
437 * @param p_hwfn
438 * @param pvid
439 * @param vfid
441 void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn *p_hwfn,
442 u16 pvid, int vfid);
445 * @brief Check if VF has VPORT instance. This can be used
446 * to check if VPORT is active.
448 * @param p_hwfn
450 bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn *p_hwfn, int vfid);
453 * @brief PF posts the bulletin to the VF
455 * @param p_hwfn
456 * @param p_vf
457 * @param p_ptt
459 * @return enum _ecore_status_t
461 enum _ecore_status_t ecore_iov_post_vf_bulletin(struct ecore_hwfn *p_hwfn,
462 int vfid,
463 struct ecore_ptt *p_ptt);
466 * @brief Check if given VF (@vfid) is marked as stopped
468 * @param p_hwfn
469 * @param vfid
471 * @return bool : true if stopped
473 bool ecore_iov_is_vf_stopped(struct ecore_hwfn *p_hwfn, int vfid);
476 * @brief Configure VF anti spoofing
478 * @param p_hwfn
479 * @param vfid
480 * @param val - spoofchk value - true/false
482 * @return enum _ecore_status_t
484 enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn *p_hwfn,
485 int vfid, bool val);
488 * @brief Get VF's configured spoof value.
490 * @param p_hwfn
491 * @param vfid
493 * @return bool - spoofchk value - true/false
495 bool ecore_iov_spoofchk_get(struct ecore_hwfn *p_hwfn, int vfid);
498 * @brief Check for SRIOV sanity by PF.
500 * @param p_hwfn
501 * @param vfid
503 * @return bool - true if sanity checks passes, else false
505 bool ecore_iov_pf_sanity_check(struct ecore_hwfn *p_hwfn, int vfid);
508 * @brief Get the num of VF chains.
510 * @param p_hwfn
512 * @return u8
514 u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn *p_hwfn);
517 * @brief Get vf request mailbox params
519 * @param p_hwfn
520 * @param rel_vf_id
521 * @param pp_req_virt_addr
522 * @param p_req_virt_size
524 void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn *p_hwfn,
525 u16 rel_vf_id,
526 void **pp_req_virt_addr,
527 u16 *p_req_virt_size);
530 * @brief Get vf mailbox params
532 * @param p_hwfn
533 * @param rel_vf_id
534 * @param pp_reply_virt_addr
535 * @param p_reply_virt_size
537 void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn *p_hwfn,
538 u16 rel_vf_id,
539 void **pp_reply_virt_addr,
540 u16 *p_reply_virt_size);
543 * @brief Validate if the given length is a valid vfpf message
544 * length
546 * @param length
548 * @return bool
550 bool ecore_iov_is_valid_vfpf_msg_length(u32 length);
553 * @brief Return the max pfvf message length
555 * @return u32
557 u32 ecore_iov_pfvf_msg_length(void);
560 * @brief Returns forced MAC address if one is configured
562 * @parm p_hwfn
563 * @parm rel_vf_id
565 * @return OSAL_NULL if mac isn't forced; Otherwise, returns MAC.
567 u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn *p_hwfn,
568 u16 rel_vf_id);
571 * @brief Returns pvid if one is configured
573 * @parm p_hwfn
574 * @parm rel_vf_id
576 * @return 0 if no pvid is configured, otherwise the pvid.
578 u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn *p_hwfn,
579 u16 rel_vf_id);
581 * @brief Configure VFs tx rate
583 * @param p_hwfn
584 * @param p_ptt
585 * @param vfid
586 * @param val - tx rate value in Mb/sec.
588 * @return enum _ecore_status_t
590 enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn *p_hwfn,
591 struct ecore_ptt *p_ptt,
592 int vfid, int val);
595 * @brief - Retrieves the statistics associated with a VF
597 * @param p_hwfn
598 * @param p_ptt
599 * @param vfid
600 * @param p_stats - this will be filled with the VF statistics
602 * @return ECORE_SUCCESS iff statistics were retrieved. Error otherwise.
604 enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn *p_hwfn,
605 struct ecore_ptt *p_ptt,
606 int vfid,
607 struct ecore_eth_stats *p_stats);
610 * @brief - Retrieves num of rxqs chains
612 * @param p_hwfn
613 * @param rel_vf_id
615 * @return num of rxqs chains.
617 u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn *p_hwfn,
618 u16 rel_vf_id);
621 * @brief - Retrieves num of active rxqs chains
623 * @param p_hwfn
624 * @param rel_vf_id
626 * @return
628 u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn *p_hwfn,
629 u16 rel_vf_id);
632 * @brief - Retrieves ctx pointer
634 * @param p_hwfn
635 * @param rel_vf_id
637 * @return
639 void *ecore_iov_get_vf_ctx(struct ecore_hwfn *p_hwfn,
640 u16 rel_vf_id);
643 * @brief - Retrieves VF`s num sbs
645 * @param p_hwfn
646 * @param rel_vf_id
648 * @return
650 u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn *p_hwfn,
651 u16 rel_vf_id);
654 * @brief - Returm true if VF is waiting for acquire
656 * @param p_hwfn
657 * @param rel_vf_id
659 * @return
661 bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn *p_hwfn,
662 u16 rel_vf_id);
665 * @brief - Returm true if VF is acquired but not initialized
667 * @param p_hwfn
668 * @param rel_vf_id
670 * @return
672 bool ecore_iov_is_vf_acquired_not_initialized(struct ecore_hwfn *p_hwfn,
673 u16 rel_vf_id);
676 * @brief - Returm true if VF is acquired and initialized
678 * @param p_hwfn
679 * @param rel_vf_id
681 * @return
683 bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn,
684 u16 rel_vf_id);
687 * @brief - Returm true if VF has started in FW
689 * @param p_hwfn
690 * @param rel_vf_id
692 * @return
694 bool ecore_iov_is_vf_started(struct ecore_hwfn *p_hwfn,
695 u16 rel_vf_id);
698 * @brief - Get VF's vport min rate configured.
699 * @param p_hwfn
700 * @param rel_vf_id
702 * @return - rate in Mbps
704 int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid);
707 * @brief - Configure min rate for VF's vport.
708 * @param p_dev
709 * @param vfid
710 * @param - rate in Mbps
712 * @return
714 enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev,
715 int vfid, u32 rate);
717 #endif
720 * @brief ecore_pf_configure_vf_queue_coalesce - PF configure coalesce parameters
721 * of VFs for Rx and Tx queue.
722 * While the API allows setting coalescing per-qid, all queues sharing a SB
723 * should be in same range [i.e., either 0-0x7f, 0x80-0xff or 0x100-0x1ff]
724 * otherwise configuration would break.
726 * @param p_hwfn
727 * @param rx_coal - Rx Coalesce value in micro seconds.
728 * @param tx_coal - TX Coalesce value in micro seconds.
729 * @param vf_id
730 * @param qid
732 * @return int
734 enum _ecore_status_t
735 ecore_iov_pf_configure_vf_queue_coalesce(struct ecore_hwfn *p_hwfn,
736 u16 rx_coal, u16 tx_coal,
737 u16 vf_id, u16 qid);
740 * @brief - Given a VF index, return index of next [including that] active VF.
742 * @param p_hwfn
743 * @param rel_vf_id
745 * @return E4_MAX_NUM_VFS in case no further active VFs, otherwise index.
747 u16 ecore_iov_get_next_active_vf(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);
748 void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn *p_hwfn, int vfid,
749 u16 vxlan_port, u16 geneve_port);
750 #else
751 #ifndef LINUX_REMOVE
752 static OSAL_INLINE void ecore_iov_set_vfs_to_disable(struct ecore_dev *p_dev, u8 to_disable) {}
753 static OSAL_INLINE void ecore_iov_set_vf_to_disable(struct ecore_dev *p_dev, u16 rel_vf_id, u8 to_disable) {}
754 static OSAL_INLINE enum _ecore_status_t ecore_iov_init_hw_for_vf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, struct ecore_iov_vf_init_params *p_params) {return ECORE_INVAL;}
755 static OSAL_INLINE void ecore_iov_process_mbx_req(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, int vfid) {}
756 static OSAL_INLINE enum _ecore_status_t ecore_iov_release_hw_for_vf(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u16 rel_vf_id) {return ECORE_SUCCESS;}
757 static OSAL_INLINE enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn *p_hwfn, u16 vf_id, void *ctx) {return ECORE_INVAL;}
758 static OSAL_INLINE enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) {return ECORE_INVAL;}
759 static OSAL_INLINE enum _ecore_status_t ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u16 rel_vf_id) {return ECORE_INVAL;}
760 static OSAL_INLINE void ecore_iov_set_link(struct ecore_hwfn *p_hwfn, u16 vfid, struct ecore_mcp_link_params *params, struct ecore_mcp_link_state *link, struct ecore_mcp_link_capabilities *p_caps) {}
761 static OSAL_INLINE void ecore_iov_get_link(struct ecore_hwfn *p_hwfn, u16 vfid, struct ecore_mcp_link_params *params, struct ecore_mcp_link_state *link, struct ecore_mcp_link_capabilities *p_caps) {}
762 static OSAL_INLINE bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return false;}
763 static OSAL_INLINE bool ecore_iov_is_valid_vfid(struct ecore_hwfn *p_hwfn, int rel_vf_id, bool b_enabled_only) {return false;}
764 static OSAL_INLINE struct ecore_public_vf_info* ecore_iov_get_public_vf_info(struct ecore_hwfn *p_hwfn, u16 vfid, bool b_enabled_only) {return OSAL_NULL;}
765 static OSAL_INLINE void ecore_iov_pf_add_pending_events(struct ecore_hwfn *p_hwfn, u8 vfid) {}
766 static OSAL_INLINE void ecore_iov_pf_get_and_clear_pending_events(struct ecore_hwfn *p_hwfn, u64 *events) {}
767 static OSAL_INLINE enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn *p_hwfn, struct ecore_ptt *ptt, int vfid) {return ECORE_INVAL;}
768 static OSAL_INLINE void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn *p_hwfn, u8 *mac, int vfid) {}
769 static OSAL_INLINE enum _ecore_status_t ecore_iov_bulletin_set_mac(struct ecore_hwfn *p_hwfn, u8 *mac, int vfid) {return ECORE_INVAL;}
770 static OSAL_INLINE enum _ecore_status_t ecore_iov_bulletin_set_forced_untagged_default(struct ecore_hwfn *p_hwfn, bool b_untagged_only, int vfid) {return ECORE_INVAL;}
771 static OSAL_INLINE void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn *p_hwfn, int vfid, u16 *opaque_fid) {}
772 static OSAL_INLINE void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn p_hwfn, u16 pvid, int vfid) {}
774 static OSAL_INLINE bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn *p_hwfn, int vfid) {return false;}
775 static OSAL_INLINE enum _ecore_status_t ecore_iov_post_vf_bulletin(struct ecore_hwfn *p_hwfn, int vfid, struct ecore_ptt *p_ptt) {return ECORE_INVAL;}
776 static OSAL_INLINE bool ecore_iov_is_vf_stopped(struct ecore_hwfn *p_hwfn, int vfid) {return false;}
777 static OSAL_INLINE enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn *p_hwfn, int vfid, bool val) {return ECORE_INVAL;}
778 static OSAL_INLINE bool ecore_iov_spoofchk_get(struct ecore_hwfn *p_hwfn, int vfid) {return false;}
779 static OSAL_INLINE bool ecore_iov_pf_sanity_check(struct ecore_hwfn *p_hwfn, int vfid) {return false;}
780 static OSAL_INLINE u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn *p_hwfn) {return 0;}
781 static OSAL_INLINE void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn *p_hwfn, u16 rel_vf_id, void **pp_req_virt_addr, u16 *p_req_virt_size) {}
782 static OSAL_INLINE void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn *p_hwfn, u16 rel_vf_id, void **pp_reply_virt_addr, u16 *p_reply_virt_size) {}
783 static OSAL_INLINE bool ecore_iov_is_valid_vfpf_msg_length(u32 length) {return false;}
784 static OSAL_INLINE u32 ecore_iov_pfvf_msg_length(void) {return 0;}
785 static OSAL_INLINE u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return OSAL_NULL;}
786 static OSAL_INLINE u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return 0;}
787 static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, int vfid, int val) { return ECORE_INVAL; }
788 static OSAL_INLINE enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, int vfid, struct ecore_eth_stats *p_stats) { return ECORE_INVAL; }
790 static OSAL_INLINE u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return 0;}
791 static OSAL_INLINE u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return 0;}
792 static OSAL_INLINE void *ecore_iov_get_vf_ctx(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return OSAL_NULL;}
793 static OSAL_INLINE u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return 0;}
794 static OSAL_INLINE bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return false;}
795 static OSAL_INLINE bool ecore_iov_is_vf_acquired_not_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return false;}
796 static OSAL_INLINE bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) {return false;}
797 static OSAL_INLINE int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid) { return 0; }
798 static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev, int vfid, u32 rate) { return ECORE_INVAL; }
799 #endif
800 static OSAL_INLINE void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn *p_hwfn, int vfid, u16 vxlan_port, u16 geneve_port) { return; }
801 static OSAL_INLINE u16 ecore_iov_get_next_active_vf(struct ecore_hwfn *p_hwfn, u16 rel_vf_id) { return E4_MAX_NUM_VFS; }
802 #endif
804 #define ecore_for_each_vf(_p_hwfn, _i) \
805 for (_i = ecore_iov_get_next_active_vf(_p_hwfn, 0); \
806 _i < E4_MAX_NUM_VFS; \
807 _i = ecore_iov_get_next_active_vf(_p_hwfn, _i + 1))
809 #endif