Lines Matching +full:4 +full:- +full:ring

1 /* SPDX-License-Identifier: GPL-2.0 */
25 #define IGC_MAX_RX_QUEUES 4
26 #define IGC_MAX_TX_QUEUES 4
37 #define IGC_N_SDP 4
41 #define IGC_MAX_TX_TSTAMP_REGS 4
139 struct igc_ring *ring; /* pointer to linked list of rings */ member
144 u8 itr; /* current ITR setting for ring */
155 void *desc; /* descriptor ring memory */
156 unsigned long flags; /* ring specific flags */
157 void __iomem *tail; /* pointer to ring tail register */
158 dma_addr_t dma; /* phys address of the ring */
159 unsigned int size; /* length of desc. ring in bytes */
161 u16 count; /* number of desc. in the ring */
162 u8 queue_index; /* logical index of the ring*/
163 u8 reg_idx; /* physical index of the ring */
322 /* Free-running timer lock */
326 struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
355 int igc_setup_tx_resources(struct igc_ring *ring);
356 int igc_setup_rx_resources(struct igc_ring *ring);
357 void igc_free_tx_resources(struct igc_ring *ring);
358 void igc_free_rx_resources(struct igc_ring *ring);
367 void igc_disable_rx_ring(struct igc_ring *ring);
368 void igc_enable_rx_ring(struct igc_ring *ring);
369 void igc_disable_tx_ring(struct igc_ring *ring);
370 void igc_enable_tx_ring(struct igc_ring *ring);
390 #define IGC_FLAG_DMAC BIT(4)
410 /* RX-desc Write-Back format RSS Type's */
416 IGC_RSS_TYPE_HASH_IPV6_EX = 4,
425 #define IGC_RSS_TYPE_MASK GENMASK(3,0) /* 4-bits (3:0) = mask 0x0F */
427 /* igc_rss_type - Rx descriptor RSS type field */
430 /* RSS Type 4-bits (3:0) number: 0-9 (above 9 is reserved) in igc_rss_type()
434 return le32_get_bits(rx_desc->wb.lower.lo_dword.data, IGC_RSS_TYPE_MASK); in igc_rss_type()
478 * PTHRESH - MAC will consider prefetch if it has fewer than this number of
481 * HTHRESH - MAC will only prefetch if there are at least this many descriptors
484 * WTHRESH - RX descriptor writeback threshold - MAC will delay writing back
490 #define IGC_RXDCTL_WTHRESH 4
496 #define IGC_TXDCTL_PTHRESH_MASK GENMASK(4, 0)
522 (SKB_WITH_OVERHEAD(IGC_RXBUFFER_2048) - IGC_SKB_PAD - IGC_TS_HDR_LEN)
524 #define IGC_MAX_FRAME_BUILD_SKB (IGC_RXBUFFER_2048 - IGC_TS_HDR_LEN)
534 /* igc_test_staterr - tests bits within Rx descriptor status and error fields */
538 return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits); in igc_test_staterr()
576 #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
625 struct igc_ring ring[] ____cacheline_internodealigned_in_smp; member
633 IGC_FILTER_FLAG_USER_DATA = BIT(4),
664 * - 16 MAC address based filtering rules (highest priority)
665 * - 8 ethertype based filtering rules
666 * - 32 Flex filter based filtering rules
667 * - 8 VLAN priority based filtering rules
668 * - 1 default queue rule (lowest priority)
683 /* igc_desc_unused - calculate if we have unused descriptors */
684 static inline u16 igc_desc_unused(const struct igc_ring *ring) in igc_desc_unused() argument
686 u16 ntc = ring->next_to_clean; in igc_desc_unused()
687 u16 ntu = ring->next_to_use; in igc_desc_unused()
689 return ((ntc > ntu) ? 0 : ring->count) + ntc - ntu - 1; in igc_desc_unused()
694 if (hw->phy.ops.get_phy_info) in igc_get_phy_info()
695 return hw->phy.ops.get_phy_info(hw); in igc_get_phy_info()
702 if (hw->phy.ops.reset) in igc_reset_phy()
703 return hw->phy.ops.reset(hw); in igc_reset_phy()
710 return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index); in txring_txq()
725 #define ring_uses_large_buffer(ring) \ argument
726 test_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
727 #define set_ring_uses_large_buffer(ring) \ argument
728 set_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
729 #define clear_ring_uses_large_buffer(ring) \ argument
730 clear_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
732 #define ring_uses_build_skb(ring) \ argument
733 test_bit(IGC_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
735 static inline unsigned int igc_rx_bufsz(struct igc_ring *ring) in igc_rx_bufsz() argument
738 if (ring_uses_large_buffer(ring)) in igc_rx_bufsz()
741 if (ring_uses_build_skb(ring)) in igc_rx_bufsz()
747 static inline unsigned int igc_rx_pg_order(struct igc_ring *ring) in igc_rx_pg_order() argument
750 if (ring_uses_large_buffer(ring)) in igc_rx_pg_order()
758 if (hw->phy.ops.read_reg) in igc_read_phy_reg()
759 return hw->phy.ops.read_reg(hw, offset, data); in igc_read_phy_reg()
761 return -EOPNOTSUPP; in igc_read_phy_reg()
772 void igc_flush_tx_descriptors(struct igc_ring *ring);
795 (&(((union igc_adv_rx_desc *)((R)->desc))[i]))
797 (&(((union igc_adv_tx_desc *)((R)->desc))[i]))
799 (&(((struct igc_adv_tx_context_desc *)((R)->desc))[i]))