New upstream version 18.08
[deb_dpdk.git] / drivers / net / qede / base / ecore_iov_api.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2016 - 2018 Cavium Inc.
3  * All rights reserved.
4  * www.cavium.com
5  */
6
7 #ifndef __ECORE_SRIOV_API_H__
8 #define __ECORE_SRIOV_API_H__
9
10 #include "common_hsi.h"
11 #include "ecore_status.h"
12
13 #define ECORE_ETH_VF_NUM_MAC_FILTERS 1
14 #define ECORE_ETH_VF_NUM_VLAN_FILTERS 2
15 #define ECORE_VF_ARRAY_LENGTH (3)
16
17 #define IS_VF(p_dev)            ((p_dev)->b_is_vf)
18 #define IS_PF(p_dev)            (!((p_dev)->b_is_vf))
19 #ifdef CONFIG_ECORE_SRIOV
20 #define IS_PF_SRIOV(p_hwfn)     (!!((p_hwfn)->p_dev->p_iov_info))
21 #else
22 #define IS_PF_SRIOV(p_hwfn)     (0)
23 #endif
24 #define IS_PF_SRIOV_ALLOC(p_hwfn)       (!!((p_hwfn)->pf_iov_info))
25 #define IS_PF_PDA(p_hwfn)       0 /* @@TBD Michalk */
26
27 /* @@@ TBD MichalK - what should this number be*/
28 #define ECORE_MAX_VF_CHAINS_PER_PF 16
29
30 /* vport update extended feature tlvs flags */
31 enum ecore_iov_vport_update_flag {
32         ECORE_IOV_VP_UPDATE_ACTIVATE            = 0,
33         ECORE_IOV_VP_UPDATE_VLAN_STRIP          = 1,
34         ECORE_IOV_VP_UPDATE_TX_SWITCH           = 2,
35         ECORE_IOV_VP_UPDATE_MCAST               = 3,
36         ECORE_IOV_VP_UPDATE_ACCEPT_PARAM        = 4,
37         ECORE_IOV_VP_UPDATE_RSS                 = 5,
38         ECORE_IOV_VP_UPDATE_ACCEPT_ANY_VLAN     = 6,
39         ECORE_IOV_VP_UPDATE_SGE_TPA             = 7,
40         ECORE_IOV_VP_UPDATE_MAX                 = 8,
41 };
42
43 /* PF to VF STATUS is part of vfpf-channel API
44  * and must be forward compatible
45 */
46 enum ecore_iov_pf_to_vf_status {
47         PFVF_STATUS_WAITING = 0,
48         PFVF_STATUS_SUCCESS,
49         PFVF_STATUS_FAILURE,
50         PFVF_STATUS_NOT_SUPPORTED,
51         PFVF_STATUS_NO_RESOURCE,
52         PFVF_STATUS_FORCED,
53         PFVF_STATUS_MALICIOUS,
54 };
55
56 struct ecore_mcp_link_params;
57 struct ecore_mcp_link_state;
58 struct ecore_mcp_link_capabilities;
59
60 /* These defines are used by the hw-channel; should never change order */
61 #define VFPF_ACQUIRE_OS_LINUX (0)
62 #define VFPF_ACQUIRE_OS_WINDOWS (1)
63 #define VFPF_ACQUIRE_OS_ESX (2)
64 #define VFPF_ACQUIRE_OS_SOLARIS (3)
65 #define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
66
67 struct ecore_vf_acquire_sw_info {
68         u32 driver_version;
69         u8 os_type;
70
71         /* We have several close releases that all use ~same FW with different
72          * versions [making it incompatible as the versioning scheme is still
73          * tied directly to FW version], allow to override the checking. Only
74          * those versions would actually support this feature [so it would not
75          * break forward compatibility with newer HV drivers that are no longer
76          * suited].
77          */
78         bool override_fw_version;
79 };
80
81 struct ecore_public_vf_info {
82         /* These copies will later be reflected in the bulletin board,
83          * but this copy should be newer.
84          */
85         u8 forced_mac[ETH_ALEN];
86         u16 forced_vlan;
87 };
88
89 struct ecore_iov_vf_init_params {
90         u16 rel_vf_id;
91
92         /* Number of requested Queues; Currently, don't support different
93          * number of Rx/Tx queues.
94          */
95         /* TODO - remove this limitation */
96         u16 num_queues;
97
98         /* Allow the client to choose which qzones to use for Rx/Tx,
99          * and which queue_base to use for Tx queues on a per-queue basis.
100          * Notice values should be relative to the PF resources.
101          */
102         u16 req_rx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
103         u16 req_tx_queue[ECORE_MAX_VF_CHAINS_PER_PF];
104
105         u8 vport_id;
106
107         /* Should be set in case RSS is going to be used for VF */
108         u8 rss_eng_id;
109 };
110
111 #ifdef CONFIG_ECORE_SW_CHANNEL
112 /* This is SW channel related only... */
113 enum mbx_state {
114         VF_PF_UNKNOWN_STATE                     = 0,
115         VF_PF_WAIT_FOR_START_REQUEST            = 1,
116         VF_PF_WAIT_FOR_NEXT_CHUNK_OF_REQUEST    = 2,
117         VF_PF_REQUEST_IN_PROCESSING             = 3,
118         VF_PF_RESPONSE_READY                    = 4,
119 };
120
121 struct ecore_iov_sw_mbx {
122         enum mbx_state          mbx_state;
123
124         u32                     request_size;
125         u32                     request_offset;
126
127         u32                     response_size;
128         u32                     response_offset;
129 };
130
131 /**
132  * @brief Get the vf sw mailbox params
133  *
134  * @param p_hwfn
135  * @param rel_vf_id
136  *
137  * @return struct ecore_iov_sw_mbx*
138  */
139 struct ecore_iov_sw_mbx*
140 ecore_iov_get_vf_sw_mbx(struct ecore_hwfn *p_hwfn,
141                         u16 rel_vf_id);
142 #endif
143
144 /* This struct is part of ecore_dev and contains data relevant to all hwfns;
145  * Initialized only if SR-IOV cpabability is exposed in PCIe config space.
146  */
147 struct ecore_hw_sriov_info {
148         /* standard SRIOV capability fields, mostly for debugging */
149         int     pos;            /* capability position */
150         int     nres;           /* number of resources */
151         u32     cap;            /* SR-IOV Capabilities */
152         u16     ctrl;           /* SR-IOV Control */
153         u16     total_vfs;      /* total VFs associated with the PF */
154         u16     num_vfs;        /* number of vfs that have been started */
155         u16     initial_vfs;    /* initial VFs associated with the PF */
156         u16     nr_virtfn;      /* number of VFs available */
157         u16     offset;         /* first VF Routing ID offset */
158         u16     stride;         /* following VF stride */
159         u16     vf_device_id;   /* VF device id */
160         u32     pgsz;           /* page size for BAR alignment */
161         u8      link;           /* Function Dependency Link */
162
163         u32     first_vf_in_pf;
164 };
165
166 #ifdef CONFIG_ECORE_SRIOV
167 #ifndef LINUX_REMOVE
168 /**
169  * @brief mark/clear all VFs before/after an incoming PCIe sriov
170  *        disable.
171  *
172  * @param p_dev
173  * @param to_disable
174  */
175 void ecore_iov_set_vfs_to_disable(struct ecore_dev *p_dev,
176                                   u8 to_disable);
177
178 /**
179  * @brief mark/clear chosen VF before/after an incoming PCIe
180  *        sriov disable.
181  *
182  * @param p_dev
183  * @param rel_vf_id
184  * @param to_disable
185  */
186 void ecore_iov_set_vf_to_disable(struct ecore_dev *p_dev,
187                                  u16 rel_vf_id,
188                                  u8 to_disable);
189
190 /**
191  * @brief ecore_iov_init_hw_for_vf - initialize the HW for
192  *        enabling access of a VF. Also includes preparing the
193  *        IGU for VF access. This needs to be called AFTER hw is
194  *        initialized and BEFORE VF is loaded inside the VM.
195  *
196  * @param p_hwfn
197  * @param p_ptt
198  * @param p_params
199  *
200  * @return enum _ecore_status_t
201  */
202 enum _ecore_status_t ecore_iov_init_hw_for_vf(struct ecore_hwfn *p_hwfn,
203                                               struct ecore_ptt *p_ptt,
204                                               struct ecore_iov_vf_init_params
205                                                      *p_params);
206
207 /**
208  * @brief ecore_iov_process_mbx_req - process a request received
209  *        from the VF
210  *
211  * @param p_hwfn
212  * @param p_ptt
213  * @param vfid
214  */
215 void ecore_iov_process_mbx_req(struct ecore_hwfn *p_hwfn,
216                                struct ecore_ptt *p_ptt,
217                                int vfid);
218
219 /**
220  * @brief ecore_iov_release_hw_for_vf - called once upper layer
221  *        knows VF is done with - can release any resources
222  *        allocated for VF at this point. this must be done once
223  *        we know VF is no longer loaded in VM.
224  *
225  * @param p_hwfn
226  * @param p_ptt
227  * @param rel_vf_id
228  *
229  * @return enum _ecore_status_t
230  */
231 enum _ecore_status_t ecore_iov_release_hw_for_vf(struct ecore_hwfn *p_hwfn,
232                                                  struct ecore_ptt *p_ptt,
233                                                  u16 rel_vf_id);
234
235 /**
236  * @brief ecore_iov_set_vf_ctx - set a context for a given VF
237  *
238  * @param p_hwfn
239  * @param vf_id
240  * @param ctx
241  *
242  * @return enum _ecore_status_t
243  */
244 enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn *p_hwfn,
245                                           u16 vf_id,
246                                           void *ctx);
247
248 /**
249  * @brief FLR cleanup for all VFs
250  *
251  * @param p_hwfn
252  * @param p_ptt
253  *
254  * @return enum _ecore_status_t
255  */
256 enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
257                                               struct ecore_ptt *p_ptt);
258
259 /**
260  * @brief FLR cleanup for single VF
261  *
262  * @param p_hwfn
263  * @param p_ptt
264  * @param rel_vf_id
265  *
266  * @return enum _ecore_status_t
267  */
268 enum _ecore_status_t
269 ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
270                                 struct ecore_ptt *p_ptt,
271                                 u16 rel_vf_id);
272
273 /**
274  * @brief Update the bulletin with link information. Notice this does NOT
275  *        send a bulletin update, only updates the PF's bulletin.
276  *
277  * @param p_hwfn
278  * @param p_vf
279  * @param params - the link params to use for the VF link configuration
280  * @param link - the link output to use for the VF link configuration
281  * @param p_caps - the link default capabilities.
282  */
283 void ecore_iov_set_link(struct ecore_hwfn *p_hwfn,
284                         u16 vfid,
285                         struct ecore_mcp_link_params *params,
286                         struct ecore_mcp_link_state *link,
287                         struct ecore_mcp_link_capabilities *p_caps);
288
289 /**
290  * @brief Returns link information as perceived by VF.
291  *
292  * @param p_hwfn
293  * @param p_vf
294  * @param p_params - the link params visible to vf.
295  * @param p_link - the link state visible to vf.
296  * @param p_caps - the link default capabilities visible to vf.
297  */
298 void ecore_iov_get_link(struct ecore_hwfn *p_hwfn,
299                         u16 vfid,
300                         struct ecore_mcp_link_params *params,
301                         struct ecore_mcp_link_state *link,
302                         struct ecore_mcp_link_capabilities *p_caps);
303
304 /**
305  * @brief return if the VF is pending FLR
306  *
307  * @param p_hwfn
308  * @param rel_vf_id
309  *
310  * @return bool
311  */
312 bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,
313                                  u16 rel_vf_id);
314
315 /**
316  * @brief Check if given VF ID @vfid is valid
317  *        w.r.t. @b_enabled_only value
318  *        if b_enabled_only = true - only enabled VF id is valid
319  *        else any VF id less than max_vfs is valid
320  *
321  * @param p_hwfn
322  * @param rel_vf_id - Relative VF ID
323  * @param b_enabled_only - consider only enabled VF
324  * @param b_non_malicious - true iff we want to validate vf isn't malicious.
325  *
326  * @return bool - true for valid VF ID
327  */
328 bool ecore_iov_is_valid_vfid(struct ecore_hwfn *p_hwfn,
329                              int rel_vf_id,
330                              bool b_enabled_only, bool b_non_malicious);
331
332 /**
333  * @brief Get VF's public info structure
334  *
335  * @param p_hwfn
336  * @param vfid - Relative VF ID
337  * @param b_enabled_only - false if want to access even if vf is disabled
338  *
339  * @return struct ecore_public_vf_info *
340  */
341 struct ecore_public_vf_info*
342 ecore_iov_get_public_vf_info(struct ecore_hwfn *p_hwfn,
343                              u16 vfid, bool b_enabled_only);
344
345 /**
346  * @brief fills a bitmask of all VFs which have pending unhandled
347  *        messages.
348  *
349  * @param p_hwfn
350  */
351 void ecore_iov_pf_get_pending_events(struct ecore_hwfn *p_hwfn,
352                                      u64 *events);
353
354 /**
355  * @brief Copy VF's message to PF's buffer
356  *
357  * @param p_hwfn
358  * @param ptt
359  * @param vfid
360  *
361  * @return enum _ecore_status_t
362  */
363 enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn *p_hwfn,
364                                            struct ecore_ptt *ptt,
365                                            int vfid);
366 /**
367  * @brief Set forced MAC address in PFs copy of bulletin board
368  *        and configures FW/HW to support the configuration.
369  *
370  * @param p_hwfn
371  * @param mac
372  * @param vfid
373  */
374 void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn *p_hwfn,
375                                        u8 *mac, int vfid);
376
377 /**
378  * @brief Set MAC address in PFs copy of bulletin board without
379  *        configuring FW/HW.
380  *
381  * @param p_hwfn
382  * @param mac
383  * @param vfid
384  */
385 enum _ecore_status_t ecore_iov_bulletin_set_mac(struct ecore_hwfn *p_hwfn,
386                                                 u8 *mac, int vfid);
387
388 /**
389  * @brief Set default behaviour of VF in case no vlans are configured for it
390  *        whether to accept only untagged traffic or all.
391  *        Must be called prior to the VF vport-start.
392  *
393  * @param p_hwfn
394  * @param b_untagged_only
395  * @param vfid
396  *
397  * @return ECORE_SUCCESS if configuration would stick.
398  */
399 enum _ecore_status_t
400 ecore_iov_bulletin_set_forced_untagged_default(struct ecore_hwfn *p_hwfn,
401                                                bool b_untagged_only,
402                                                int vfid);
403
404 /**
405  * @brief Get VFs opaque fid.
406  *
407  * @param p_hwfn
408  * @param vfid
409  * @param opaque_fid
410  */
411 void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn *p_hwfn, int vfid,
412                                   u16 *opaque_fid);
413
414 /**
415  * @brief Set forced VLAN [pvid] in PFs copy of bulletin board
416  *        and configures FW/HW to support the configuration.
417  *        Setting of pvid 0 would clear the feature.
418  * @param p_hwfn
419  * @param pvid
420  * @param vfid
421  */
422 void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn *p_hwfn,
423                                         u16 pvid, int vfid);
424
425 /**
426  * @brief Check if VF has VPORT instance. This can be used
427  *        to check if VPORT is active.
428  *
429  * @param p_hwfn
430  */
431 bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn *p_hwfn, int vfid);
432
433 /**
434  * @brief PF posts the bulletin to the VF
435  *
436  * @param p_hwfn
437  * @param p_vf
438  * @param p_ptt
439  *
440  * @return enum _ecore_status_t
441  */
442 enum _ecore_status_t ecore_iov_post_vf_bulletin(struct ecore_hwfn *p_hwfn,
443                                                 int vfid,
444                                                 struct ecore_ptt *p_ptt);
445
446 /**
447  * @brief Check if given VF (@vfid) is marked as stopped
448  *
449  * @param p_hwfn
450  * @param vfid
451  *
452  * @return bool : true if stopped
453  */
454 bool ecore_iov_is_vf_stopped(struct ecore_hwfn *p_hwfn, int vfid);
455
456 /**
457  * @brief Configure VF anti spoofing
458  *
459  * @param p_hwfn
460  * @param vfid
461  * @param val - spoofchk value - true/false
462  *
463  * @return enum _ecore_status_t
464  */
465 enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn *p_hwfn,
466                                             int vfid, bool val);
467
468 /**
469  * @brief Get VF's configured spoof value.
470  *
471  * @param p_hwfn
472  * @param vfid
473  *
474  * @return bool - spoofchk value - true/false
475  */
476 bool ecore_iov_spoofchk_get(struct ecore_hwfn *p_hwfn, int vfid);
477
478 /**
479  * @brief Check for SRIOV sanity by PF.
480  *
481  * @param p_hwfn
482  * @param vfid
483  *
484  * @return bool - true if sanity checks passes, else false
485  */
486 bool ecore_iov_pf_sanity_check(struct ecore_hwfn *p_hwfn, int vfid);
487
488 /**
489  * @brief Get the num of VF chains.
490  *
491  * @param p_hwfn
492  *
493  * @return u8
494  */
495 u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn *p_hwfn);
496
497 /**
498  * @brief Get vf request mailbox params
499  *
500  * @param p_hwfn
501  * @param rel_vf_id
502  * @param pp_req_virt_addr
503  * @param p_req_virt_size
504  */
505 void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn *p_hwfn,
506                                           u16 rel_vf_id,
507                                           void **pp_req_virt_addr,
508                                           u16 *p_req_virt_size);
509
510 /**
511  * @brief Get vf mailbox params
512  *
513  * @param p_hwfn
514  * @param rel_vf_id
515  * @param pp_reply_virt_addr
516  * @param p_reply_virt_size
517  */
518 void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn *p_hwfn,
519                                             u16 rel_vf_id,
520                                             void **pp_reply_virt_addr,
521                                             u16 *p_reply_virt_size);
522
523 /**
524  * @brief Validate if the given length is a valid vfpf message
525  *        length
526  *
527  * @param length
528  *
529  * @return bool
530  */
531 bool ecore_iov_is_valid_vfpf_msg_length(u32 length);
532
533 /**
534  * @brief Return the max pfvf message length
535  *
536  * @return u32
537  */
538 u32 ecore_iov_pfvf_msg_length(void);
539
540 /**
541  * @brief Returns MAC address if one is configured
542  *
543  * @parm p_hwfn
544  * @parm rel_vf_id
545  *
546  * @return OSAL_NULL if mac isn't set; Otherwise, returns MAC.
547  */
548 u8 *ecore_iov_bulletin_get_mac(struct ecore_hwfn *p_hwfn,
549                                u16 rel_vf_id);
550
551 /**
552  * @brief Returns forced MAC address if one is configured
553  *
554  * @parm p_hwfn
555  * @parm rel_vf_id
556  *
557  * @return OSAL_NULL if mac isn't forced; Otherwise, returns MAC.
558  */
559 u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn *p_hwfn,
560                                       u16 rel_vf_id);
561
562 /**
563  * @brief Returns pvid if one is configured
564  *
565  * @parm p_hwfn
566  * @parm rel_vf_id
567  *
568  * @return 0 if no pvid is configured, otherwise the pvid.
569  */
570 u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn *p_hwfn,
571                                        u16 rel_vf_id);
572 /**
573  * @brief Configure VFs tx rate
574  *
575  * @param p_hwfn
576  * @param p_ptt
577  * @param vfid
578  * @param val - tx rate value in Mb/sec.
579  *
580  * @return enum _ecore_status_t
581  */
582 enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn *p_hwfn,
583                                                  struct ecore_ptt *p_ptt,
584                                                  int vfid, int val);
585
586 /**
587  * @brief - Retrieves the statistics associated with a VF
588  *
589  * @param p_hwfn
590  * @param p_ptt
591  * @param vfid
592  * @param p_stats - this will be filled with the VF statistics
593  *
594  * @return ECORE_SUCCESS iff statistics were retrieved. Error otherwise.
595  */
596 enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn *p_hwfn,
597                                             struct ecore_ptt *p_ptt,
598                                             int vfid,
599                                             struct ecore_eth_stats *p_stats);
600
601 /**
602  * @brief - Retrieves num of rxqs chains
603  *
604  * @param p_hwfn
605  * @param rel_vf_id
606  *
607  * @return num of rxqs chains.
608  */
609 u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn *p_hwfn,
610                              u16 rel_vf_id);
611
612 /**
613  * @brief - Retrieves num of active rxqs chains
614  *
615  * @param p_hwfn
616  * @param rel_vf_id
617  *
618  * @return
619  */
620 u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn *p_hwfn,
621                                     u16 rel_vf_id);
622
623 /**
624  * @brief - Retrieves ctx pointer
625  *
626  * @param p_hwfn
627  * @param rel_vf_id
628  *
629  * @return
630  */
631 void *ecore_iov_get_vf_ctx(struct ecore_hwfn *p_hwfn,
632                            u16 rel_vf_id);
633
634 /**
635  * @brief - Retrieves VF`s num sbs
636  *
637  * @param p_hwfn
638  * @param rel_vf_id
639  *
640  * @return
641  */
642 u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn *p_hwfn,
643                             u16 rel_vf_id);
644
645 /**
646  * @brief - Returm true if VF is waiting for acquire
647  *
648  * @param p_hwfn
649  * @param rel_vf_id
650  *
651  * @return
652  */
653 bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn *p_hwfn,
654                                       u16 rel_vf_id);
655
656 /**
657  * @brief - Returm true if VF is acquired but not initialized
658  *
659  * @param p_hwfn
660  * @param rel_vf_id
661  *
662  * @return
663  */
664 bool ecore_iov_is_vf_acquired_not_initialized(struct ecore_hwfn *p_hwfn,
665                                               u16 rel_vf_id);
666
667 /**
668  * @brief - Returm true if VF is acquired and initialized
669  *
670  * @param p_hwfn
671  * @param rel_vf_id
672  *
673  * @return
674  */
675 bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn,
676                                  u16 rel_vf_id);
677
678 /**
679  * @brief - Returm true if VF has started in FW
680  *
681  * @param p_hwfn
682  * @param rel_vf_id
683  *
684  * @return
685  */
686 bool ecore_iov_is_vf_started(struct ecore_hwfn *p_hwfn,
687                              u16 rel_vf_id);
688
689 /**
690  * @brief - Get VF's vport min rate configured.
691  * @param p_hwfn
692  * @param rel_vf_id
693  *
694  * @return - rate in Mbps
695  */
696 int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid);
697
698 #endif
699
700 /**
701  * @brief ecore_pf_configure_vf_queue_coalesce - PF configure coalesce
702  *    parameters of VFs for Rx and Tx queue.
703  *    While the API allows setting coalescing per-qid, all queues sharing a SB
704  *    should be in same range [i.e., either 0-0x7f, 0x80-0xff or 0x100-0x1ff]
705  *    otherwise configuration would break.
706  *
707  * @param p_hwfn
708  * @param rx_coal - Rx Coalesce value in micro seconds.
709  * @param tx_coal - TX Coalesce value in micro seconds.
710  * @param vf_id
711  * @param qid
712  *
713  * @return int
714  **/
715 enum _ecore_status_t
716 ecore_iov_pf_configure_vf_queue_coalesce(struct ecore_hwfn *p_hwfn,
717                                          u16 rx_coal, u16 tx_coal,
718                                          u16 vf_id, u16 qid);
719
720 /**
721  * @brief - Given a VF index, return index of next [including that] active VF.
722  *
723  * @param p_hwfn
724  * @param rel_vf_id
725  *
726  * @return MAX_NUM_VFS_E4 in case no further active VFs, otherwise index.
727  */
728 u16 ecore_iov_get_next_active_vf(struct ecore_hwfn *p_hwfn, u16 rel_vf_id);
729
730 void ecore_iov_bulletin_set_udp_ports(struct ecore_hwfn *p_hwfn, int vfid,
731                                       u16 vxlan_port, u16 geneve_port);
732
733 #ifdef CONFIG_ECORE_SW_CHANNEL
734 /**
735  * @brief Set whether PF should communicate with VF using SW/HW channel
736  *        Needs to be called for an enabled VF before acquire is over
737  *        [latest good point for doing that is OSAL_IOV_VF_ACQUIRE()]
738  *
739  * @param p_hwfn
740  * @param vfid - relative vf index
741  * @param b_is_hw - true iff PF is to use HW channel for communication
742  */
743 void ecore_iov_set_vf_hw_channel(struct ecore_hwfn *p_hwfn, int vfid,
744                                  bool b_is_hw);
745 #endif
746 #endif /* CONFIG_ECORE_SRIOV */
747
748 #define ecore_for_each_vf(_p_hwfn, _i)                                  \
749         for (_i = ecore_iov_get_next_active_vf(_p_hwfn, 0);             \
750              _i < MAX_NUM_VFS_E4;                                       \
751              _i = ecore_iov_get_next_active_vf(_p_hwfn, _i + 1))
752
753 #endif