blob: 4f05d5eb3cf50ae51298a1711f2a850bcac1fe93 [file] [log] [blame]
Yuval Mintz32a47e72016-05-11 16:36:12 +03001/* QLogic qed NIC Driver
Mintz, Yuvale8f1cb52017-01-01 13:57:00 +02002 * Copyright (c) 2015-2017 QLogic Corporation
Yuval Mintz32a47e72016-05-11 16:36:12 +03003 *
Mintz, Yuvale8f1cb52017-01-01 13:57:00 +02004 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and /or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
Yuval Mintz32a47e72016-05-11 16:36:12 +030031 */
32
33#ifndef _QED_VF_H
34#define _QED_VF_H
35
Yuval Mintzdacd88d2016-05-11 16:36:16 +030036#include "qed_l2.h"
Yuval Mintz36558c32016-05-11 16:36:17 +030037#include "qed_mcp.h"
Yuval Mintzdacd88d2016-05-11 16:36:16 +030038
39#define T_ETH_INDIRECTION_TABLE_SIZE 128
40#define T_ETH_RSS_KEY_SIZE 10
41
Yuval Mintz1408cc1f2016-05-11 16:36:14 +030042struct vf_pf_resc_request {
43 u8 num_rxqs;
44 u8 num_txqs;
45 u8 num_sbs;
46 u8 num_mac_filters;
47 u8 num_vlan_filters;
48 u8 num_mc_filters;
Mintz, Yuval08bc8f12017-06-04 13:31:06 +030049 u8 num_cids;
50 u8 padding;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +030051};
52
53struct hw_sb_info {
54 u16 hw_sb_id;
55 u8 sb_qid;
56 u8 padding[5];
57};
58
Yuval Mintzdacd88d2016-05-11 16:36:16 +030059#define TLV_BUFFER_SIZE 1024
60
Yuval Mintz37bff2b2016-05-11 16:36:13 +030061enum {
62 PFVF_STATUS_WAITING,
63 PFVF_STATUS_SUCCESS,
64 PFVF_STATUS_FAILURE,
65 PFVF_STATUS_NOT_SUPPORTED,
66 PFVF_STATUS_NO_RESOURCE,
67 PFVF_STATUS_FORCED,
Yuval Mintz7eff82b2016-10-14 05:19:22 -040068 PFVF_STATUS_MALICIOUS,
Yuval Mintz37bff2b2016-05-11 16:36:13 +030069};
70
71/* vf pf channel tlvs */
72/* general tlv header (used for both vf->pf request and pf->vf response) */
73struct channel_tlv {
74 u16 type;
75 u16 length;
76};
77
78/* header of first vf->pf tlv carries the offset used to calculate reponse
79 * buffer address
80 */
81struct vfpf_first_tlv {
82 struct channel_tlv tl;
83 u32 padding;
84 u64 reply_address;
85};
86
87/* header of pf->vf tlvs, carries the status of handling the request */
88struct pfvf_tlv {
89 struct channel_tlv tl;
90 u8 status;
91 u8 padding[3];
92};
93
94/* response tlv used for most tlvs */
95struct pfvf_def_resp_tlv {
96 struct pfvf_tlv hdr;
97};
98
99/* used to terminate and pad a tlv list */
100struct channel_list_end_tlv {
101 struct channel_tlv tl;
102 u8 padding[4];
103};
104
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300105#define VFPF_ACQUIRE_OS_LINUX (0)
106#define VFPF_ACQUIRE_OS_WINDOWS (1)
107#define VFPF_ACQUIRE_OS_ESX (2)
108#define VFPF_ACQUIRE_OS_SOLARIS (3)
109#define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
110
111struct vfpf_acquire_tlv {
112 struct vfpf_first_tlv first_tlv;
113
114 struct vf_pf_vfdev_info {
Yuval Mintza044df82016-08-22 13:25:09 +0300115#define VFPF_ACQUIRE_CAP_PRE_FP_HSI (1 << 0) /* VF pre-FP hsi version */
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300116#define VFPF_ACQUIRE_CAP_100G (1 << 1) /* VF can support 100g */
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300117 /* A requirement for supporting multi-Tx queues on a single queue-zone,
118 * VF would pass qids as additional information whenever passing queue
119 * references.
120 */
121#define VFPF_ACQUIRE_CAP_QUEUE_QIDS BIT(2)
Mintz, Yuval1a850bf2017-06-04 13:31:07 +0300122
123 /* The VF is using the physical bar. While this is mostly internal
124 * to the VF, might affect the number of CIDs supported assuming
125 * QUEUE_QIDS is set.
126 */
127#define VFPF_ACQUIRE_CAP_PHYSICAL_BAR BIT(3)
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300128 u64 capabilities;
129 u8 fw_major;
130 u8 fw_minor;
131 u8 fw_revision;
132 u8 fw_engineering;
133 u32 driver_version;
134 u16 opaque_fid; /* ME register value */
135 u8 os_type; /* VFPF_ACQUIRE_OS_* value */
Yuval Mintz1fe614d2016-06-05 13:11:11 +0300136 u8 eth_fp_hsi_major;
137 u8 eth_fp_hsi_minor;
138 u8 padding[3];
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300139 } vfdev_info;
140
141 struct vf_pf_resc_request resc_request;
142
143 u64 bulletin_addr;
144 u32 bulletin_size;
145 u32 padding;
146};
147
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300148/* receive side scaling tlv */
149struct vfpf_vport_update_rss_tlv {
150 struct channel_tlv tl;
151
152 u8 update_rss_flags;
153#define VFPF_UPDATE_RSS_CONFIG_FLAG BIT(0)
154#define VFPF_UPDATE_RSS_CAPS_FLAG BIT(1)
155#define VFPF_UPDATE_RSS_IND_TABLE_FLAG BIT(2)
156#define VFPF_UPDATE_RSS_KEY_FLAG BIT(3)
157
158 u8 rss_enable;
159 u8 rss_caps;
160 u8 rss_table_size_log; /* The table size is 2 ^ rss_table_size_log */
161 u16 rss_ind_table[T_ETH_INDIRECTION_TABLE_SIZE];
162 u32 rss_key[T_ETH_RSS_KEY_SIZE];
163};
164
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300165struct pfvf_storm_stats {
166 u32 address;
167 u32 len;
168};
169
170struct pfvf_stats_info {
171 struct pfvf_storm_stats mstats;
172 struct pfvf_storm_stats pstats;
173 struct pfvf_storm_stats tstats;
174 struct pfvf_storm_stats ustats;
175};
176
177struct pfvf_acquire_resp_tlv {
178 struct pfvf_tlv hdr;
179
180 struct pf_vf_pfdev_info {
181 u32 chip_num;
182 u32 mfw_ver;
183
184 u16 fw_major;
185 u16 fw_minor;
186 u16 fw_rev;
187 u16 fw_eng;
188
189 u64 capabilities;
190#define PFVF_ACQUIRE_CAP_DEFAULT_UNTAGGED BIT(0)
191#define PFVF_ACQUIRE_CAP_100G BIT(1) /* If set, 100g PF */
192/* There are old PF versions where the PF might mistakenly override the sanity
193 * mechanism [version-based] and allow a VF that can't be supported to pass
194 * the acquisition phase.
195 * To overcome this, PFs now indicate that they're past that point and the new
196 * VFs would fail probe on the older PFs that fail to do so.
197 */
198#define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE BIT(2)
199
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300200 /* PF expects queues to be received with additional qids */
201#define PFVF_ACQUIRE_CAP_QUEUE_QIDS BIT(3)
202
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300203 u16 db_size;
204 u8 indices_per_sb;
205 u8 os_type;
206
207 /* These should match the PF's qed_dev values */
208 u16 chip_rev;
209 u8 dev_type;
210
Mintz, Yuval1a850bf2017-06-04 13:31:07 +0300211 /* Doorbell bar size configured in HW: log(size) or 0 */
212 u8 bar_size;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300213
214 struct pfvf_stats_info stats_info;
215
216 u8 port_mac[ETH_ALEN];
Yuval Mintz1fe614d2016-06-05 13:11:11 +0300217
218 /* It's possible PF had to configure an older fastpath HSI
219 * [in case VF is newer than PF]. This is communicated back
220 * to the VF. It can also be used in case of error due to
221 * non-matching versions to shed light in VF about failure.
222 */
223 u8 major_fp_hsi;
224 u8 minor_fp_hsi;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300225 } pfdev_info;
226
227 struct pf_vf_resc {
228#define PFVF_MAX_QUEUES_PER_VF 16
229#define PFVF_MAX_SBS_PER_VF 16
230 struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF];
231 u8 hw_qid[PFVF_MAX_QUEUES_PER_VF];
232 u8 cid[PFVF_MAX_QUEUES_PER_VF];
233
234 u8 num_rxqs;
235 u8 num_txqs;
236 u8 num_sbs;
237 u8 num_mac_filters;
238 u8 num_vlan_filters;
239 u8 num_mc_filters;
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300240 u8 num_cids;
241 u8 padding;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300242 } resc;
243
244 u32 bulletin_size;
245 u32 padding;
246};
247
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300248struct pfvf_start_queue_resp_tlv {
249 struct pfvf_tlv hdr;
250 u32 offset; /* offset to consumer/producer of queue */
251 u8 padding[4];
252};
253
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300254/* Extended queue information - additional index for reference inside qzone.
255 * If commmunicated between VF/PF, each TLV relating to queues should be
256 * extended by one such [or have a future base TLV that already contains info].
257 */
258struct vfpf_qid_tlv {
259 struct channel_tlv tl;
260 u8 qid;
261 u8 padding[3];
262};
263
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300264/* Setup Queue */
265struct vfpf_start_rxq_tlv {
266 struct vfpf_first_tlv first_tlv;
267
268 /* physical addresses */
269 u64 rxq_addr;
270 u64 deprecated_sge_addr;
271 u64 cqe_pbl_addr;
272
273 u16 cqe_pbl_size;
274 u16 hw_sb;
275 u16 rx_qid;
276 u16 hc_rate; /* desired interrupts per sec. */
277
278 u16 bd_max_bytes;
279 u16 stat_id;
280 u8 sb_index;
281 u8 padding[3];
282};
283
284struct vfpf_start_txq_tlv {
285 struct vfpf_first_tlv first_tlv;
286
287 /* physical addresses */
288 u64 pbl_addr;
289 u16 pbl_size;
290 u16 stat_id;
291 u16 tx_qid;
292 u16 hw_sb;
293
294 u32 flags; /* VFPF_QUEUE_FLG_X flags */
295 u16 hc_rate; /* desired interrupts per sec. */
296 u8 sb_index;
297 u8 padding[3];
298};
299
300/* Stop RX Queue */
301struct vfpf_stop_rxqs_tlv {
302 struct vfpf_first_tlv first_tlv;
303
304 u16 rx_qid;
Mintz, Yuval4c4fa792017-03-19 13:08:17 +0200305
306 /* this field is deprecated and should *always* be set to '1' */
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300307 u8 num_rxqs;
308 u8 cqe_completion;
309 u8 padding[4];
310};
311
312/* Stop TX Queues */
313struct vfpf_stop_txqs_tlv {
314 struct vfpf_first_tlv first_tlv;
315
316 u16 tx_qid;
Mintz, Yuval4c4fa792017-03-19 13:08:17 +0200317
318 /* this field is deprecated and should *always* be set to '1' */
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300319 u8 num_txqs;
320 u8 padding[5];
321};
322
323struct vfpf_update_rxq_tlv {
324 struct vfpf_first_tlv first_tlv;
325
326 u64 deprecated_sge_addr[PFVF_MAX_QUEUES_PER_VF];
327
328 u16 rx_qid;
329 u8 num_rxqs;
330 u8 flags;
331#define VFPF_RXQ_UPD_INIT_SGE_DEPRECATE_FLAG BIT(0)
332#define VFPF_RXQ_UPD_COMPLETE_CQE_FLAG BIT(1)
333#define VFPF_RXQ_UPD_COMPLETE_EVENT_FLAG BIT(2)
334
335 u8 padding[4];
336};
337
338/* Set Queue Filters */
339struct vfpf_q_mac_vlan_filter {
340 u32 flags;
341#define VFPF_Q_FILTER_DEST_MAC_VALID 0x01
342#define VFPF_Q_FILTER_VLAN_TAG_VALID 0x02
343#define VFPF_Q_FILTER_SET_MAC 0x100 /* set/clear */
344
345 u8 mac[ETH_ALEN];
346 u16 vlan_tag;
347
348 u8 padding[4];
349};
350
351/* Start a vport */
352struct vfpf_vport_start_tlv {
353 struct vfpf_first_tlv first_tlv;
354
355 u64 sb_addr[PFVF_MAX_SBS_PER_VF];
356
357 u32 tpa_mode;
358 u16 dep1;
359 u16 mtu;
360
361 u8 vport_id;
362 u8 inner_vlan_removal;
363
364 u8 only_untagged;
365 u8 max_buffers_per_cqe;
366
367 u8 padding[4];
368};
369
370/* Extended tlvs - need to add rss, mcast, accept mode tlvs */
371struct vfpf_vport_update_activate_tlv {
372 struct channel_tlv tl;
373 u8 update_rx;
374 u8 update_tx;
375 u8 active_rx;
376 u8 active_tx;
377};
378
Yuval Mintz17b235c2016-05-11 16:36:18 +0300379struct vfpf_vport_update_tx_switch_tlv {
380 struct channel_tlv tl;
381 u8 tx_switching;
382 u8 padding[3];
383};
384
385struct vfpf_vport_update_vlan_strip_tlv {
386 struct channel_tlv tl;
387 u8 remove_vlan;
388 u8 padding[3];
389};
390
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300391struct vfpf_vport_update_mcast_bin_tlv {
392 struct channel_tlv tl;
393 u8 padding[4];
394
395 u64 bins[8];
396};
397
398struct vfpf_vport_update_accept_param_tlv {
399 struct channel_tlv tl;
400 u8 update_rx_mode;
401 u8 update_tx_mode;
402 u8 rx_accept_filter;
403 u8 tx_accept_filter;
404};
405
Yuval Mintz17b235c2016-05-11 16:36:18 +0300406struct vfpf_vport_update_accept_any_vlan_tlv {
407 struct channel_tlv tl;
408 u8 update_accept_any_vlan_flg;
409 u8 accept_any_vlan;
410
411 u8 padding[2];
412};
413
414struct vfpf_vport_update_sge_tpa_tlv {
415 struct channel_tlv tl;
416
417 u16 sge_tpa_flags;
418#define VFPF_TPA_IPV4_EN_FLAG BIT(0)
419#define VFPF_TPA_IPV6_EN_FLAG BIT(1)
420#define VFPF_TPA_PKT_SPLIT_FLAG BIT(2)
421#define VFPF_TPA_HDR_DATA_SPLIT_FLAG BIT(3)
422#define VFPF_TPA_GRO_CONSIST_FLAG BIT(4)
423
424 u8 update_sge_tpa_flags;
425#define VFPF_UPDATE_SGE_DEPRECATED_FLAG BIT(0)
426#define VFPF_UPDATE_TPA_EN_FLAG BIT(1)
427#define VFPF_UPDATE_TPA_PARAM_FLAG BIT(2)
428
429 u8 max_buffers_per_cqe;
430
431 u16 deprecated_sge_buff_size;
432 u16 tpa_max_size;
433 u16 tpa_min_size_to_start;
434 u16 tpa_min_size_to_cont;
435
436 u8 tpa_max_aggs_num;
437 u8 padding[7];
438};
439
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300440/* Primary tlv as a header for various extended tlvs for
441 * various functionalities in vport update ramrod.
442 */
443struct vfpf_vport_update_tlv {
444 struct vfpf_first_tlv first_tlv;
445};
446
447struct vfpf_ucast_filter_tlv {
448 struct vfpf_first_tlv first_tlv;
449
450 u8 opcode;
451 u8 type;
452
453 u8 mac[ETH_ALEN];
454
455 u16 vlan;
456 u16 padding[3];
457};
458
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -0700459/* tunnel update param tlv */
460struct vfpf_update_tunn_param_tlv {
461 struct vfpf_first_tlv first_tlv;
462
463 u8 tun_mode_update_mask;
464 u8 tunn_mode;
465 u8 update_tun_cls;
466 u8 vxlan_clss;
467 u8 l2gre_clss;
468 u8 ipgre_clss;
469 u8 l2geneve_clss;
470 u8 ipgeneve_clss;
471 u8 update_geneve_port;
472 u8 update_vxlan_port;
473 u16 geneve_port;
474 u16 vxlan_port;
475 u8 padding[2];
476};
477
478struct pfvf_update_tunn_param_tlv {
479 struct pfvf_tlv hdr;
480
481 u16 tunn_feature_mask;
482 u8 vxlan_mode;
483 u8 l2geneve_mode;
484 u8 ipgeneve_mode;
485 u8 l2gre_mode;
486 u8 ipgre_mode;
487 u8 vxlan_clss;
488 u8 l2gre_clss;
489 u8 ipgre_clss;
490 u8 l2geneve_clss;
491 u8 ipgeneve_clss;
492 u16 vxlan_udp_port;
493 u16 geneve_udp_port;
494};
495
Yuval Mintz32a47e72016-05-11 16:36:12 +0300496struct tlv_buffer_size {
497 u8 tlv_buffer[TLV_BUFFER_SIZE];
498};
499
Rahul Verma477f2d12017-07-26 06:07:13 -0700500struct vfpf_update_coalesce {
501 struct vfpf_first_tlv first_tlv;
502 u16 rx_coal;
503 u16 tx_coal;
504 u16 qid;
505 u8 padding[2];
506};
Rahul Vermabf5a94b2017-07-26 06:07:14 -0700507
508struct vfpf_read_coal_req_tlv {
509 struct vfpf_first_tlv first_tlv;
510 u16 qid;
511 u8 is_rx;
512 u8 padding[5];
513};
514
515struct pfvf_read_coal_resp_tlv {
516 struct pfvf_tlv hdr;
517 u16 coal;
518 u8 padding[6];
519};
520
Shahed Shaikh809c45a2018-04-19 05:50:12 -0700521struct vfpf_bulletin_update_mac_tlv {
522 struct vfpf_first_tlv first_tlv;
523 u8 mac[ETH_ALEN];
524 u8 padding[2];
525};
526
Yuval Mintz32a47e72016-05-11 16:36:12 +0300527union vfpf_tlvs {
Yuval Mintz37bff2b2016-05-11 16:36:13 +0300528 struct vfpf_first_tlv first_tlv;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300529 struct vfpf_acquire_tlv acquire;
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300530 struct vfpf_start_rxq_tlv start_rxq;
531 struct vfpf_start_txq_tlv start_txq;
532 struct vfpf_stop_rxqs_tlv stop_rxqs;
533 struct vfpf_stop_txqs_tlv stop_txqs;
Yuval Mintz17b235c2016-05-11 16:36:18 +0300534 struct vfpf_update_rxq_tlv update_rxq;
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300535 struct vfpf_vport_start_tlv start_vport;
536 struct vfpf_vport_update_tlv vport_update;
537 struct vfpf_ucast_filter_tlv ucast_filter;
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -0700538 struct vfpf_update_tunn_param_tlv tunn_param_update;
Rahul Verma477f2d12017-07-26 06:07:13 -0700539 struct vfpf_update_coalesce update_coalesce;
Rahul Vermabf5a94b2017-07-26 06:07:14 -0700540 struct vfpf_read_coal_req_tlv read_coal_req;
Shahed Shaikh809c45a2018-04-19 05:50:12 -0700541 struct vfpf_bulletin_update_mac_tlv bulletin_update_mac;
Yuval Mintz32a47e72016-05-11 16:36:12 +0300542 struct tlv_buffer_size tlv_buf_size;
543};
544
545union pfvf_tlvs {
Yuval Mintz37bff2b2016-05-11 16:36:13 +0300546 struct pfvf_def_resp_tlv default_resp;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300547 struct pfvf_acquire_resp_tlv acquire_resp;
Yuval Mintz32a47e72016-05-11 16:36:12 +0300548 struct tlv_buffer_size tlv_buf_size;
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300549 struct pfvf_start_queue_resp_tlv queue_start;
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -0700550 struct pfvf_update_tunn_param_tlv tunn_param_resp;
Rahul Vermabf5a94b2017-07-26 06:07:14 -0700551 struct pfvf_read_coal_resp_tlv read_coal_resp;
Yuval Mintz32a47e72016-05-11 16:36:12 +0300552};
553
Yuval Mintz08feecd2016-05-11 16:36:20 +0300554enum qed_bulletin_bit {
Yuval Mintzeff16962016-05-11 16:36:21 +0300555 /* Alert the VF that a forced MAC was set by the PF */
556 MAC_ADDR_FORCED = 0,
Yuval Mintz08feecd2016-05-11 16:36:20 +0300557 /* Alert the VF that a forced VLAN was set by the PF */
558 VLAN_ADDR_FORCED = 2,
559
560 /* Indicate that `default_only_untagged' contains actual data */
561 VFPF_BULLETIN_UNTAGGED_DEFAULT = 3,
562 VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED = 4,
563
Yuval Mintzeff16962016-05-11 16:36:21 +0300564 /* Alert the VF that suggested mac was sent by the PF.
565 * MAC_ADDR will be disabled in case MAC_ADDR_FORCED is set.
566 */
567 VFPF_BULLETIN_MAC_ADDR = 5
Yuval Mintz08feecd2016-05-11 16:36:20 +0300568};
569
Yuval Mintz32a47e72016-05-11 16:36:12 +0300570struct qed_bulletin_content {
571 /* crc of structure to ensure is not in mid-update */
572 u32 crc;
573
574 u32 version;
575
576 /* bitmap indicating which fields hold valid values */
577 u64 valid_bitmap;
Yuval Mintz36558c32016-05-11 16:36:17 +0300578
579 /* used for MAC_ADDR or MAC_ADDR_FORCED */
580 u8 mac[ETH_ALEN];
581
582 /* If valid, 1 => only untagged Rx if no vlan is configured */
583 u8 default_only_untagged;
584 u8 padding;
585
586 /* The following is a 'copy' of qed_mcp_link_state,
587 * qed_mcp_link_params and qed_mcp_link_capabilities. Since it's
588 * possible the structs will increase further along the road we cannot
589 * have it here; Instead we need to have all of its fields.
590 */
591 u8 req_autoneg;
592 u8 req_autoneg_pause;
593 u8 req_forced_rx;
594 u8 req_forced_tx;
595 u8 padding2[4];
596
597 u32 req_adv_speed;
598 u32 req_forced_speed;
599 u32 req_loopback;
600 u32 padding3;
601
602 u8 link_up;
603 u8 full_duplex;
604 u8 autoneg;
605 u8 autoneg_complete;
606 u8 parallel_detection;
607 u8 pfc_enabled;
608 u8 partner_tx_flow_ctrl_en;
609 u8 partner_rx_flow_ctrl_en;
610 u8 partner_adv_pause;
611 u8 sfp_tx_fault;
Chopra, Manish97379f12017-04-24 10:00:48 -0700612 u16 vxlan_udp_port;
613 u16 geneve_udp_port;
614 u8 padding4[2];
Yuval Mintz36558c32016-05-11 16:36:17 +0300615
616 u32 speed;
617 u32 partner_adv_speed;
618
619 u32 capability_speed;
Yuval Mintz08feecd2016-05-11 16:36:20 +0300620
621 /* Forced vlan */
622 u16 pvid;
623 u16 padding5;
Yuval Mintz32a47e72016-05-11 16:36:12 +0300624};
625
626struct qed_bulletin {
627 dma_addr_t phys;
628 struct qed_bulletin_content *p_virt;
629 u32 size;
630};
631
Yuval Mintz37bff2b2016-05-11 16:36:13 +0300632enum {
633 CHANNEL_TLV_NONE, /* ends tlv sequence */
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300634 CHANNEL_TLV_ACQUIRE,
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300635 CHANNEL_TLV_VPORT_START,
636 CHANNEL_TLV_VPORT_UPDATE,
637 CHANNEL_TLV_VPORT_TEARDOWN,
638 CHANNEL_TLV_START_RXQ,
639 CHANNEL_TLV_START_TXQ,
640 CHANNEL_TLV_STOP_RXQS,
641 CHANNEL_TLV_STOP_TXQS,
Yuval Mintz17b235c2016-05-11 16:36:18 +0300642 CHANNEL_TLV_UPDATE_RXQ,
Yuval Mintz0b55e272016-05-11 16:36:15 +0300643 CHANNEL_TLV_INT_CLEANUP,
644 CHANNEL_TLV_CLOSE,
645 CHANNEL_TLV_RELEASE,
Yuval Mintz37bff2b2016-05-11 16:36:13 +0300646 CHANNEL_TLV_LIST_END,
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300647 CHANNEL_TLV_UCAST_FILTER,
648 CHANNEL_TLV_VPORT_UPDATE_ACTIVATE,
Yuval Mintz17b235c2016-05-11 16:36:18 +0300649 CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH,
650 CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP,
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300651 CHANNEL_TLV_VPORT_UPDATE_MCAST,
652 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM,
653 CHANNEL_TLV_VPORT_UPDATE_RSS,
Yuval Mintz17b235c2016-05-11 16:36:18 +0300654 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN,
655 CHANNEL_TLV_VPORT_UPDATE_SGE_TPA,
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -0700656 CHANNEL_TLV_UPDATE_TUNN_PARAM,
Rahul Verma477f2d12017-07-26 06:07:13 -0700657 CHANNEL_TLV_COALESCE_UPDATE,
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300658 CHANNEL_TLV_QID,
Rahul Vermabf5a94b2017-07-26 06:07:14 -0700659 CHANNEL_TLV_COALESCE_READ,
Shahed Shaikh809c45a2018-04-19 05:50:12 -0700660 CHANNEL_TLV_BULLETIN_UPDATE_MAC,
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300661 CHANNEL_TLV_MAX,
662
663 /* Required for iterating over vport-update tlvs.
664 * Will break in case non-sequential vport-update tlvs.
665 */
Yuval Mintz17b235c2016-05-11 16:36:18 +0300666 CHANNEL_TLV_VPORT_UPDATE_MAX = CHANNEL_TLV_VPORT_UPDATE_SGE_TPA + 1,
Yuval Mintz37bff2b2016-05-11 16:36:13 +0300667};
668
Mintz, Yuval08bc8f12017-06-04 13:31:06 +0300669/* Default number of CIDs [total of both Rx and Tx] to be requested
670 * by default, and maximum possible number.
671 */
672#define QED_ETH_VF_DEFAULT_NUM_CIDS (32)
673#define QED_ETH_VF_MAX_NUM_CIDS (250)
674
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300675/* This data is held in the qed_hwfn structure for VFs only. */
676struct qed_vf_iov {
677 union vfpf_tlvs *vf2pf_request;
678 dma_addr_t vf2pf_request_phys;
679 union pfvf_tlvs *pf2vf_reply;
680 dma_addr_t pf2vf_reply_phys;
681
682 /* Should be taken whenever the mailbox buffers are accessed */
683 struct mutex mutex;
684 u8 *offset;
685
686 /* Bulletin Board */
687 struct qed_bulletin bulletin;
688 struct qed_bulletin_content bulletin_shadow;
689
690 /* we set aside a copy of the acquire response */
691 struct pfvf_acquire_resp_tlv acquire_resp;
Yuval Mintzd8c2c7e2016-08-22 13:25:11 +0300692
693 /* In case PF originates prior to the fp-hsi version comparison,
694 * this has to be propagated as it affects the fastpath.
695 */
696 bool b_pre_fp_hsi;
Mintz, Yuval50a20712017-06-01 15:29:09 +0300697
698 /* Current day VFs are passing the SBs physical address on vport
699 * start, and as they lack an IGU mapping they need to store the
700 * addresses of previously registered SBs.
701 * Even if we were to change configuration flow, due to backward
702 * compatibility [with older PFs] we'd still need to store these.
703 */
704 struct qed_sb_info *sbs_info[PFVF_MAX_SBS_PER_VF];
Mintz, Yuval1a850bf2017-06-04 13:31:07 +0300705
706 /* Determines whether VF utilizes doorbells via limited register
707 * bar or via the doorbell bar.
708 */
709 bool b_doorbell_bar;
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300710};
711
Rahul Verma477f2d12017-07-26 06:07:13 -0700712/**
713 * @brief VF - Set Rx/Tx coalesce per VF's relative queue.
714 * Coalesce value '0' will omit the configuration.
715 *
716 * @param p_hwfn
717 * @param rx_coal - coalesce value in micro second for rx queue
718 * @param tx_coal - coalesce value in micro second for tx queue
719 * @param p_cid - queue cid
720 *
721 **/
722int qed_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn,
723 u16 rx_coal,
724 u16 tx_coal, struct qed_queue_cid *p_cid);
725
Rahul Vermabf5a94b2017-07-26 06:07:14 -0700726/**
727 * @brief VF - Get coalesce per VF's relative queue.
728 *
729 * @param p_hwfn
730 * @param p_coal - coalesce value in micro second for VF queues.
731 * @param p_cid - queue cid
732 *
733 **/
734int qed_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn,
735 u16 *p_coal, struct qed_queue_cid *p_cid);
736
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300737#ifdef CONFIG_QED_SRIOV
738/**
Yuval Mintz36558c32016-05-11 16:36:17 +0300739 * @brief Read the VF bulletin and act on it if needed
740 *
741 * @param p_hwfn
742 * @param p_change - qed fills 1 iff bulletin board has changed, 0 otherwise.
743 *
744 * @return enum _qed_status
745 */
746int qed_vf_read_bulletin(struct qed_hwfn *p_hwfn, u8 *p_change);
747
748/**
749 * @brief Get link paramters for VF from qed
750 *
751 * @param p_hwfn
752 * @param params - the link params structure to be filled for the VF
753 */
754void qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
755 struct qed_mcp_link_params *params);
756
757/**
758 * @brief Get link state for VF from qed
759 *
760 * @param p_hwfn
761 * @param link - the link state structure to be filled for the VF
762 */
763void qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
764 struct qed_mcp_link_state *link);
765
766/**
767 * @brief Get link capabilities for VF from qed
768 *
769 * @param p_hwfn
770 * @param p_link_caps - the link capabilities structure to be filled for the VF
771 */
772void qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
773 struct qed_mcp_link_capabilities *p_link_caps);
774
775/**
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300776 * @brief Get number of Rx queues allocated for VF by qed
777 *
778 * @param p_hwfn
779 * @param num_rxqs - allocated RX queues
780 */
781void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs);
782
783/**
Mintz, Yuval0db711b2017-06-04 13:31:00 +0300784 * @brief Get number of Rx queues allocated for VF by qed
785 *
786 * @param p_hwfn
787 * @param num_txqs - allocated RX queues
788 */
789void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs);
790
791/**
Mintz, Yuvalcbb8a122017-06-04 13:31:08 +0300792 * @brief Get number of available connections [both Rx and Tx] for VF
793 *
794 * @param p_hwfn
795 * @param num_cids - allocated number of connections
796 */
797void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids);
798
799/**
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300800 * @brief Get port mac address for VF
801 *
802 * @param p_hwfn
803 * @param port_mac - destination location for port mac
804 */
805void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac);
806
807/**
808 * @brief Get number of VLAN filters allocated for VF by qed
809 *
810 * @param p_hwfn
811 * @param num_rxqs - allocated VLAN filters
812 */
813void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
814 u8 *num_vlan_filters);
815
816/**
Mintz, Yuvalb0fca312016-10-31 22:26:54 +0200817 * @brief Get number of MAC filters allocated for VF by qed
818 *
819 * @param p_hwfn
820 * @param num_rxqs - allocated MAC filters
821 */
822void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters);
823
824/**
Yuval Mintzeff16962016-05-11 16:36:21 +0300825 * @brief Check if VF can set a MAC address
826 *
827 * @param p_hwfn
828 * @param mac
829 *
830 * @return bool
831 */
832bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac);
833
834/**
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300835 * @brief Set firmware version information in dev_info from VFs acquire response tlv
836 *
837 * @param p_hwfn
838 * @param fw_major
839 * @param fw_minor
840 * @param fw_rev
841 * @param fw_eng
842 */
843void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
844 u16 *fw_major, u16 *fw_minor,
845 u16 *fw_rev, u16 *fw_eng);
846
847/**
848 * @brief hw preparation for VF
849 * sends ACQUIRE message
850 *
851 * @param p_hwfn
852 *
853 * @return int
854 */
855int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn);
856
857/**
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300858 * @brief VF - start the RX Queue by sending a message to the PF
859 * @param p_hwfn
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200860 * @param p_cid - Only relative fields are relevant
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300861 * @param bd_max_bytes - maximum number of bytes per bd
862 * @param bd_chain_phys_addr - physical address of bd chain
863 * @param cqe_pbl_addr - physical address of pbl
864 * @param cqe_pbl_size - pbl size
865 * @param pp_prod - pointer to the producer to be
866 * used in fastpath
867 *
868 * @return int
869 */
870int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200871 struct qed_queue_cid *p_cid,
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300872 u16 bd_max_bytes,
873 dma_addr_t bd_chain_phys_addr,
874 dma_addr_t cqe_pbl_addr,
875 u16 cqe_pbl_size, void __iomem **pp_prod);
876
877/**
878 * @brief VF - start the TX queue by sending a message to the
879 * PF.
880 *
881 * @param p_hwfn
882 * @param tx_queue_id - zero based within the VF
883 * @param sb - status block for this queue
884 * @param sb_index - index within the status block
885 * @param bd_chain_phys_addr - physical address of tx chain
886 * @param pp_doorbell - pointer to address to which to
887 * write the doorbell too..
888 *
889 * @return int
890 */
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200891int
892qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
893 struct qed_queue_cid *p_cid,
894 dma_addr_t pbl_addr,
895 u16 pbl_size, void __iomem **pp_doorbell);
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300896
897/**
898 * @brief VF - stop the RX queue by sending a message to the PF
899 *
900 * @param p_hwfn
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200901 * @param p_cid
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300902 * @param cqe_completion
903 *
904 * @return int
905 */
906int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200907 struct qed_queue_cid *p_cid, bool cqe_completion);
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300908
909/**
910 * @brief VF - stop the TX queue by sending a message to the PF
911 *
912 * @param p_hwfn
913 * @param tx_qid
914 *
915 * @return int
916 */
Mintz, Yuval3da7a372016-11-29 16:47:06 +0200917int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid);
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300918
919/**
920 * @brief VF - send a vport update command
921 *
922 * @param p_hwfn
923 * @param params
924 *
925 * @return int
926 */
927int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
928 struct qed_sp_vport_update_params *p_params);
929
930/**
Yuval Mintz0b55e272016-05-11 16:36:15 +0300931 *
932 * @brief VF - send a close message to PF
933 *
934 * @param p_hwfn
935 *
936 * @return enum _qed_status
937 */
938int qed_vf_pf_reset(struct qed_hwfn *p_hwfn);
939
940/**
941 * @brief VF - free vf`s memories
942 *
943 * @param p_hwfn
944 *
945 * @return enum _qed_status
946 */
947int qed_vf_pf_release(struct qed_hwfn *p_hwfn);
Yuval Mintz36558c32016-05-11 16:36:17 +0300948
Yuval Mintz0b55e272016-05-11 16:36:15 +0300949/**
Yuval Mintz1408cc1f2016-05-11 16:36:14 +0300950 * @brief qed_vf_get_igu_sb_id - Get the IGU SB ID for a given
951 * sb_id. For VFs igu sbs don't have to be contiguous
952 *
953 * @param p_hwfn
954 * @param sb_id
955 *
956 * @return INLINE u16
957 */
958u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id);
Yuval Mintz0b55e272016-05-11 16:36:15 +0300959
960/**
Mintz, Yuval50a20712017-06-01 15:29:09 +0300961 * @brief Stores [or removes] a configured sb_info.
962 *
963 * @param p_hwfn
964 * @param sb_id - zero-based SB index [for fastpath]
965 * @param sb_info - may be NULL [during removal].
966 */
967void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn,
968 u16 sb_id, struct qed_sb_info *p_sb);
969
970/**
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300971 * @brief qed_vf_pf_vport_start - perform vport start for VF.
972 *
973 * @param p_hwfn
974 * @param vport_id
975 * @param mtu
976 * @param inner_vlan_removal
977 * @param tpa_mode
978 * @param max_buffers_per_cqe,
979 * @param only_untagged - default behavior regarding vlan acceptance
980 *
981 * @return enum _qed_status
982 */
983int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
984 u8 vport_id,
985 u16 mtu,
986 u8 inner_vlan_removal,
987 enum qed_tpa_mode tpa_mode,
Yuval Mintz08feecd2016-05-11 16:36:20 +0300988 u8 max_buffers_per_cqe, u8 only_untagged);
Yuval Mintzdacd88d2016-05-11 16:36:16 +0300989
990/**
991 * @brief qed_vf_pf_vport_stop - stop the VF's vport
992 *
993 * @param p_hwfn
994 *
995 * @return enum _qed_status
996 */
997int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn);
998
999int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
1000 struct qed_filter_ucast *p_param);
1001
1002void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
1003 struct qed_filter_mcast *p_filter_cmd);
1004
1005/**
Yuval Mintz0b55e272016-05-11 16:36:15 +03001006 * @brief qed_vf_pf_int_cleanup - clean the SB of the VF
1007 *
1008 * @param p_hwfn
1009 *
1010 * @return enum _qed_status
1011 */
1012int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn);
Yuval Mintz36558c32016-05-11 16:36:17 +03001013
1014/**
1015 * @brief - return the link params in a given bulletin board
1016 *
1017 * @param p_hwfn
1018 * @param p_params - pointer to a struct to fill with link params
1019 * @param p_bulletin
1020 */
1021void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1022 struct qed_mcp_link_params *p_params,
1023 struct qed_bulletin_content *p_bulletin);
1024
1025/**
1026 * @brief - return the link state in a given bulletin board
1027 *
1028 * @param p_hwfn
1029 * @param p_link - pointer to a struct to fill with link state
1030 * @param p_bulletin
1031 */
1032void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1033 struct qed_mcp_link_state *p_link,
1034 struct qed_bulletin_content *p_bulletin);
1035
1036/**
1037 * @brief - return the link capabilities in a given bulletin board
1038 *
1039 * @param p_hwfn
1040 * @param p_link - pointer to a struct to fill with link capabilities
1041 * @param p_bulletin
1042 */
1043void __qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1044 struct qed_mcp_link_capabilities *p_link_caps,
1045 struct qed_bulletin_content *p_bulletin);
1046
1047void qed_iov_vf_task(struct work_struct *work);
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -07001048void qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun);
1049int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
1050 struct qed_tunnel_info *p_tunn);
Mintz, Yuval1a850bf2017-06-04 13:31:07 +03001051
1052u32 qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn, enum BAR_ID bar_id);
Shahed Shaikh809c45a2018-04-19 05:50:12 -07001053/**
1054 * @brief - Ask PF to update the MAC address in it's bulletin board
1055 *
1056 * @param p_mac - mac address to be updated in bulletin board
1057 */
1058int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, u8 *p_mac);
1059
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001060#else
Yuval Mintz36558c32016-05-11 16:36:17 +03001061static inline void qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1062 struct qed_mcp_link_params *params)
1063{
1064}
1065
1066static inline void qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1067 struct qed_mcp_link_state *link)
1068{
1069}
1070
1071static inline void
1072qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1073 struct qed_mcp_link_capabilities *p_link_caps)
1074{
1075}
1076
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001077static inline void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs)
1078{
1079}
1080
Mintz, Yuval0db711b2017-06-04 13:31:00 +03001081static inline void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs)
1082{
1083}
1084
Mintz, Yuvalcbb8a122017-06-04 13:31:08 +03001085static inline void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids)
1086{
1087}
1088
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001089static inline void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac)
1090{
1091}
1092
1093static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
1094 u8 *num_vlan_filters)
1095{
1096}
1097
Mintz, Yuvalb0fca312016-10-31 22:26:54 +02001098static inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn,
1099 u8 *num_mac_filters)
1100{
1101}
1102
Yuval Mintzeff16962016-05-11 16:36:21 +03001103static inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
1104{
1105 return false;
1106}
1107
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001108static inline void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
1109 u16 *fw_major, u16 *fw_minor,
1110 u16 *fw_rev, u16 *fw_eng)
1111{
1112}
1113
1114static inline int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
1115{
1116 return -EINVAL;
1117}
1118
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001119static inline int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
Mintz, Yuval3da7a372016-11-29 16:47:06 +02001120 struct qed_queue_cid *p_cid,
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001121 u16 bd_max_bytes,
1122 dma_addr_t bd_chain_phys_adr,
1123 dma_addr_t cqe_pbl_addr,
1124 u16 cqe_pbl_size, void __iomem **pp_prod)
1125{
1126 return -EINVAL;
1127}
1128
1129static inline int qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
Mintz, Yuval3da7a372016-11-29 16:47:06 +02001130 struct qed_queue_cid *p_cid,
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001131 dma_addr_t pbl_addr,
1132 u16 pbl_size, void __iomem **pp_doorbell)
1133{
1134 return -EINVAL;
1135}
1136
1137static inline int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
Mintz, Yuval3da7a372016-11-29 16:47:06 +02001138 struct qed_queue_cid *p_cid,
1139 bool cqe_completion)
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001140{
1141 return -EINVAL;
1142}
1143
Mintz, Yuval3da7a372016-11-29 16:47:06 +02001144static inline int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn,
1145 struct qed_queue_cid *p_cid)
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001146{
1147 return -EINVAL;
1148}
1149
1150static inline int
1151qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
1152 struct qed_sp_vport_update_params *p_params)
1153{
1154 return -EINVAL;
1155}
1156
Yuval Mintz0b55e272016-05-11 16:36:15 +03001157static inline int qed_vf_pf_reset(struct qed_hwfn *p_hwfn)
1158{
1159 return -EINVAL;
1160}
1161
1162static inline int qed_vf_pf_release(struct qed_hwfn *p_hwfn)
1163{
1164 return -EINVAL;
1165}
1166
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001167static inline u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id)
1168{
1169 return 0;
1170}
Yuval Mintz0b55e272016-05-11 16:36:15 +03001171
Arnd Bergmann2f3ca442017-06-09 12:37:35 +02001172static inline void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn, u16 sb_id,
1173 struct qed_sb_info *p_sb)
1174{
1175}
1176
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001177static inline int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
1178 u8 vport_id,
1179 u16 mtu,
1180 u8 inner_vlan_removal,
1181 enum qed_tpa_mode tpa_mode,
Yuval Mintz08feecd2016-05-11 16:36:20 +03001182 u8 max_buffers_per_cqe,
1183 u8 only_untagged)
Yuval Mintzdacd88d2016-05-11 16:36:16 +03001184{
1185 return -EINVAL;
1186}
1187
1188static inline int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn)
1189{
1190 return -EINVAL;
1191}
1192
1193static inline int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
1194 struct qed_filter_ucast *p_param)
1195{
1196 return -EINVAL;
1197}
1198
1199static inline void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
1200 struct qed_filter_mcast *p_filter_cmd)
1201{
1202}
1203
Yuval Mintz0b55e272016-05-11 16:36:15 +03001204static inline int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn)
1205{
1206 return -EINVAL;
1207}
Yuval Mintz36558c32016-05-11 16:36:17 +03001208
1209static inline void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1210 struct qed_mcp_link_params
1211 *p_params,
1212 struct qed_bulletin_content
1213 *p_bulletin)
1214{
1215}
1216
1217static inline void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1218 struct qed_mcp_link_state *p_link,
1219 struct qed_bulletin_content
1220 *p_bulletin)
1221{
1222}
1223
1224static inline void
1225__qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1226 struct qed_mcp_link_capabilities *p_link_caps,
1227 struct qed_bulletin_content *p_bulletin)
1228{
1229}
1230
1231static inline void qed_iov_vf_task(struct work_struct *work)
1232{
1233}
Chopra, Manisheaf3c0c2017-04-24 10:00:49 -07001234
1235static inline void
1236qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun)
1237{
1238}
1239
1240static inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
1241 struct qed_tunnel_info *p_tunn)
1242{
1243 return -EINVAL;
1244}
Mintz, Yuval1a850bf2017-06-04 13:31:07 +03001245
Shahed Shaikh809c45a2018-04-19 05:50:12 -07001246static inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn,
1247 u8 *p_mac)
1248{
1249 return -EINVAL;
1250}
1251
Mintz, Yuval1a850bf2017-06-04 13:31:07 +03001252static inline u32
1253qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn,
1254 enum BAR_ID bar_id)
1255{
1256 return 0;
1257}
Yuval Mintz1408cc1f2016-05-11 16:36:14 +03001258#endif
1259
Yuval Mintz32a47e72016-05-11 16:36:12 +03001260#endif