1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
4 * 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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
39 #define T_ETH_INDIRECTION_TABLE_SIZE 128
40 #define T_ETH_RSS_KEY_SIZE 10
42 struct vf_pf_resc_request
{
59 #define TLV_BUFFER_SIZE 1024
65 PFVF_STATUS_NOT_SUPPORTED
,
66 PFVF_STATUS_NO_RESOURCE
,
68 PFVF_STATUS_MALICIOUS
,
71 /* vf pf channel tlvs */
72 /* general tlv header (used for both vf->pf request and pf->vf response) */
78 /* header of first vf->pf tlv carries the offset used to calculate reponse
81 struct vfpf_first_tlv
{
82 struct channel_tlv tl
;
87 /* header of pf->vf tlvs, carries the status of handling the request */
89 struct channel_tlv tl
;
94 /* response tlv used for most tlvs */
95 struct pfvf_def_resp_tlv
{
99 /* used to terminate and pad a tlv list */
100 struct channel_list_end_tlv
{
101 struct channel_tlv tl
;
105 #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)
111 struct vfpf_acquire_tlv
{
112 struct vfpf_first_tlv first_tlv
;
114 struct vf_pf_vfdev_info
{
115 #define VFPF_ACQUIRE_CAP_PRE_FP_HSI (1 << 0) /* VF pre-FP hsi version */
116 #define VFPF_ACQUIRE_CAP_100G (1 << 1) /* VF can support 100g */
117 /* A requirement for supporting multi-Tx queues on a single queue-zone,
118 * VF would pass qids as additional information whenever passing queue
121 #define VFPF_ACQUIRE_CAP_QUEUE_QIDS BIT(2)
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
127 #define VFPF_ACQUIRE_CAP_PHYSICAL_BAR BIT(3)
134 u16 opaque_fid
; /* ME register value */
135 u8 os_type
; /* VFPF_ACQUIRE_OS_* value */
141 struct vf_pf_resc_request resc_request
;
148 /* receive side scaling tlv */
149 struct vfpf_vport_update_rss_tlv
{
150 struct channel_tlv tl
;
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)
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
];
165 struct pfvf_storm_stats
{
170 struct 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
;
177 struct pfvf_acquire_resp_tlv
{
180 struct pf_vf_pfdev_info
{
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.
198 #define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE BIT(2)
200 /* PF expects queues to be received with additional qids */
201 #define PFVF_ACQUIRE_CAP_QUEUE_QIDS BIT(3)
207 /* These should match the PF's qed_dev values */
211 /* Doorbell bar size configured in HW: log(size) or 0 */
214 struct pfvf_stats_info stats_info
;
216 u8 port_mac
[ETH_ALEN
];
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.
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
];
248 struct pfvf_start_queue_resp_tlv
{
250 u32 offset
; /* offset to consumer/producer of queue */
254 /* 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].
258 struct vfpf_qid_tlv
{
259 struct channel_tlv tl
;
265 struct vfpf_start_rxq_tlv
{
266 struct vfpf_first_tlv first_tlv
;
268 /* physical addresses */
270 u64 deprecated_sge_addr
;
276 u16 hc_rate
; /* desired interrupts per sec. */
284 struct vfpf_start_txq_tlv
{
285 struct vfpf_first_tlv first_tlv
;
287 /* physical addresses */
294 u32 flags
; /* VFPF_QUEUE_FLG_X flags */
295 u16 hc_rate
; /* desired interrupts per sec. */
301 struct vfpf_stop_rxqs_tlv
{
302 struct vfpf_first_tlv first_tlv
;
306 /* this field is deprecated and should *always* be set to '1' */
313 struct vfpf_stop_txqs_tlv
{
314 struct vfpf_first_tlv first_tlv
;
318 /* this field is deprecated and should *always* be set to '1' */
323 struct vfpf_update_rxq_tlv
{
324 struct vfpf_first_tlv first_tlv
;
326 u64 deprecated_sge_addr
[PFVF_MAX_QUEUES_PER_VF
];
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)
338 /* Set Queue Filters */
339 struct vfpf_q_mac_vlan_filter
{
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 */
352 struct vfpf_vport_start_tlv
{
353 struct vfpf_first_tlv first_tlv
;
355 u64 sb_addr
[PFVF_MAX_SBS_PER_VF
];
362 u8 inner_vlan_removal
;
365 u8 max_buffers_per_cqe
;
370 /* Extended tlvs - need to add rss, mcast, accept mode tlvs */
371 struct vfpf_vport_update_activate_tlv
{
372 struct channel_tlv tl
;
379 struct vfpf_vport_update_tx_switch_tlv
{
380 struct channel_tlv tl
;
385 struct vfpf_vport_update_vlan_strip_tlv
{
386 struct channel_tlv tl
;
391 struct vfpf_vport_update_mcast_bin_tlv
{
392 struct channel_tlv tl
;
395 /* There are only 256 approx bins, and in HSI they're divided into
396 * 32-bit values. As old VFs used to set-bit to the values on its side,
397 * the upper half of the array is never expected to contain any data.
400 u64 obsolete_bins
[4];
403 struct vfpf_vport_update_accept_param_tlv
{
404 struct channel_tlv tl
;
411 struct vfpf_vport_update_accept_any_vlan_tlv
{
412 struct channel_tlv tl
;
413 u8 update_accept_any_vlan_flg
;
419 struct vfpf_vport_update_sge_tpa_tlv
{
420 struct channel_tlv tl
;
423 #define VFPF_TPA_IPV4_EN_FLAG BIT(0)
424 #define VFPF_TPA_IPV6_EN_FLAG BIT(1)
425 #define VFPF_TPA_PKT_SPLIT_FLAG BIT(2)
426 #define VFPF_TPA_HDR_DATA_SPLIT_FLAG BIT(3)
427 #define VFPF_TPA_GRO_CONSIST_FLAG BIT(4)
429 u8 update_sge_tpa_flags
;
430 #define VFPF_UPDATE_SGE_DEPRECATED_FLAG BIT(0)
431 #define VFPF_UPDATE_TPA_EN_FLAG BIT(1)
432 #define VFPF_UPDATE_TPA_PARAM_FLAG BIT(2)
434 u8 max_buffers_per_cqe
;
436 u16 deprecated_sge_buff_size
;
438 u16 tpa_min_size_to_start
;
439 u16 tpa_min_size_to_cont
;
445 /* Primary tlv as a header for various extended tlvs for
446 * various functionalities in vport update ramrod.
448 struct vfpf_vport_update_tlv
{
449 struct vfpf_first_tlv first_tlv
;
452 struct vfpf_ucast_filter_tlv
{
453 struct vfpf_first_tlv first_tlv
;
464 /* tunnel update param tlv */
465 struct vfpf_update_tunn_param_tlv
{
466 struct vfpf_first_tlv first_tlv
;
468 u8 tun_mode_update_mask
;
476 u8 update_geneve_port
;
477 u8 update_vxlan_port
;
483 struct pfvf_update_tunn_param_tlv
{
486 u16 tunn_feature_mask
;
501 struct tlv_buffer_size
{
502 u8 tlv_buffer
[TLV_BUFFER_SIZE
];
505 struct vfpf_update_coalesce
{
506 struct vfpf_first_tlv first_tlv
;
513 struct vfpf_read_coal_req_tlv
{
514 struct vfpf_first_tlv first_tlv
;
520 struct pfvf_read_coal_resp_tlv
{
526 struct vfpf_bulletin_update_mac_tlv
{
527 struct vfpf_first_tlv first_tlv
;
533 struct vfpf_first_tlv first_tlv
;
534 struct vfpf_acquire_tlv acquire
;
535 struct vfpf_start_rxq_tlv start_rxq
;
536 struct vfpf_start_txq_tlv start_txq
;
537 struct vfpf_stop_rxqs_tlv stop_rxqs
;
538 struct vfpf_stop_txqs_tlv stop_txqs
;
539 struct vfpf_update_rxq_tlv update_rxq
;
540 struct vfpf_vport_start_tlv start_vport
;
541 struct vfpf_vport_update_tlv vport_update
;
542 struct vfpf_ucast_filter_tlv ucast_filter
;
543 struct vfpf_update_tunn_param_tlv tunn_param_update
;
544 struct vfpf_update_coalesce update_coalesce
;
545 struct vfpf_read_coal_req_tlv read_coal_req
;
546 struct vfpf_bulletin_update_mac_tlv bulletin_update_mac
;
547 struct tlv_buffer_size tlv_buf_size
;
551 struct pfvf_def_resp_tlv default_resp
;
552 struct pfvf_acquire_resp_tlv acquire_resp
;
553 struct tlv_buffer_size tlv_buf_size
;
554 struct pfvf_start_queue_resp_tlv queue_start
;
555 struct pfvf_update_tunn_param_tlv tunn_param_resp
;
556 struct pfvf_read_coal_resp_tlv read_coal_resp
;
559 enum qed_bulletin_bit
{
560 /* Alert the VF that a forced MAC was set by the PF */
562 /* Alert the VF that a forced VLAN was set by the PF */
563 VLAN_ADDR_FORCED
= 2,
565 /* Indicate that `default_only_untagged' contains actual data */
566 VFPF_BULLETIN_UNTAGGED_DEFAULT
= 3,
567 VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED
= 4,
569 /* Alert the VF that suggested mac was sent by the PF.
570 * MAC_ADDR will be disabled in case MAC_ADDR_FORCED is set.
572 VFPF_BULLETIN_MAC_ADDR
= 5
575 struct qed_bulletin_content
{
576 /* crc of structure to ensure is not in mid-update */
581 /* bitmap indicating which fields hold valid values */
584 /* used for MAC_ADDR or MAC_ADDR_FORCED */
587 /* If valid, 1 => only untagged Rx if no vlan is configured */
588 u8 default_only_untagged
;
591 /* The following is a 'copy' of qed_mcp_link_state,
592 * qed_mcp_link_params and qed_mcp_link_capabilities. Since it's
593 * possible the structs will increase further along the road we cannot
594 * have it here; Instead we need to have all of its fields.
597 u8 req_autoneg_pause
;
603 u32 req_forced_speed
;
611 u8 parallel_detection
;
613 u8 partner_tx_flow_ctrl_en
;
614 u8 partner_rx_flow_ctrl_en
;
615 u8 partner_adv_pause
;
622 u32 partner_adv_speed
;
624 u32 capability_speed
;
631 struct qed_bulletin
{
633 struct qed_bulletin_content
*p_virt
;
638 CHANNEL_TLV_NONE
, /* ends tlv sequence */
640 CHANNEL_TLV_VPORT_START
,
641 CHANNEL_TLV_VPORT_UPDATE
,
642 CHANNEL_TLV_VPORT_TEARDOWN
,
643 CHANNEL_TLV_START_RXQ
,
644 CHANNEL_TLV_START_TXQ
,
645 CHANNEL_TLV_STOP_RXQS
,
646 CHANNEL_TLV_STOP_TXQS
,
647 CHANNEL_TLV_UPDATE_RXQ
,
648 CHANNEL_TLV_INT_CLEANUP
,
651 CHANNEL_TLV_LIST_END
,
652 CHANNEL_TLV_UCAST_FILTER
,
653 CHANNEL_TLV_VPORT_UPDATE_ACTIVATE
,
654 CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH
,
655 CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP
,
656 CHANNEL_TLV_VPORT_UPDATE_MCAST
,
657 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM
,
658 CHANNEL_TLV_VPORT_UPDATE_RSS
,
659 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN
,
660 CHANNEL_TLV_VPORT_UPDATE_SGE_TPA
,
661 CHANNEL_TLV_UPDATE_TUNN_PARAM
,
662 CHANNEL_TLV_COALESCE_UPDATE
,
664 CHANNEL_TLV_COALESCE_READ
,
665 CHANNEL_TLV_BULLETIN_UPDATE_MAC
,
668 /* Required for iterating over vport-update tlvs.
669 * Will break in case non-sequential vport-update tlvs.
671 CHANNEL_TLV_VPORT_UPDATE_MAX
= CHANNEL_TLV_VPORT_UPDATE_SGE_TPA
+ 1,
674 /* Default number of CIDs [total of both Rx and Tx] to be requested
675 * by default, and maximum possible number.
677 #define QED_ETH_VF_DEFAULT_NUM_CIDS (32)
678 #define QED_ETH_VF_MAX_NUM_CIDS (250)
680 /* This data is held in the qed_hwfn structure for VFs only. */
682 union vfpf_tlvs
*vf2pf_request
;
683 dma_addr_t vf2pf_request_phys
;
684 union pfvf_tlvs
*pf2vf_reply
;
685 dma_addr_t pf2vf_reply_phys
;
687 /* Should be taken whenever the mailbox buffers are accessed */
692 struct qed_bulletin bulletin
;
693 struct qed_bulletin_content bulletin_shadow
;
695 /* we set aside a copy of the acquire response */
696 struct pfvf_acquire_resp_tlv acquire_resp
;
698 /* In case PF originates prior to the fp-hsi version comparison,
699 * this has to be propagated as it affects the fastpath.
703 /* Current day VFs are passing the SBs physical address on vport
704 * start, and as they lack an IGU mapping they need to store the
705 * addresses of previously registered SBs.
706 * Even if we were to change configuration flow, due to backward
707 * compatibility [with older PFs] we'd still need to store these.
709 struct qed_sb_info
*sbs_info
[PFVF_MAX_SBS_PER_VF
];
711 /* Determines whether VF utilizes doorbells via limited register
712 * bar or via the doorbell bar.
718 * @brief VF - Set Rx/Tx coalesce per VF's relative queue.
719 * Coalesce value '0' will omit the configuration.
722 * @param rx_coal - coalesce value in micro second for rx queue
723 * @param tx_coal - coalesce value in micro second for tx queue
724 * @param p_cid - queue cid
727 int qed_vf_pf_set_coalesce(struct qed_hwfn
*p_hwfn
,
729 u16 tx_coal
, struct qed_queue_cid
*p_cid
);
732 * @brief VF - Get coalesce per VF's relative queue.
735 * @param p_coal - coalesce value in micro second for VF queues.
736 * @param p_cid - queue cid
739 int qed_vf_pf_get_coalesce(struct qed_hwfn
*p_hwfn
,
740 u16
*p_coal
, struct qed_queue_cid
*p_cid
);
742 #ifdef CONFIG_QED_SRIOV
744 * @brief Read the VF bulletin and act on it if needed
747 * @param p_change - qed fills 1 iff bulletin board has changed, 0 otherwise.
749 * @return enum _qed_status
751 int qed_vf_read_bulletin(struct qed_hwfn
*p_hwfn
, u8
*p_change
);
754 * @brief Get link paramters for VF from qed
757 * @param params - the link params structure to be filled for the VF
759 void qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
760 struct qed_mcp_link_params
*params
);
763 * @brief Get link state for VF from qed
766 * @param link - the link state structure to be filled for the VF
768 void qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
769 struct qed_mcp_link_state
*link
);
772 * @brief Get link capabilities for VF from qed
775 * @param p_link_caps - the link capabilities structure to be filled for the VF
777 void qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
778 struct qed_mcp_link_capabilities
*p_link_caps
);
781 * @brief Get number of Rx queues allocated for VF by qed
784 * @param num_rxqs - allocated RX queues
786 void qed_vf_get_num_rxqs(struct qed_hwfn
*p_hwfn
, u8
*num_rxqs
);
789 * @brief Get number of Rx queues allocated for VF by qed
792 * @param num_txqs - allocated RX queues
794 void qed_vf_get_num_txqs(struct qed_hwfn
*p_hwfn
, u8
*num_txqs
);
797 * @brief Get number of available connections [both Rx and Tx] for VF
800 * @param num_cids - allocated number of connections
802 void qed_vf_get_num_cids(struct qed_hwfn
*p_hwfn
, u8
*num_cids
);
805 * @brief Get port mac address for VF
808 * @param port_mac - destination location for port mac
810 void qed_vf_get_port_mac(struct qed_hwfn
*p_hwfn
, u8
*port_mac
);
813 * @brief Get number of VLAN filters allocated for VF by qed
816 * @param num_rxqs - allocated VLAN filters
818 void qed_vf_get_num_vlan_filters(struct qed_hwfn
*p_hwfn
,
819 u8
*num_vlan_filters
);
822 * @brief Get number of MAC filters allocated for VF by qed
825 * @param num_rxqs - allocated MAC filters
827 void qed_vf_get_num_mac_filters(struct qed_hwfn
*p_hwfn
, u8
*num_mac_filters
);
830 * @brief Check if VF can set a MAC address
837 bool qed_vf_check_mac(struct qed_hwfn
*p_hwfn
, u8
*mac
);
840 * @brief Set firmware version information in dev_info from VFs acquire response tlv
848 void qed_vf_get_fw_version(struct qed_hwfn
*p_hwfn
,
849 u16
*fw_major
, u16
*fw_minor
,
850 u16
*fw_rev
, u16
*fw_eng
);
853 * @brief hw preparation for VF
854 * sends ACQUIRE message
860 int qed_vf_hw_prepare(struct qed_hwfn
*p_hwfn
);
863 * @brief VF - start the RX Queue by sending a message to the PF
865 * @param p_cid - Only relative fields are relevant
866 * @param bd_max_bytes - maximum number of bytes per bd
867 * @param bd_chain_phys_addr - physical address of bd chain
868 * @param cqe_pbl_addr - physical address of pbl
869 * @param cqe_pbl_size - pbl size
870 * @param pp_prod - pointer to the producer to be
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 * @brief VF - start the TX queue by sending a message to the
887 * @param tx_queue_id - zero based within the VF
888 * @param sb - status block for this queue
889 * @param sb_index - index within the status block
890 * @param bd_chain_phys_addr - physical address of tx chain
891 * @param pp_doorbell - pointer to address to which to
892 * write the doorbell too..
897 qed_vf_pf_txq_start(struct qed_hwfn
*p_hwfn
,
898 struct qed_queue_cid
*p_cid
,
900 u16 pbl_size
, void __iomem
**pp_doorbell
);
903 * @brief VF - stop the RX queue by sending a message to the PF
907 * @param cqe_completion
911 int qed_vf_pf_rxq_stop(struct qed_hwfn
*p_hwfn
,
912 struct qed_queue_cid
*p_cid
, bool cqe_completion
);
915 * @brief VF - stop the TX queue by sending a message to the PF
922 int qed_vf_pf_txq_stop(struct qed_hwfn
*p_hwfn
, struct qed_queue_cid
*p_cid
);
925 * @brief VF - send a vport update command
932 int qed_vf_pf_vport_update(struct qed_hwfn
*p_hwfn
,
933 struct qed_sp_vport_update_params
*p_params
);
937 * @brief VF - send a close message to PF
941 * @return enum _qed_status
943 int qed_vf_pf_reset(struct qed_hwfn
*p_hwfn
);
946 * @brief VF - free vf`s memories
950 * @return enum _qed_status
952 int qed_vf_pf_release(struct qed_hwfn
*p_hwfn
);
955 * @brief qed_vf_get_igu_sb_id - Get the IGU SB ID for a given
956 * sb_id. For VFs igu sbs don't have to be contiguous
963 u16
qed_vf_get_igu_sb_id(struct qed_hwfn
*p_hwfn
, u16 sb_id
);
966 * @brief Stores [or removes] a configured sb_info.
969 * @param sb_id - zero-based SB index [for fastpath]
970 * @param sb_info - may be NULL [during removal].
972 void qed_vf_set_sb_info(struct qed_hwfn
*p_hwfn
,
973 u16 sb_id
, struct qed_sb_info
*p_sb
);
976 * @brief qed_vf_pf_vport_start - perform vport start for VF.
981 * @param inner_vlan_removal
983 * @param max_buffers_per_cqe,
984 * @param only_untagged - default behavior regarding vlan acceptance
986 * @return enum _qed_status
988 int qed_vf_pf_vport_start(struct qed_hwfn
*p_hwfn
,
991 u8 inner_vlan_removal
,
992 enum qed_tpa_mode tpa_mode
,
993 u8 max_buffers_per_cqe
, u8 only_untagged
);
996 * @brief qed_vf_pf_vport_stop - stop the VF's vport
1000 * @return enum _qed_status
1002 int qed_vf_pf_vport_stop(struct qed_hwfn
*p_hwfn
);
1004 int qed_vf_pf_filter_ucast(struct qed_hwfn
*p_hwfn
,
1005 struct qed_filter_ucast
*p_param
);
1007 void qed_vf_pf_filter_mcast(struct qed_hwfn
*p_hwfn
,
1008 struct qed_filter_mcast
*p_filter_cmd
);
1011 * @brief qed_vf_pf_int_cleanup - clean the SB of the VF
1015 * @return enum _qed_status
1017 int qed_vf_pf_int_cleanup(struct qed_hwfn
*p_hwfn
);
1020 * @brief - return the link params in a given bulletin board
1023 * @param p_params - pointer to a struct to fill with link params
1026 void __qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1027 struct qed_mcp_link_params
*p_params
,
1028 struct qed_bulletin_content
*p_bulletin
);
1031 * @brief - return the link state in a given bulletin board
1034 * @param p_link - pointer to a struct to fill with link state
1037 void __qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1038 struct qed_mcp_link_state
*p_link
,
1039 struct qed_bulletin_content
*p_bulletin
);
1042 * @brief - return the link capabilities in a given bulletin board
1045 * @param p_link - pointer to a struct to fill with link capabilities
1048 void __qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1049 struct qed_mcp_link_capabilities
*p_link_caps
,
1050 struct qed_bulletin_content
*p_bulletin
);
1052 void qed_iov_vf_task(struct work_struct
*work
);
1053 void qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info
*p_tun
);
1054 int qed_vf_pf_tunnel_param_update(struct qed_hwfn
*p_hwfn
,
1055 struct qed_tunnel_info
*p_tunn
);
1057 u32
qed_vf_hw_bar_size(struct qed_hwfn
*p_hwfn
, enum BAR_ID bar_id
);
1059 * @brief - Ask PF to update the MAC address in it's bulletin board
1061 * @param p_mac - mac address to be updated in bulletin board
1063 int qed_vf_pf_bulletin_update_mac(struct qed_hwfn
*p_hwfn
, u8
*p_mac
);
1066 static inline void qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1067 struct qed_mcp_link_params
*params
)
1071 static inline void qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1072 struct qed_mcp_link_state
*link
)
1077 qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1078 struct qed_mcp_link_capabilities
*p_link_caps
)
1082 static inline void qed_vf_get_num_rxqs(struct qed_hwfn
*p_hwfn
, u8
*num_rxqs
)
1086 static inline void qed_vf_get_num_txqs(struct qed_hwfn
*p_hwfn
, u8
*num_txqs
)
1090 static inline void qed_vf_get_num_cids(struct qed_hwfn
*p_hwfn
, u8
*num_cids
)
1094 static inline void qed_vf_get_port_mac(struct qed_hwfn
*p_hwfn
, u8
*port_mac
)
1098 static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn
*p_hwfn
,
1099 u8
*num_vlan_filters
)
1103 static inline void qed_vf_get_num_mac_filters(struct qed_hwfn
*p_hwfn
,
1104 u8
*num_mac_filters
)
1108 static inline bool qed_vf_check_mac(struct qed_hwfn
*p_hwfn
, u8
*mac
)
1113 static inline void qed_vf_get_fw_version(struct qed_hwfn
*p_hwfn
,
1114 u16
*fw_major
, u16
*fw_minor
,
1115 u16
*fw_rev
, u16
*fw_eng
)
1119 static inline int qed_vf_hw_prepare(struct qed_hwfn
*p_hwfn
)
1124 static inline int qed_vf_pf_rxq_start(struct qed_hwfn
*p_hwfn
,
1125 struct qed_queue_cid
*p_cid
,
1127 dma_addr_t bd_chain_phys_adr
,
1128 dma_addr_t cqe_pbl_addr
,
1129 u16 cqe_pbl_size
, void __iomem
**pp_prod
)
1134 static inline int qed_vf_pf_txq_start(struct qed_hwfn
*p_hwfn
,
1135 struct qed_queue_cid
*p_cid
,
1136 dma_addr_t pbl_addr
,
1137 u16 pbl_size
, void __iomem
**pp_doorbell
)
1142 static inline int qed_vf_pf_rxq_stop(struct qed_hwfn
*p_hwfn
,
1143 struct qed_queue_cid
*p_cid
,
1144 bool cqe_completion
)
1149 static inline int qed_vf_pf_txq_stop(struct qed_hwfn
*p_hwfn
,
1150 struct qed_queue_cid
*p_cid
)
1156 qed_vf_pf_vport_update(struct qed_hwfn
*p_hwfn
,
1157 struct qed_sp_vport_update_params
*p_params
)
1162 static inline int qed_vf_pf_reset(struct qed_hwfn
*p_hwfn
)
1167 static inline int qed_vf_pf_release(struct qed_hwfn
*p_hwfn
)
1172 static inline u16
qed_vf_get_igu_sb_id(struct qed_hwfn
*p_hwfn
, u16 sb_id
)
1177 static inline void qed_vf_set_sb_info(struct qed_hwfn
*p_hwfn
, u16 sb_id
,
1178 struct qed_sb_info
*p_sb
)
1182 static inline int qed_vf_pf_vport_start(struct qed_hwfn
*p_hwfn
,
1185 u8 inner_vlan_removal
,
1186 enum qed_tpa_mode tpa_mode
,
1187 u8 max_buffers_per_cqe
,
1193 static inline int qed_vf_pf_vport_stop(struct qed_hwfn
*p_hwfn
)
1198 static inline int qed_vf_pf_filter_ucast(struct qed_hwfn
*p_hwfn
,
1199 struct qed_filter_ucast
*p_param
)
1204 static inline void qed_vf_pf_filter_mcast(struct qed_hwfn
*p_hwfn
,
1205 struct qed_filter_mcast
*p_filter_cmd
)
1209 static inline int qed_vf_pf_int_cleanup(struct qed_hwfn
*p_hwfn
)
1214 static inline void __qed_vf_get_link_params(struct qed_hwfn
*p_hwfn
,
1215 struct qed_mcp_link_params
1217 struct qed_bulletin_content
1222 static inline void __qed_vf_get_link_state(struct qed_hwfn
*p_hwfn
,
1223 struct qed_mcp_link_state
*p_link
,
1224 struct qed_bulletin_content
1230 __qed_vf_get_link_caps(struct qed_hwfn
*p_hwfn
,
1231 struct qed_mcp_link_capabilities
*p_link_caps
,
1232 struct qed_bulletin_content
*p_bulletin
)
1236 static inline void qed_iov_vf_task(struct work_struct
*work
)
1241 qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info
*p_tun
)
1245 static inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn
*p_hwfn
,
1246 struct qed_tunnel_info
*p_tunn
)
1251 static inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn
*p_hwfn
,
1258 qed_vf_hw_bar_size(struct qed_hwfn
*p_hwfn
,