1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /* QLogic qed NIC Driver
3 * Copyright (c) 2015-2017 QLogic Corporation
12 #define T_ETH_INDIRECTION_TABLE_SIZE 128
13 #define T_ETH_RSS_KEY_SIZE 10
15 struct vf_pf_resc_request
{
32 #define TLV_BUFFER_SIZE 1024
38 PFVF_STATUS_NOT_SUPPORTED
,
39 PFVF_STATUS_NO_RESOURCE
,
41 PFVF_STATUS_MALICIOUS
,
44 /* vf pf channel tlvs */
45 /* general tlv header (used for both vf->pf request and pf->vf response) */
51 /* header of first vf->pf tlv carries the offset used to calculate response
54 struct vfpf_first_tlv
{
55 struct channel_tlv tl
;
60 /* header of pf->vf tlvs, carries the status of handling the request */
62 struct channel_tlv tl
;
67 /* response tlv used for most tlvs */
68 struct pfvf_def_resp_tlv
{
72 /* used to terminate and pad a tlv list */
73 struct channel_list_end_tlv
{
74 struct channel_tlv tl
;
78 #define VFPF_ACQUIRE_OS_LINUX (0)
79 #define VFPF_ACQUIRE_OS_WINDOWS (1)
80 #define VFPF_ACQUIRE_OS_ESX (2)
81 #define VFPF_ACQUIRE_OS_SOLARIS (3)
82 #define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
84 struct vfpf_acquire_tlv
{
85 struct vfpf_first_tlv first_tlv
;
87 struct vf_pf_vfdev_info
{
88 #define VFPF_ACQUIRE_CAP_PRE_FP_HSI BIT(0) /* VF pre-FP hsi version */
89 #define VFPF_ACQUIRE_CAP_100G BIT(1) /* VF can support 100g */
90 /* A requirement for supporting multi-Tx queues on a single queue-zone,
91 * VF would pass qids as additional information whenever passing queue
94 #define VFPF_ACQUIRE_CAP_QUEUE_QIDS BIT(2)
96 /* The VF is using the physical bar. While this is mostly internal
97 * to the VF, might affect the number of CIDs supported assuming
100 #define VFPF_ACQUIRE_CAP_PHYSICAL_BAR BIT(3)
107 u16 opaque_fid
; /* ME register value */
108 u8 os_type
; /* VFPF_ACQUIRE_OS_* value */
114 struct vf_pf_resc_request resc_request
;
121 /* receive side scaling tlv */
122 struct vfpf_vport_update_rss_tlv
{
123 struct channel_tlv tl
;
126 #define VFPF_UPDATE_RSS_CONFIG_FLAG BIT(0)
127 #define VFPF_UPDATE_RSS_CAPS_FLAG BIT(1)
128 #define VFPF_UPDATE_RSS_IND_TABLE_FLAG BIT(2)
129 #define VFPF_UPDATE_RSS_KEY_FLAG BIT(3)
133 u8 rss_table_size_log
; /* The table size is 2 ^ rss_table_size_log */
134 u16 rss_ind_table
[T_ETH_INDIRECTION_TABLE_SIZE
];
135 u32 rss_key
[T_ETH_RSS_KEY_SIZE
];
138 struct pfvf_storm_stats
{
143 struct pfvf_stats_info
{
144 struct pfvf_storm_stats mstats
;
145 struct pfvf_storm_stats pstats
;
146 struct pfvf_storm_stats tstats
;
147 struct pfvf_storm_stats ustats
;
150 struct pfvf_acquire_resp_tlv
{
153 struct pf_vf_pfdev_info
{
163 #define PFVF_ACQUIRE_CAP_DEFAULT_UNTAGGED BIT(0)
164 #define PFVF_ACQUIRE_CAP_100G BIT(1) /* If set, 100g PF */
165 /* There are old PF versions where the PF might mistakenly override the sanity
166 * mechanism [version-based] and allow a VF that can't be supported to pass
167 * the acquisition phase.
168 * To overcome this, PFs now indicate that they're past that point and the new
169 * VFs would fail probe on the older PFs that fail to do so.
171 #define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE BIT(2)
173 /* PF expects queues to be received with additional qids */
174 #define PFVF_ACQUIRE_CAP_QUEUE_QIDS BIT(3)
180 /* These should match the PF's qed_dev values */
184 /* Doorbell bar size configured in HW: log(size) or 0 */
187 struct pfvf_stats_info stats_info
;
189 u8 port_mac
[ETH_ALEN
];
191 /* It's possible PF had to configure an older fastpath HSI
192 * [in case VF is newer than PF]. This is communicated back
193 * to the VF. It can also be used in case of error due to
194 * non-matching versions to shed light in VF about failure.
201 #define PFVF_MAX_QUEUES_PER_VF 16
202 #define PFVF_MAX_SBS_PER_VF 16
203 struct hw_sb_info hw_sbs
[PFVF_MAX_SBS_PER_VF
];
204 u8 hw_qid
[PFVF_MAX_QUEUES_PER_VF
];
205 u8 cid
[PFVF_MAX_QUEUES_PER_VF
];
221 struct pfvf_start_queue_resp_tlv
{
223 u32 offset
; /* offset to consumer/producer of queue */
227 /* Extended queue information - additional index for reference inside qzone.
228 * If communicated between VF/PF, each TLV relating to queues should be
229 * extended by one such [or have a future base TLV that already contains info].
231 struct vfpf_qid_tlv
{
232 struct channel_tlv tl
;
238 struct vfpf_start_rxq_tlv
{
239 struct vfpf_first_tlv first_tlv
;
241 /* physical addresses */
243 u64 deprecated_sge_addr
;
249 u16 hc_rate
; /* desired interrupts per sec. */
257 struct vfpf_start_txq_tlv
{
258 struct vfpf_first_tlv first_tlv
;
260 /* physical addresses */
267 u32 flags
; /* VFPF_QUEUE_FLG_X flags */
268 u16 hc_rate
; /* desired interrupts per sec. */
274 struct vfpf_stop_rxqs_tlv
{
275 struct vfpf_first_tlv first_tlv
;
279 /* this field is deprecated and should *always* be set to '1' */
286 struct vfpf_stop_txqs_tlv
{
287 struct vfpf_first_tlv first_tlv
;
291 /* this field is deprecated and should *always* be set to '1' */
296 struct vfpf_update_rxq_tlv
{
297 struct vfpf_first_tlv first_tlv
;
299 u64 deprecated_sge_addr
[PFVF_MAX_QUEUES_PER_VF
];
304 #define VFPF_RXQ_UPD_INIT_SGE_DEPRECATE_FLAG BIT(0)
305 #define VFPF_RXQ_UPD_COMPLETE_CQE_FLAG BIT(1)
306 #define VFPF_RXQ_UPD_COMPLETE_EVENT_FLAG BIT(2)
311 /* Set Queue Filters */
312 struct vfpf_q_mac_vlan_filter
{
314 #define VFPF_Q_FILTER_DEST_MAC_VALID 0x01
315 #define VFPF_Q_FILTER_VLAN_TAG_VALID 0x02
316 #define VFPF_Q_FILTER_SET_MAC 0x100 /* set/clear */
325 struct vfpf_vport_start_tlv
{
326 struct vfpf_first_tlv first_tlv
;
328 u64 sb_addr
[PFVF_MAX_SBS_PER_VF
];
335 u8 inner_vlan_removal
;
338 u8 max_buffers_per_cqe
;
343 /* Extended tlvs - need to add rss, mcast, accept mode tlvs */
344 struct vfpf_vport_update_activate_tlv
{
345 struct channel_tlv tl
;
352 struct vfpf_vport_update_tx_switch_tlv
{
353 struct channel_tlv tl
;
358 struct vfpf_vport_update_vlan_strip_tlv
{
359 struct channel_tlv tl
;
364 struct vfpf_vport_update_mcast_bin_tlv
{
365 struct channel_tlv tl
;
368 /* There are only 256 approx bins, and in HSI they're divided into
369 * 32-bit values. As old VFs used to set-bit to the values on its side,
370 * the upper half of the array is never expected to contain any data.
373 u64 obsolete_bins
[4];
376 struct vfpf_vport_update_accept_param_tlv
{
377 struct channel_tlv tl
;
384 struct vfpf_vport_update_accept_any_vlan_tlv
{
385 struct channel_tlv tl
;
386 u8 update_accept_any_vlan_flg
;
392 struct vfpf_vport_update_sge_tpa_tlv
{
393 struct channel_tlv tl
;
396 #define VFPF_TPA_IPV4_EN_FLAG BIT(0)
397 #define VFPF_TPA_IPV6_EN_FLAG BIT(1)
398 #define VFPF_TPA_PKT_SPLIT_FLAG BIT(2)
399 #define VFPF_TPA_HDR_DATA_SPLIT_FLAG BIT(3)
400 #define VFPF_TPA_GRO_CONSIST_FLAG BIT(4)
402 u8 update_sge_tpa_flags
;
403 #define VFPF_UPDATE_SGE_DEPRECATED_FLAG BIT(0)
404 #define VFPF_UPDATE_TPA_EN_FLAG BIT(1)
405 #define VFPF_UPDATE_TPA_PARAM_FLAG BIT(2)
407 u8 max_buffers_per_cqe
;
409 u16 deprecated_sge_buff_size
;
411 u16 tpa_min_size_to_start
;
412 u16 tpa_min_size_to_cont
;
418 /* Primary tlv as a header for various extended tlvs for
419 * various functionalities in vport update ramrod.
421 struct vfpf_vport_update_tlv
{
422 struct vfpf_first_tlv first_tlv
;
425 struct vfpf_ucast_filter_tlv
{
426 struct vfpf_first_tlv first_tlv
;
437 /* tunnel update param tlv */
438 struct vfpf_update_tunn_param_tlv
{
439 struct vfpf_first_tlv first_tlv
;
441 u8 tun_mode_update_mask
;
449 u8 update_geneve_port
;
450 u8 update_vxlan_port
;
456 struct pfvf_update_tunn_param_tlv
{
459 u16 tunn_feature_mask
;
474 struct tlv_buffer_size
{
475 u8 tlv_buffer
[TLV_BUFFER_SIZE
];
478 struct vfpf_update_coalesce
{
479 struct vfpf_first_tlv first_tlv
;
486 struct vfpf_read_coal_req_tlv
{
487 struct vfpf_first_tlv first_tlv
;
493 struct pfvf_read_coal_resp_tlv
{
499 struct vfpf_bulletin_update_mac_tlv
{
500 struct vfpf_first_tlv first_tlv
;
506 struct vfpf_first_tlv first_tlv
;
507 struct vfpf_acquire_tlv acquire
;
508 struct vfpf_start_rxq_tlv start_rxq
;
509 struct vfpf_start_txq_tlv start_txq
;
510 struct vfpf_stop_rxqs_tlv stop_rxqs
;
511 struct vfpf_stop_txqs_tlv stop_txqs
;
512 struct vfpf_update_rxq_tlv update_rxq
;
513 struct vfpf_vport_start_tlv start_vport
;
514 struct vfpf_vport_update_tlv vport_update
;
515 struct vfpf_ucast_filter_tlv ucast_filter
;
516 struct vfpf_update_tunn_param_tlv tunn_param_update
;
517 struct vfpf_update_coalesce update_coalesce
;
518 struct vfpf_read_coal_req_tlv read_coal_req
;
519 struct vfpf_bulletin_update_mac_tlv bulletin_update_mac
;
520 struct tlv_buffer_size tlv_buf_size
;
524 struct pfvf_def_resp_tlv default_resp
;
525 struct pfvf_acquire_resp_tlv acquire_resp
;
526 struct tlv_buffer_size tlv_buf_size
;
527 struct pfvf_start_queue_resp_tlv queue_start
;
528 struct pfvf_update_tunn_param_tlv tunn_param_resp
;
529 struct pfvf_read_coal_resp_tlv read_coal_resp
;
532 enum qed_bulletin_bit
{
533 /* Alert the VF that a forced MAC was set by the PF */
535 /* Alert the VF that a forced VLAN was set by the PF */
536 VLAN_ADDR_FORCED
= 2,
538 /* Indicate that `default_only_untagged' contains actual data */
539 VFPF_BULLETIN_UNTAGGED_DEFAULT
= 3,
540 VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED
= 4,
542 /* Alert the VF that suggested mac was sent by the PF.
543 * MAC_ADDR will be disabled in case MAC_ADDR_FORCED is set.
545 VFPF_BULLETIN_MAC_ADDR
= 5
548 struct qed_bulletin_content
{
549 /* crc of structure to ensure is not in mid-update */
554 /* bitmap indicating which fields hold valid values */
557 /* used for MAC_ADDR or MAC_ADDR_FORCED */
560 /* If valid, 1 => only untagged Rx if no vlan is configured */
561 u8 default_only_untagged
;
564 /* The following is a 'copy' of qed_mcp_link_state,
565 * qed_mcp_link_params and qed_mcp_link_capabilities. Since it's
566 * possible the structs will increase further along the road we cannot
567 * have it here; Instead we need to have all of its fields.
570 u8 req_autoneg_pause
;
576 u32 req_forced_speed
;
584 u8 parallel_detection
;
586 u8 partner_tx_flow_ctrl_en
;
587 u8 partner_rx_flow_ctrl_en
;
588 u8 partner_adv_pause
;
595 u32 partner_adv_speed
;
597 u32 capability_speed
;
604 struct qed_bulletin
{
606 struct qed_bulletin_content
*p_virt
;
611 CHANNEL_TLV_NONE
, /* ends tlv sequence */
613 CHANNEL_TLV_VPORT_START
,
614 CHANNEL_TLV_VPORT_UPDATE
,
615 CHANNEL_TLV_VPORT_TEARDOWN
,
616 CHANNEL_TLV_START_RXQ
,
617 CHANNEL_TLV_START_TXQ
,
618 CHANNEL_TLV_STOP_RXQS
,
619 CHANNEL_TLV_STOP_TXQS
,
620 CHANNEL_TLV_UPDATE_RXQ
,
621 CHANNEL_TLV_INT_CLEANUP
,
624 CHANNEL_TLV_LIST_END
,
625 CHANNEL_TLV_UCAST_FILTER
,
626 CHANNEL_TLV_VPORT_UPDATE_ACTIVATE
,
627 CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH
,
628 CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP
,
629 CHANNEL_TLV_VPORT_UPDATE_MCAST
,
630 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM
,
631 CHANNEL_TLV_VPORT_UPDATE_RSS
,
632 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN
,
633 CHANNEL_TLV_VPORT_UPDATE_SGE_TPA
,
634 CHANNEL_TLV_UPDATE_TUNN_PARAM
,
635 CHANNEL_TLV_COALESCE_UPDATE
,
637 CHANNEL_TLV_COALESCE_READ
,
638 CHANNEL_TLV_BULLETIN_UPDATE_MAC
,
641 /* Required for iterating over vport-update tlvs.
642 * Will break in case non-sequential vport-update tlvs.
644 CHANNEL_TLV_VPORT_UPDATE_MAX
= CHANNEL_TLV_VPORT_UPDATE_SGE_TPA
+ 1,
647 /* Default number of CIDs [total of both Rx and Tx] to be requested
648 * by default, and maximum possible number.
650 #define QED_ETH_VF_DEFAULT_NUM_CIDS (32)
651 #define QED_ETH_VF_MAX_NUM_CIDS (250)
653 /* This data is held in the qed_hwfn structure for VFs only. */
655 union vfpf_tlvs
*vf2pf_request
;
656 dma_addr_t vf2pf_request_phys
;
657 union pfvf_tlvs
*pf2vf_reply
;
658 dma_addr_t pf2vf_reply_phys
;
660 /* Should be taken whenever the mailbox buffers are accessed */
665 struct qed_bulletin bulletin
;
666 struct qed_bulletin_content bulletin_shadow
;
668 /* we set aside a copy of the acquire response */
669 struct pfvf_acquire_resp_tlv acquire_resp
;
671 /* In case PF originates prior to the fp-hsi version comparison,
672 * this has to be propagated as it affects the fastpath.
676 /* Current day VFs are passing the SBs physical address on vport
677 * start, and as they lack an IGU mapping they need to store the
678 * addresses of previously registered SBs.
679 * Even if we were to change configuration flow, due to backward
680 * compatibility [with older PFs] we'd still need to store these.
682 struct qed_sb_info
*sbs_info
[PFVF_MAX_SBS_PER_VF
];
684 /* Determines whether VF utilizes doorbells via limited register
685 * bar or via the doorbell bar.
691 * qed_vf_pf_set_coalesce(): VF - Set Rx/Tx coalesce per VF's relative queue.
692 * Coalesce value '0' will omit the
695 * @p_hwfn: HW device data.
696 * @rx_coal: coalesce value in micro second for rx queue.
697 * @tx_coal: coalesce value in micro second for tx queue.
703 int qed_vf_pf_set_coalesce(struct qed_hwfn
*p_hwfn
,
705 u16 tx_coal
, struct qed_queue_cid
*p_cid
);
708 * qed_vf_pf_get_coalesce(): VF - Get coalesce per VF's relative queue.
710 * @p_hwfn: HW device data.
711 * @p_coal: coalesce value in micro second for VF queues.
716 int qed_vf_pf_get_coalesce(struct qed_hwfn
*p_hwfn
,
717 u16
*p_coal
, struct qed_queue_cid
*p_cid
);
719 #ifdef CONFIG_QED_SRIOV
721 * qed_vf_read_bulletin(): Read the VF bulletin and act on it if needed.
723 * @p_hwfn: HW device data.
724 * @p_change: qed fills 1 iff bulletin board has changed, 0 otherwise.
726 * Return: enum _qed_status.
728 int qed_vf_read_bulletin(struct qed_hwfn
*p_hwfn
, u8
*p_change
);
731 * qed_vf_get_link_params(): Get link parameters for VF from qed
733 * @p_hwfn: HW device data.
734 * @params: the link params structure to be filled for the VF.
738 void qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
739 struct qed_mcp_link_params
*params
);
742 * qed_vf_get_link_state(): Get link state for VF from qed.
744 * @p_hwfn: HW device data.
745 * @link: the link state structure to be filled for the VF
749 void qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
750 struct qed_mcp_link_state
*link
);
753 * qed_vf_get_link_caps(): Get link capabilities for VF from qed.
755 * @p_hwfn: HW device data.
756 * @p_link_caps: the link capabilities structure to be filled for the VF
760 void qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
761 struct qed_mcp_link_capabilities
*p_link_caps
);
764 * qed_vf_get_num_rxqs(): Get number of Rx queues allocated for VF by qed
766 * @p_hwfn: HW device data.
767 * @num_rxqs: allocated RX queues
771 void qed_vf_get_num_rxqs(struct qed_hwfn
*p_hwfn
, u8
*num_rxqs
);
774 * qed_vf_get_num_txqs(): Get number of Rx queues allocated for VF by qed
776 * @p_hwfn: HW device data.
777 * @num_txqs: allocated RX queues
781 void qed_vf_get_num_txqs(struct qed_hwfn
*p_hwfn
, u8
*num_txqs
);
784 * qed_vf_get_num_cids(): Get number of available connections
785 * [both Rx and Tx] for VF
787 * @p_hwfn: HW device data.
788 * @num_cids: allocated number of connections
792 void qed_vf_get_num_cids(struct qed_hwfn
*p_hwfn
, u8
*num_cids
);
795 * qed_vf_get_port_mac(): Get port mac address for VF.
797 * @p_hwfn: HW device data.
798 * @port_mac: destination location for port mac
802 void qed_vf_get_port_mac(struct qed_hwfn
*p_hwfn
, u8
*port_mac
);
805 * qed_vf_get_num_vlan_filters(): Get number of VLAN filters allocated
808 * @p_hwfn: HW device data.
809 * @num_vlan_filters: allocated VLAN filters
813 void qed_vf_get_num_vlan_filters(struct qed_hwfn
*p_hwfn
,
814 u8
*num_vlan_filters
);
817 * qed_vf_get_num_mac_filters(): Get number of MAC filters allocated
820 * @p_hwfn: HW device data.
821 * @num_mac_filters: allocated MAC filters
825 void qed_vf_get_num_mac_filters(struct qed_hwfn
*p_hwfn
, u8
*num_mac_filters
);
828 * qed_vf_check_mac(): Check if VF can set a MAC address
830 * @p_hwfn: HW device data.
835 bool qed_vf_check_mac(struct qed_hwfn
*p_hwfn
, u8
*mac
);
838 * qed_vf_get_fw_version(): Set firmware version information
839 * in dev_info from VFs acquire response tlv
841 * @p_hwfn: HW device data.
842 * @fw_major: FW major.
843 * @fw_minor: FW minor.
849 void qed_vf_get_fw_version(struct qed_hwfn
*p_hwfn
,
850 u16
*fw_major
, u16
*fw_minor
,
851 u16
*fw_rev
, u16
*fw_eng
);
854 * qed_vf_hw_prepare(): hw preparation for VF sends ACQUIRE message
856 * @p_hwfn: HW device data.
860 int qed_vf_hw_prepare(struct qed_hwfn
*p_hwfn
);
863 * qed_vf_pf_rxq_start(): start the RX Queue by sending a message to the PF
865 * @p_hwfn: HW device data.
866 * @p_cid: Only relative fields are relevant
867 * @bd_max_bytes: maximum number of bytes per bd
868 * @bd_chain_phys_addr: physical address of bd chain
869 * @cqe_pbl_addr: physical address of pbl
870 * @cqe_pbl_size: pbl size
871 * @pp_prod: pointer to the producer to be used in fastpath
875 int qed_vf_pf_rxq_start(struct qed_hwfn
*p_hwfn
,
876 struct qed_queue_cid
*p_cid
,
878 dma_addr_t bd_chain_phys_addr
,
879 dma_addr_t cqe_pbl_addr
,
880 u16 cqe_pbl_size
, void __iomem
**pp_prod
);
883 * qed_vf_pf_txq_start(): VF - start the TX queue by sending a message to the
886 * @p_hwfn: HW device data.
888 * @pbl_addr: PBL address.
889 * @pbl_size: PBL Size.
890 * @pp_doorbell: pointer to address to which to write the doorbell too.
895 qed_vf_pf_txq_start(struct qed_hwfn
*p_hwfn
,
896 struct qed_queue_cid
*p_cid
,
898 u16 pbl_size
, void __iomem
**pp_doorbell
);
901 * qed_vf_pf_rxq_stop(): VF - stop the RX queue by sending a message to the PF.
903 * @p_hwfn: HW device data.
905 * @cqe_completion: CQE Completion.
909 int qed_vf_pf_rxq_stop(struct qed_hwfn
*p_hwfn
,
910 struct qed_queue_cid
*p_cid
, bool cqe_completion
);
913 * qed_vf_pf_txq_stop(): VF - stop the TX queue by sending a message to the PF.
915 * @p_hwfn: HW device data.
920 int qed_vf_pf_txq_stop(struct qed_hwfn
*p_hwfn
, struct qed_queue_cid
*p_cid
);
923 * qed_vf_pf_vport_update(): VF - send a vport update command.
925 * @p_hwfn: HW device data.
930 int qed_vf_pf_vport_update(struct qed_hwfn
*p_hwfn
,
931 struct qed_sp_vport_update_params
*p_params
);
934 * qed_vf_pf_reset(): VF - send a close message to PF.
936 * @p_hwfn: HW device data.
938 * Return: enum _qed_status
940 int qed_vf_pf_reset(struct qed_hwfn
*p_hwfn
);
943 * qed_vf_pf_release(): VF - free vf`s memories.
945 * @p_hwfn: HW device data.
947 * Return: enum _qed_status
949 int qed_vf_pf_release(struct qed_hwfn
*p_hwfn
);
952 * qed_vf_get_igu_sb_id(): Get the IGU SB ID for a given
953 * sb_id. For VFs igu sbs don't have to be contiguous
955 * @p_hwfn: HW device data.
960 u16
qed_vf_get_igu_sb_id(struct qed_hwfn
*p_hwfn
, u16 sb_id
);
963 * qed_vf_set_sb_info(): Stores [or removes] a configured sb_info.
965 * @p_hwfn: HW device data.
966 * @sb_id: zero-based SB index [for fastpath]
967 * @p_sb: may be NULL [during removal].
971 void qed_vf_set_sb_info(struct qed_hwfn
*p_hwfn
,
972 u16 sb_id
, struct qed_sb_info
*p_sb
);
975 * qed_vf_pf_vport_start(): perform vport start for VF.
977 * @p_hwfn: HW device data.
978 * @vport_id: Vport ID.
980 * @inner_vlan_removal: Innter VLAN removal.
981 * @tpa_mode: TPA mode
982 * @max_buffers_per_cqe: Max buffer pre CQE.
983 * @only_untagged: default behavior regarding vlan acceptance
985 * Return: enum _qed_status
987 int qed_vf_pf_vport_start(struct qed_hwfn
*p_hwfn
,
990 u8 inner_vlan_removal
,
991 enum qed_tpa_mode tpa_mode
,
992 u8 max_buffers_per_cqe
, u8 only_untagged
);
995 * qed_vf_pf_vport_stop(): stop the VF's vport
997 * @p_hwfn: HW device data.
999 * Return: enum _qed_status
1001 int qed_vf_pf_vport_stop(struct qed_hwfn
*p_hwfn
);
1003 int qed_vf_pf_filter_ucast(struct qed_hwfn
*p_hwfn
,
1004 struct qed_filter_ucast
*p_param
);
1006 void qed_vf_pf_filter_mcast(struct qed_hwfn
*p_hwfn
,
1007 struct qed_filter_mcast
*p_filter_cmd
);
1010 * qed_vf_pf_int_cleanup(): clean the SB of the VF
1012 * @p_hwfn: HW device data.
1014 * Return: enum _qed_status
1016 int qed_vf_pf_int_cleanup(struct qed_hwfn
*p_hwfn
);
1019 * __qed_vf_get_link_params(): return the link params in a given bulletin board
1021 * @p_hwfn: HW device data.
1022 * @p_params: pointer to a struct to fill with link params
1023 * @p_bulletin: Bulletin.
1027 void __qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1028 struct qed_mcp_link_params
*p_params
,
1029 struct qed_bulletin_content
*p_bulletin
);
1032 * __qed_vf_get_link_state(): return the link state in a given bulletin board
1034 * @p_hwfn: HW device data.
1035 * @p_link: pointer to a struct to fill with link state
1036 * @p_bulletin: Bulletin.
1040 void __qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1041 struct qed_mcp_link_state
*p_link
,
1042 struct qed_bulletin_content
*p_bulletin
);
1045 * __qed_vf_get_link_caps(): return the link capabilities in a given
1048 * @p_hwfn: HW device data.
1049 * @p_link_caps: pointer to a struct to fill with link capabilities
1050 * @p_bulletin: Bulletin.
1054 void __qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1055 struct qed_mcp_link_capabilities
*p_link_caps
,
1056 struct qed_bulletin_content
*p_bulletin
);
1058 void qed_iov_vf_task(struct work_struct
*work
);
1059 void qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info
*p_tun
);
1060 int qed_vf_pf_tunnel_param_update(struct qed_hwfn
*p_hwfn
,
1061 struct qed_tunnel_info
*p_tunn
);
1063 u32
qed_vf_hw_bar_size(struct qed_hwfn
*p_hwfn
, enum BAR_ID bar_id
);
1065 * qed_vf_pf_bulletin_update_mac(): Ask PF to update the MAC address in
1066 * it's bulletin board
1068 * @p_hwfn: HW device data.
1069 * @p_mac: mac address to be updated in bulletin board
1073 int qed_vf_pf_bulletin_update_mac(struct qed_hwfn
*p_hwfn
, const u8
*p_mac
);
1076 static inline void qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1077 struct qed_mcp_link_params
*params
)
1081 static inline void qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1082 struct qed_mcp_link_state
*link
)
1087 qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1088 struct qed_mcp_link_capabilities
*p_link_caps
)
1092 static inline void qed_vf_get_num_rxqs(struct qed_hwfn
*p_hwfn
, u8
*num_rxqs
)
1096 static inline void qed_vf_get_num_txqs(struct qed_hwfn
*p_hwfn
, u8
*num_txqs
)
1100 static inline void qed_vf_get_num_cids(struct qed_hwfn
*p_hwfn
, u8
*num_cids
)
1104 static inline void qed_vf_get_port_mac(struct qed_hwfn
*p_hwfn
, u8
*port_mac
)
1108 static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn
*p_hwfn
,
1109 u8
*num_vlan_filters
)
1113 static inline void qed_vf_get_num_mac_filters(struct qed_hwfn
*p_hwfn
,
1114 u8
*num_mac_filters
)
1118 static inline bool qed_vf_check_mac(struct qed_hwfn
*p_hwfn
, u8
*mac
)
1123 static inline void qed_vf_get_fw_version(struct qed_hwfn
*p_hwfn
,
1124 u16
*fw_major
, u16
*fw_minor
,
1125 u16
*fw_rev
, u16
*fw_eng
)
1129 static inline int qed_vf_hw_prepare(struct qed_hwfn
*p_hwfn
)
1134 static inline int qed_vf_pf_rxq_start(struct qed_hwfn
*p_hwfn
,
1135 struct qed_queue_cid
*p_cid
,
1137 dma_addr_t bd_chain_phys_adr
,
1138 dma_addr_t cqe_pbl_addr
,
1139 u16 cqe_pbl_size
, void __iomem
**pp_prod
)
1144 static inline int qed_vf_pf_txq_start(struct qed_hwfn
*p_hwfn
,
1145 struct qed_queue_cid
*p_cid
,
1146 dma_addr_t pbl_addr
,
1147 u16 pbl_size
, void __iomem
**pp_doorbell
)
1152 static inline int qed_vf_pf_rxq_stop(struct qed_hwfn
*p_hwfn
,
1153 struct qed_queue_cid
*p_cid
,
1154 bool cqe_completion
)
1159 static inline int qed_vf_pf_txq_stop(struct qed_hwfn
*p_hwfn
,
1160 struct qed_queue_cid
*p_cid
)
1166 qed_vf_pf_vport_update(struct qed_hwfn
*p_hwfn
,
1167 struct qed_sp_vport_update_params
*p_params
)
1172 static inline int qed_vf_pf_reset(struct qed_hwfn
*p_hwfn
)
1177 static inline int qed_vf_pf_release(struct qed_hwfn
*p_hwfn
)
1182 static inline u16
qed_vf_get_igu_sb_id(struct qed_hwfn
*p_hwfn
, u16 sb_id
)
1187 static inline void qed_vf_set_sb_info(struct qed_hwfn
*p_hwfn
, u16 sb_id
,
1188 struct qed_sb_info
*p_sb
)
1192 static inline int qed_vf_pf_vport_start(struct qed_hwfn
*p_hwfn
,
1195 u8 inner_vlan_removal
,
1196 enum qed_tpa_mode tpa_mode
,
1197 u8 max_buffers_per_cqe
,
1203 static inline int qed_vf_pf_vport_stop(struct qed_hwfn
*p_hwfn
)
1208 static inline int qed_vf_pf_filter_ucast(struct qed_hwfn
*p_hwfn
,
1209 struct qed_filter_ucast
*p_param
)
1214 static inline void qed_vf_pf_filter_mcast(struct qed_hwfn
*p_hwfn
,
1215 struct qed_filter_mcast
*p_filter_cmd
)
1219 static inline int qed_vf_pf_int_cleanup(struct qed_hwfn
*p_hwfn
)
1224 static inline void __qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1225 struct qed_mcp_link_params
1227 struct qed_bulletin_content
1232 static inline void __qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1233 struct qed_mcp_link_state
*p_link
,
1234 struct qed_bulletin_content
1240 __qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1241 struct qed_mcp_link_capabilities
*p_link_caps
,
1242 struct qed_bulletin_content
*p_bulletin
)
1246 static inline void qed_iov_vf_task(struct work_struct
*work
)
1251 qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info
*p_tun
)
1255 static inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn
*p_hwfn
,
1256 struct qed_tunnel_info
*p_tunn
)
1261 static inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn
*p_hwfn
,
1268 qed_vf_hw_bar_size(struct qed_hwfn
*p_hwfn
,