ice: Initialize and register platform device to provide RDMA
Subsystems (2)
Tony Nguyen
maintainerPATCH 1/2 ice: Initialize and register platform device to provide RDMA
The RDMA block does not advertise on the PCI bus or any other bus. Thus the ice driver needs to provide access to the RDMA hardware block via a virtual bus; utilize the platform bus to provide this access.
This patch initializes the driver to support RDMA as well as creates and registers a platform device for the RDMA driver to register to. At this point the driver is fully initialized to register a platform driver, however, can not yet register as the ops have not been implemented.
We refer to the interaction of this platform device as Inter-Driver Communication (IDC); where the platform device is referred to as the peer device and the platform driver is referred to as the peer driver.
--- drivers/net/ethernet/intel/ice/Makefile | 1 + drivers/net/ethernet/intel/ice/ice.h | 13 + .../net/ethernet/intel/ice/ice_adminq_cmd.h | 1 + drivers/net/ethernet/intel/ice/ice_common.c | 5 + drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 31 ++ drivers/net/ethernet/intel/ice/ice_dcb_lib.h | 2 + .../net/ethernet/intel/ice/ice_hw_autogen.h | 1 + drivers/net/ethernet/intel/ice/ice_idc.c | 427 ++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_idc.h | 360 +++++++++++++++ drivers/net/ethernet/intel/ice/ice_idc_int.h | 67 +++ drivers/net/ethernet/intel/ice/ice_main.c | 42 ++ drivers/net/ethernet/intel/ice/ice_type.h | 1 + 12 files changed, 951 insertions(+) create mode 100644 drivers/net/ethernet/intel/ice/ice_idc.c create mode 100644 drivers/net/ethernet/intel/ice/ice_idc.h create mode 100644 drivers/net/ethernet/intel/ice/ice_idc_int.h
drivers/net/ethernet/intel/ice/Makefile +1 -0
@@ -15,6 +15,7 @@ ice-y := ice_main.o \ ice_sched.o \ ice_lib.o \ ice_txrx.o \ + ice_idc.o \ ice_ethtool.o ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_lib.o
drivers/net/ethernet/intel/ice/ice.h +13 -0
@@ -43,6 +43,7 @@#include "ice_switch.h" #include "ice_common.h" #include "ice_sched.h" +#include "ice_idc_int.h" #include "ice_virtchnl_pf.h" #include "ice_sriov.h"
@@ -89,6 +90,7 @@ extern const char ice_drv_ver[];#define ICE_MAX_SMALL_RSS_QS 8#define ICE_RES_VALID_BIT 0x8000#define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1) +#define ICE_RES_RDMA_VEC_ID (ICE_RES_MISC_VEC_ID - 1)#define ICE_INVAL_Q_INDEX 0xffff#define ICE_INVAL_VFID 256#define ICE_MAX_VF_COUNT 256
@@ -343,6 +345,7 @@ struct ice_q_vector {enum ice_pf_flags {ICE_FLAG_MSIX_ENA ,ICE_FLAG_FLTR_SYNC , +ICE_FLAG_IWARP_ENA ,ICE_FLAG_RSS_ENA ,ICE_FLAG_SRIOV_ENA ,ICE_FLAG_SRIOV_CAPABLE ,
@@ -385,6 +388,9 @@ struct ice_pf {struct mutex avail_q_mutex;/* protects access to avail_[rx|tx]qs */ struct mutex sw_mutex;/* lock for protecting VSI alloc flow */ u32 msg_enable; +/* Total number of MSIX vectors reserved for base driver */ +u32 num_rdma_msix; +u32 rdma_base_vector;u32 hw_csum_rx_error;u32 oicr_idx;/* Other interrupt cause MSIX vector index */ u32 num_avail_sw_msix;/* remaining MSIX SW vectors left unclaimed */
@@ -411,6 +417,7 @@ struct ice_pf {unsigned long tx_timeout_last_recovery;u32 tx_timeout_recovery_level;char int_name[ICE_INT_NAME_STR_LEN ]; +struct ice_peer_dev_int **peers;u32 sw_int_count; };
@@ -418,6 +425,8 @@ struct ice_netdev_priv {struct ice_vsi *vsi; }; +extern struct ida ice_peer_index_ida; +/** * ice_irq_dynamic_ena - Enable default interrupt generation settings * @hw: pointer to HW struct
@@ -510,6 +519,10 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);int ice_get_rss (struct ice_vsi *vsi,u8 *seed,u8 *lut,u16 lut_size);void ice_fill_rss_lut (u8 *lut,u16 rss_table_size,u16 rss_size);void ice_print_link_msg (struct ice_vsi *vsi,bool isup); +int ice_init_peer_devices (struct ice_pf *pf); +int +ice_for_each_peer (struct ice_pf *pf,void *data, +int (*fn)(struct ice_peer_dev_int *,void *));#ifdef CONFIG_DCB int ice_pf_ena_all_vsi (struct ice_pf *pf,bool locked);void ice_pf_dis_all_vsi (struct ice_pf *pf,bool locked);
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 -0
@@ -96,6 +96,7 @@ struct ice_aqc_list_caps_elem {#define ICE_AQC_CAPS_TXQS 0x0042#define ICE_AQC_CAPS_MSIX 0x0043#define ICE_AQC_CAPS_MAX_MTU 0x0047 +#define ICE_AQC_CAPS_IWARP 0x0051u8 major_ver;u8 minor_ver;
drivers/net/ethernet/intel/ice/ice_common.c +5 -0
@@ -1613,6 +1613,11 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,"%s: MSIX first vector index = %d\n" , prefix, caps->msix_vector_first_id);break ; +case ICE_AQC_CAPS_IWARP : + caps->iwarp = (number ==1 ); +ice_debug (hw,ICE_DBG_INIT , +"%s: iWARP = %d\n" , prefix, caps->iwarp); +break ;case ICE_AQC_CAPS_MAX_MTU : caps->max_mtu = number; ice_debug(hw, ICE_DBG_INIT, "%s: max MTU = %d\n",
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +31 -0
@@ -501,6 +501,37 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,return 0 ; } +/** +* ice_setup_dcb_qos_info - Setup DCB QoS information +* @pf: ptr to ice_pf +* @qos_info: QoS param instance +*/ +void ice_setup_dcb_qos_info (struct ice_pf *pf,struct ice_qos_params *qos_info) +{ +struct ice_dcbx_cfg *dcbx_cfg; +u32 up2tc; +int i; + + dcbx_cfg = &pf->hw.port_info->local_dcbx_cfg; + up2tc =rd32 (&pf->hw,PRTDCB_TUP2TC ); + qos_info->num_apps = dcbx_cfg->numapps; + + qos_info->num_tc =ice_dcb_get_num_tc (dcbx_cfg); + +for (i =0 ; i <ICE_IDC_MAX_USER_PRIORITY ; i++) + qos_info->up2tc[i] = (up2tc >> (i *3 )) &0x7 ; + +for (i =0 ; i <IEEE_8021QAZ_MAX_TCS ; i++) + qos_info->tc_info[i].rel_bw = + dcbx_cfg->etscfg.tcbwtable[i]; + +for (i =0 ; i < qos_info->num_apps; i++) { + qos_info->apps[i].priority = dcbx_cfg->app[i].priority; + qos_info->apps[i].prot_id = dcbx_cfg->app[i].prot_id; + qos_info->apps[i].selector = dcbx_cfg->app[i].selector; + } +} +/** * ice_dcb_need_recfg - Check if DCB needs reconfig * @pf: board private structure
drivers/net/ethernet/intel/ice/ice_dcb_lib.h +2 -0
@@ -19,6 +19,7 @@ void ice_update_dcb_stats(struct ice_pf *pf);int ice_tx_prepare_vlan_flags_dcb (struct ice_ring *tx_ring,struct ice_tx_buf *first); +void ice_setup_dcb_qos_info (struct ice_pf *pf,struct ice_qos_params *qos_info);void ice_dcb_process_lldp_set_mib_change (struct ice_pf *pf,struct ice_rq_event_info *event);
@@ -56,6 +57,7 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_ring __always_unused *tx_ring,#define ice_update_dcb_stats (pf) do {} while (0)#define ice_vsi_cfg_dcb_rings (vsi) do {} while (0) +#define ice_setup_dcb_qos_info (pf, qos_info) do {} while (0)#define ice_dcb_process_lldp_set_mib_change (pf, event) do {} while (0)#define ice_set_cgd_num (tlan_ctx, ring) do {} while (0)#endif /* CONFIG_DCB */
drivers/net/ethernet/intel/ice/ice_hw_autogen.h +1 -0
@@ -55,6 +55,7 @@#define PRTDCB_GENS 0x00083020#define PRTDCB_GENS_DCBX_STATUS_S 0#define PRTDCB_GENS_DCBX_STATUS_M ICE_M(0x7, 0) +#define PRTDCB_TUP2TC 0x001D26C0#define GLFLXP_RXDID_FLAGS (_i, _j) (0x0045D000 + ((_i) * 4 + (_j) * 256))#define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_S 0#define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_M ICE_M(0x3F, 0)
drivers/net/ethernet/intel/ice/ice_idc.c new file +427 -0
427 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_idc.h new file +360 -0
360 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_idc_int.h new file +67 -0
67 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_main.c +42 -0
100 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_type.h +1 -0
@@ -161,6 +161,7 @@ struct ice_hw_common_caps {u8 rss_table_entry_width;/* RSS Entry width in bits */ u8 dcb; +u8 iwarp; };/* Function specific capabilities */
Signature · 1 line
2.20.1
Tony Nguyen
maintainerPATCH 2/2 ice: Implement peer communications
Set and implement operations for the peer device and peer driver to communicate with each other, via ice_ops and ice_peer_ops, to request resources and manage event notification.
--- drivers/net/ethernet/intel/ice/ice.h | 2 + .../net/ethernet/intel/ice/ice_adminq_cmd.h | 32 + drivers/net/ethernet/intel/ice/ice_common.c | 189 ++++ drivers/net/ethernet/intel/ice/ice_common.h | 9 + drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 33 + drivers/net/ethernet/intel/ice/ice_idc.c | 927 ++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_idc.h | 17 + drivers/net/ethernet/intel/ice/ice_idc_int.h | 15 + drivers/net/ethernet/intel/ice/ice_lib.c | 35 +- drivers/net/ethernet/intel/ice/ice_lib.h | 2 + drivers/net/ethernet/intel/ice/ice_main.c | 52 +- drivers/net/ethernet/intel/ice/ice_sched.c | 69 +- drivers/net/ethernet/intel/ice/ice_switch.c | 27 + drivers/net/ethernet/intel/ice/ice_switch.h | 4 + drivers/net/ethernet/intel/ice/ice_type.h | 3 + .../net/ethernet/intel/ice/ice_virtchnl_pf.c | 25 - 16 files changed, 1409 insertions(+), 32 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +2 -0
@@ -307,6 +307,7 @@ struct ice_vsi {u16 num_rxq;/* Used Rx queues */ u16 num_rx_desc;u16 num_tx_desc; +u16 qset_handle[ICE_MAX_TRAFFIC_CLASS ];struct ice_tc_cfg tc_cfg;struct bpf_prog *xdp_prog;struct ice_ring **xdp_rings;/* XDP ring array */
@@ -518,6 +519,7 @@ int ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,int ice_set_rss (struct ice_vsi *vsi,u8 *seed,u8 *lut,u16 lut_size);int ice_get_rss (struct ice_vsi *vsi,u8 *seed,u8 *lut,u16 lut_size);void ice_fill_rss_lut (u8 *lut,u16 rss_table_size,u16 rss_size); +int ice_schedule_reset (struct ice_pf *pf,enum ice_reset_req reset);void ice_print_link_msg (struct ice_vsi *vsi,bool isup);int ice_init_peer_devices (struct ice_pf *pf);int
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +32 -0
@@ -1441,6 +1441,36 @@ struct ice_aqc_dis_txq {struct ice_aqc_dis_txq_item qgrps[1 ]; }; +/* Add Tx RDMA Queue Set (indirect 0x0C33) */ +struct ice_aqc_add_rdma_qset { +u8 num_qset_grps; +u8 reserved[7 ]; +__le32 addr_high; +__le32 addr_low; +}; + +/* This is the descriptor of each qset entry for the Add Tx RDMA Queue Set +* command (0x0C33). Only used within struct ice_aqc_add_rdma_qset. +*/ +struct ice_aqc_add_tx_rdma_qset_entry { +__le16 tx_qset_id; +u8 rsvd[2 ]; +__le32 qset_teid; +struct ice_aqc_txsched_elem info; +}; + +/* The format of the command buffer for Add Tx RDMA Queue Set(0x0C33) +* is an array of the following structs. Please note that the length of +* each struct ice_aqc_add_rdma_qset is variable due to the variable +* number of queues in each group! +*/ +struct ice_aqc_add_rdma_qset_data { +__le32 parent_teid; +__le16 num_qsets; +u8 rsvd[2 ]; +struct ice_aqc_add_tx_rdma_qset_entry rdma_qsets[1 ]; +}; +/* Configure Firmware Logging Command (indirect 0xFF09) * Logging Information Read Response (indirect 0xFF10) * Note: The 0xFF10 command has no input parameters.
@@ -1576,6 +1606,7 @@ struct ice_aq_desc {struct ice_aqc_get_set_rss_key get_set_rss_key;struct ice_aqc_add_txqs add_txqs;struct ice_aqc_dis_txqs dis_txqs; +struct ice_aqc_add_rdma_qset add_rdma_qset;struct ice_aqc_add_get_update_free_vsi vsi_cmd;struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;struct ice_aqc_fw_logging fw_logging;
@@ -1697,6 +1728,7 @@ enum ice_adminq_opc {/* Tx queue handling commands/events */ ice_aqc_opc_add_txqs =0x0C30 , ice_aqc_opc_dis_txqs =0x0C31 , + ice_aqc_opc_add_rdma_qset =0x0C33 ,/* debug commands */ ice_aqc_opc_fw_logging = 0xFF09,
drivers/net/ethernet/intel/ice/ice_common.c +189 -0
201 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_common.h +9 -0
@@ -108,6 +108,15 @@ ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode, struct ice_sq_cd *cd);enum ice_status +ice_cfg_vsi_rdma (struct ice_port_info *pi,u16 vsi_handle,u8 tc_bitmap, +u16 *max_rdmaqs); +enum ice_status +ice_ena_vsi_rdma_qset (struct ice_port_info *pi,u16 vsi_handle,u8 tc, +u16 *rdma_qset,u16 num_qsets,u32 *qset_teid); +enum ice_status +ice_dis_vsi_rdma_qset (struct ice_port_info *pi,u16 count,u32 *qset_teid, +u16 *q_id); +enum ice_status ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues, u16 *q_handle, u16 *q_ids, u32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +33 -0
@@ -106,6 +106,7 @@ void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi)static void ice_pf_dcb_recfg (struct ice_pf *pf) {struct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->local_dcbx_cfg; +struct ice_event *event;u8 tc_map =0 ;int v, ret;
@@ -129,6 +130,35 @@ static void ice_pf_dcb_recfg(struct ice_pf *pf)ice_vsi_map_rings_to_vectors (pf->vsi[v]); } + event =devm_kzalloc (&pf->pdev->dev,sizeof (*event),GFP_KERNEL ); +if (!event) +return ; + +set_bit (ICE_EVENT_TC_CHANGE , event->type); + event->reporter =NULL ; +ice_setup_dcb_qos_info (pf, &event->info.port_qos); +ice_for_each_peer (pf, event, ice_peer_check_for_reg); +devm_kfree (&pf->pdev->dev, event); +} + +/** +* ice_peer_prep_tc_change - Pre-notify RDMA Peer in blocking call of TC change +* @peer_dev_int: ptr to peer device internal struct +* @data: ptr to opaque data +*/ +static int +ice_peer_prep_tc_change (struct ice_peer_dev_int *peer_dev_int, +void __always_unused *data) +{ +struct ice_peer_dev *peer_dev = &peer_dev_int->peer_dev; + +if (!ice_validate_peer_dev (peer_dev)) +return 0 ; + +if (peer_dev->peer_ops && peer_dev->peer_ops->prep_tc_change) + peer_dev->peer_ops->prep_tc_change (peer_dev); + +return 0 ; }/**
@@ -160,6 +190,9 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)return ret; } +/* Notify capable peers about impending change to TCs */ +ice_for_each_peer (pf,NULL , ice_peer_prep_tc_change); +/* Store old config in case FW config fails */ old_cfg =devm_kzalloc (&pf->pdev->dev,sizeof (*old_cfg),GFP_KERNEL );memcpy (old_cfg, curr_cfg,sizeof (*old_cfg));
drivers/net/ethernet/intel/ice/ice_idc.c +927 -0
999 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_idc.h +17 -0
@@ -357,4 +357,21 @@ static inline struct ice_peer_dev *dev_to_ice_peer(struct device *_dev) platform_dev = container_of(_dev, struct platform_device, dev); return container_of(platform_dev, struct ice_peer_dev, platform_dev); } + +/* structure representing peer driver +* Peer driver to initialize those function ptrs and +* it will be invoked by ICE as part of driver_registration +* via bus infrastructure +*/ +struct ice_peer_drv { +u16 driver_id; +#define ICE_PEER_LAN_DRIVER 0 +#define ICE_PEER_RDMA_DRIVER 4 +#define ICE_PEER_ADK_DRIVER 5 + +struct ice_ver_info ver; +const char *name; + +}; +#endif /* _ICE_IDC_H_*/
drivers/net/ethernet/intel/ice/ice_idc_int.h +15 -0
@@ -6,8 +6,16 @@#include "ice_idc.h" +int ice_close_peer_for_reset (struct ice_peer_dev_int *peer_dev_int,void *data);int ice_unroll_peer (struct ice_peer_dev_int *peer_dev_int,void *data);int ice_unreg_peer_device (struct ice_peer_dev_int *peer_dev_int,void *data); +int ice_peer_close (struct ice_peer_dev_int *peer_dev_int,void *data); +int ice_peer_check_for_reg (struct ice_peer_dev_int *peer_dev_int,void *data); +int +ice_finish_init_peer_device (struct ice_peer_dev_int *peer_dev_int,void *data); +#ifdef CONFIG_DCB +bool ice_validate_peer_dev (struct ice_peer_dev *peer); +#endif /* CONFIG_DCB */ enum ice_peer_dev_state {ICE_PEER_DEV_STATE_INIT ,
@@ -64,4 +72,11 @@ struct ice_peer_dev_int {enum ice_close_reason rst_type; }; + +static inline struct +ice_peer_dev_int *peer_to_ice_dev_int (struct ice_peer_dev *peer_dev) +{ + return container_of(peer_dev, struct ice_peer_dev_int, peer_dev); +} +#endif /* !_ICE_IDC_INT_H_ */
drivers/net/ethernet/intel/ice/ice_lib.c +34 -1
@@ -1519,6 +1519,31 @@ int ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list,return 0 ; } +/** +* ice_pf_state_is_nominal - checks the PF for nominal state +* @pf: pointer to PF to check +* +* Check the PF's state for a collection of bits that would indicate +* the PF is in a state that would inhibit normal operation for +* driver functionality. +* +* Returns true if PF is in a nominal state. +* Returns false otherwise +*/ +bool ice_pf_state_is_nominal (struct ice_pf *pf) +{ + DECLARE_BITMAP(check_bits, __ICE_STATE_NBITS) = { 0 }; + +if (!pf) +return false; + +bitmap_set (check_bits,0 , __ICE_STATE_NOMINAL_CHECK_BITS); +if (bitmap_intersects (pf->state, check_bits, __ICE_STATE_NBITS)) +return false; + +return true; +} +/** * ice_update_eth_stats - Update VSI-specific ethernet statistics counters * @vsi: the VSI to be updated
@@ -2783,9 +2808,17 @@ void ice_vsi_free_rx_rings(struct ice_vsi *vsi)*/ void ice_vsi_close (struct ice_vsi *vsi) { +enum ice_close_reason reason =ICE_REASON_INTERFACE_DOWN ; +struct device *dev = &vsi->back->pdev->dev; +int ret =0 ; + +if (vsi->type ==ICE_VSI_PF ) + ret =ice_for_each_peer (vsi->back, &reason, ice_peer_close); + +if (ret) +dev_dbg (dev,"Peer device did not implement close function\n" );if (!test_and_set_bit (__ICE_DOWN, vsi->state))ice_down (vsi); -ice_vsi_free_irq (vsi);ice_vsi_free_tx_rings (vsi);ice_vsi_free_rx_rings (vsi);
drivers/net/ethernet/intel/ice/ice_lib.h +2 -0
@@ -11,6 +11,8 @@ int ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list,void ice_free_fltr_list (struct device *dev,struct list_head *h); +bool ice_pf_state_is_nominal (struct ice_pf *pf); +void ice_update_eth_stats (struct ice_vsi *vsi);int ice_vsi_cfg_rxqs (struct ice_vsi *vsi);
drivers/net/ethernet/intel/ice/ice_main.c +51 -1
95 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_sched.c +64 -5
102 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_switch.c +27 -0
@@ -346,6 +346,10 @@ static void ice_clear_vsi_q_ctx(struct ice_hw *hw, u16 vsi_handle)devm_kfree (ice_hw_to_dev (hw), vsi->lan_q_ctx[i]); vsi->lan_q_ctx[i] =NULL ; } +if (vsi->rdma_q_ctx[i]) { +devm_kfree (ice_hw_to_dev (hw), vsi->rdma_q_ctx[i]); + vsi->rdma_q_ctx[i] =NULL ; + } } }
@@ -467,6 +471,29 @@ ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,return ice_aq_update_vsi (hw, vsi_ctx, cd); } +/** +* ice_cfg_iwarp_fltr - enable/disable iWARP filtering on VSI +* @hw: pointer to HW struct +* @vsi_handle: VSI SW index +* @enable: boolean for enable/disable +*/ +enum ice_status +ice_cfg_iwarp_fltr (struct ice_hw *hw,u16 vsi_handle,bool enable) +{ +struct ice_vsi_ctx *ctx; + + ctx =ice_get_vsi_ctx (hw, vsi_handle); +if (!ctx) +return ICE_ERR_DOES_NOT_EXIST ; + +if (enable) + ctx->info.q_opt_flags |=ICE_AQ_VSI_Q_OPT_PE_FLTR_EN ; +else + ctx->info.q_opt_flags &= ~ICE_AQ_VSI_Q_OPT_PE_FLTR_EN ; + +return ice_update_vsi (hw, vsi_handle, ctx,NULL ); +} +/** * ice_aq_alloc_free_vsi_list * @hw: pointer to the HW struct
drivers/net/ethernet/intel/ice/ice_switch.h +4 -0
@@ -31,6 +31,8 @@ struct ice_vsi_ctx {u8 vf_num;u16 num_lan_q_entries[ICE_MAX_TRAFFIC_CLASS ];struct ice_q_ctx *lan_q_ctx[ICE_MAX_TRAFFIC_CLASS ]; +u16 num_rdma_q_entries[ICE_MAX_TRAFFIC_CLASS ]; +struct ice_q_ctx *rdma_q_ctx[ICE_MAX_TRAFFIC_CLASS ]; };enum ice_sw_fwd_act_type {
@@ -225,6 +227,8 @@ void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle);enum ice_status ice_add_vlan (struct ice_hw *hw,struct list_head *m_list);enum ice_status ice_remove_vlan (struct ice_hw *hw,struct list_head *v_list); +enum ice_status +ice_cfg_iwarp_fltr (struct ice_hw *hw,u16 vsi_handle,bool enable);/* Promisc/defport setup for VSIs */ enum ice_status
drivers/net/ethernet/intel/ice/ice_type.h +3 -0
@@ -31,6 +31,7 @@ static inline bool ice_is_tc_ena(u8 bitmap, u8 tc)#define ICE_DBG_LAN BIT_ULL(8)#define ICE_DBG_SW BIT_ULL(13)#define ICE_DBG_SCHED BIT_ULL(14) +#define ICE_DBG_RDMA BIT_ULL(15)#define ICE_DBG_RES BIT_ULL(17)#define ICE_DBG_AQ_MSG BIT_ULL(24)#define ICE_DBG_AQ_CMD BIT_ULL(27)
@@ -242,6 +243,7 @@ struct ice_sched_node {u8 tc_num;u8 owner;#define ICE_SCHED_NODE_OWNER_LAN 0 +#define ICE_SCHED_NODE_OWNER_RDMA 2 };/* Access Macros for Tx Sched Elements data */
@@ -267,6 +269,7 @@ struct ice_sched_vsi_info {struct ice_sched_node *ag_node[ICE_MAX_TRAFFIC_CLASS ];struct list_head list_entry;u16 max_lanq[ICE_MAX_TRAFFIC_CLASS ]; +u16 max_rdmaq[ICE_MAX_TRAFFIC_CLASS ]; };/* driver defines the policy */
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +0 -25
@@ -1310,31 +1310,6 @@ static int ice_alloc_vfs(struct ice_pf *pf, u16 num_alloc_vfs)return ret; } -/** -* ice_pf_state_is_nominal - checks the PF for nominal state -* @pf: pointer to PF to check -* -* Check the PF's state for a collection of bits that would indicate -* the PF is in a state that would inhibit normal operation for -* driver functionality. -* -* Returns true if PF is in a nominal state. -* Returns false otherwise -*/ -static bool ice_pf_state_is_nominal (struct ice_pf *pf) -{ - DECLARE_BITMAP(check_bits, __ICE_STATE_NBITS) = { 0 }; - -if (!pf) -return false; - -bitmap_set (check_bits,0 , __ICE_STATE_NOMINAL_CHECK_BITS); -if (bitmap_intersects (pf->state, check_bits, __ICE_STATE_NBITS)) -return false; - -return true; -} -/** * ice_pci_sriov_ena - Enable or change number of VFs * @pf: pointer to the PF structure
Signature · 1 line
2.20.1