Lines Matching +full:rx +full:- +full:queues +full:- +full:to +full:- +full:use
1 /* SPDX-License-Identifier: GPL-2.0-only */
27 #define GETMAXVAL(num_bits) GENMASK((num_bits) - 1, 0)
33 #define IDPF_NUM_DFLT_MBX_Q 2 /* includes both TX and RX */
35 #define IDPF_DFLT_MBX_ID -1
36 /* maximum number of times to try before resetting mailbox */
39 ((IDPF_CTLQ_MAX_BUF_LEN - (struct_sz)) / (chunk_sz))
68 * enum idpf_state - State machine to handle bring up
73 * @__IDPF_STATE_LAST: Must be last, used to determine size
84 * enum idpf_flags - Hard reset causes.
102 * enum idpf_cap_field - Offsets into capabilities struct for specific caps
116 IDPF_BASE_CAPS = -1,
132 * enum idpf_vport_state - Current vport state
144 * struct idpf_netdev_priv - Struct to store vport back pointer
151 * @stats_lock: Lock to protect stats update
164 * struct idpf_reset_reg - Reset register offsets/masks
174 * struct idpf_vport_max_q - Queue limits
175 * @max_rxq: Maximum number of RX queues supported
176 * @max_txq: Maixmum number of TX queues supported
177 * @max_bufq: In splitq, maximum number of buffer queues supported
178 * @max_complq: In splitq, maximum number of completion queues supported
188 * struct idpf_reg_ops - Device specific register operation function pointers
193 * @trigger_reset: Trigger a reset to occur
205 * struct idpf_dev_ops - Device specific operations
212 /* These macros allow us to generate an enum and a matching char * array of
215 * statement and instead only used to define the enum and array.
278 * enum idpf_vport_reset_cause - Vport soft reset causes
292 * enum idpf_vport_flags - Vport flags
293 * @IDPF_VPORT_DEL_QUEUES: To send delete queues message
318 * struct idpf_vport - Handle for netdevices and queue resources
319 * @num_txq: Number of allocated TX queues
320 * @num_complq: Number of allocated completion queues
327 * @txqs: Used only in hotpath to get to the right queue very fast
329 * @num_rxq: Number of allocated RX queues
330 * @num_bufq: Number of allocated buffer queues
331 * @rxq_desc_count: RX queue descriptor count. *MUST* have enough descriptors
332 * to complete all buffer descriptors for all buffer queues in
334 * @num_bufqs_per_qgrp: Buffer queues per RX queue in a given grouping
337 * @num_rxq_grp: Number of RX queues in a group
338 * @rxq_grps: Total number of RX groups. Number of groups * number of RX per
339 * group will yield total number of RX queues.
341 * @rx_ptype_lkup: Lookup table for ptypes on RX
342 * @adapter: back pointer to associated adapter
349 * @default_vport: Use this vport if one isn't specified
350 * @base_rxd: True if the driver should use base descriptors instead of flex
355 * @default_mac_addr: device will give a default MAC to use
356 * @rx_itr_profile: RX profiles for Dynamic Interrupt Moderation
365 * @vc_buf_lock: Lock to protect virtchnl buffer
435 * struct idpf_rss_data - Associated RSS data
440 * @cached_lut: Used to restore previously init RSS lut
451 * struct idpf_vport_user_config_data - User defined configuration values for
454 * @num_req_tx_qs: Number of user requested TX queues through ethtool
455 * @num_req_rx_qs: Number of user requested RX queues through ethtool
458 * @num_req_rxq_desc: Number of user requested RX queue descriptors through
463 * Used to restore configuration after a reset as the vport will get wiped.
476 * enum idpf_vport_config_flags - Vport config flags
493 * @avail_rxq: Available RX queues
494 * @avail_txq: Available TX queues
495 * @avail_bufq: Available buffer queues
496 * @avail_complq: Available completion queues
498 * Maintain total queues available after allocating max queues to each vport.
508 * struct idpf_vector_info - Utility structure to pass function arguments as a
510 * @num_req_vecs: Vectors required based on the number of queues updated by the
524 * struct idpf_vector_lifo - Stack to maintain vector indexes used for vector
526 * @top: Points to stack top i.e. next available vector index
527 * @base: Always points to start of the free pool
529 * @vec_idx: Array to store all the vector indexes
534 * gives priority to default vports in a way that at least IDPF_MIN_Q_VEC
537 * vector indexes which can be allocated on-demand basis. Mailbox vector index
548 * struct idpf_vport_config - Vport configuration data
550 * @max_q: Maximum possible queues
551 * @req_qs_chunks: Queue chunk data for requested queues
552 * @mac_filter_list_lock: Lock to protect mac filters
564 * struct idpf_adapter - Device data struct generated on probe
580 * @vector_stack: Stack to store the msix vector indexes
584 * @vports: Array to store vports created by the driver
592 * @next_vport: Next free slot in pf->vport[] - 0-based!
597 * @mbx_task: Task to handle mailbox interrupts
599 * @vc_event_task: Task to handle out of band virtchnl event notifications
609 * to VFs but is used to initialize them
611 * @req_tx_splitq: TX split or single queue model to request
612 * @req_rx_splitq: RX split or single queue model to request
613 * @vport_ctrl_lock: Lock to protect the vport control flow
614 * @vector_lock: Lock to protect vector distribution
615 * @queue_lock: Lock to protect queue distribution
616 * @vc_buf_lock: Lock to protect virtchnl buffer
679 * idpf_is_queue_model_split - check if queue model is split
743 * idpf_get_reserved_vecs - Get reserved vectors
748 return le16_to_cpu(adapter->caps.num_allocated_vectors); in idpf_get_reserved_vecs()
752 * idpf_get_default_vports - Get default number of vports
757 return le16_to_cpu(adapter->caps.default_num_vports); in idpf_get_default_vports()
761 * idpf_get_max_vports - Get max number of vports
766 return le16_to_cpu(adapter->caps.max_vports); in idpf_get_max_vports()
770 * idpf_get_max_tx_bufs - Get max scatter-gather buffers supported by the device
775 return adapter->caps.max_sg_bufs_per_tx_pkt; in idpf_get_max_tx_bufs()
779 * idpf_get_min_tx_pkt_len - Get min packet length supported by the device
784 u8 pkt_len = adapter->caps.min_sso_packet_len; in idpf_get_min_tx_pkt_len()
790 * idpf_get_reg_addr - Get BAR0 register address
799 return (void __iomem *)(adapter->hw.hw_addr + reg_offset); in idpf_get_reg_addr()
803 * idpf_is_reset_detected - check if we were reset at some point
810 if (!adapter->hw.arq) in idpf_is_reset_detected()
813 return !(readl(idpf_get_reg_addr(adapter, adapter->hw.arq->reg.len)) & in idpf_is_reset_detected()
814 adapter->hw.arq->reg.len_mask); in idpf_is_reset_detected()
818 * idpf_is_reset_in_prog - check if reset is in progress
825 return (test_bit(IDPF_HR_RESET_IN_PROG, adapter->flags) || in idpf_is_reset_in_prog()
826 test_bit(IDPF_HR_FUNC_RESET, adapter->flags) || in idpf_is_reset_in_prog()
827 test_bit(IDPF_HR_DRV_LOAD, adapter->flags)); in idpf_is_reset_in_prog()
831 * idpf_netdev_to_vport - get a vport handle from a netdev
838 return np->vport; in idpf_netdev_to_vport()
842 * idpf_netdev_to_adapter - Get adapter handle from a netdev
849 return np->adapter; in idpf_netdev_to_adapter()
853 * idpf_is_feature_ena - Determine if a particular feature is enabled
854 * @vport: Vport to check
855 * @feature: Netdev flag to check
862 return vport->netdev->features & feature; in idpf_is_feature_ena()
866 * idpf_get_max_tx_hdr_size -- get the size of tx header
871 return le16_to_cpu(adapter->caps.max_tx_hdr_size); in idpf_get_max_tx_hdr_size()
875 * idpf_vport_ctrl_lock - Acquire the vport control lock
878 * This lock should be used by non-datapath code to protect against vport
885 mutex_lock(&np->adapter->vport_ctrl_lock); in idpf_vport_ctrl_lock()
889 * idpf_vport_ctrl_unlock - Release the vport control lock
896 mutex_unlock(&np->adapter->vport_ctrl_lock); in idpf_vport_ctrl_unlock()