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

1 /* SPDX-License-Identifier: GPL-2.0+ */
2 // Copyright (c) 2016-2017 Hisilicon Limited.
70 ((max_frm_size) - (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN))
87 #define HNS3_RXD_L3ID_S 4
112 #define HNS3_RXD_OL3ID_S 4
121 #define HNS3_RXD_PTYPE_S 4
122 #define HNS3_RXD_PTYPE_M GENMASK(11, 4)
126 #define HNS3_RXD_VLD_B 4
144 #define HNS3_TXD_L3CS_B 4
163 #define HNS3_TXD_TUNTYPE_S 4
171 #define HNS3_TXD_FE_B 4
254 /* hardware spec ring buffer format */
323 DESC_TYPE_BOUNCE_HEAD = 1 << 4,
345 /* desc type, used by the ring user to mark the type of the priv data */
388 HNS3_OL3_TYPE_IPV4_OPT = 4,
407 u32 l3_type : 4;
481 u32 buf_size; /* size for hnae_desc->addr, preset by AE */
485 /* idx of lastest sent desc, the ring is empty when equal to
489 u32 flag; /* ring attribute */
493 /* for Tx ring */
501 /* for Rx ring */
545 struct hns3_enet_ring *ring; member
581 * the cb for nic to manage the ring buffer, the first half of the
584 struct hns3_enet_ring *ring; member
624 static inline int ring_space(struct hns3_enet_ring *ring) in ring_space() argument
629 int begin = smp_load_acquire(&ring->next_to_clean); in ring_space()
630 int end = READ_ONCE(ring->next_to_use); in ring_space()
632 return ((end >= begin) ? (ring->desc_num - end + begin) : in ring_space()
633 (begin - end)) - 1; in ring_space()
636 static inline u32 hns3_tqp_read_reg(struct hns3_enet_ring *ring, u32 reg) in hns3_tqp_read_reg() argument
638 return readl_relaxed(ring->tqp->io_base + reg); in hns3_tqp_read_reg()
654 hns3_read_reg((a)->io_base, reg)
660 return test_bit(HNS3_NIC_STATE_RESETTING, &priv->state); in hns3_nic_resetting()
664 hns3_write_reg((a)->io_base, reg, value)
666 #define ring_to_dev(ring) ((ring)->dev) argument
668 #define ring_to_netdev(ring) ((ring)->tqp_vector->napi.dev) argument
670 #define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \ argument
673 #define hns3_buf_size(_ring) ((_ring)->buf_size)
675 #define hns3_ring_stats_update(ring, cnt) do { \ argument
676 typeof(ring) (tmp) = (ring); \
677 u64_stats_update_begin(&(tmp)->syncp); \
678 ((tmp)->stats.cnt)++; \
679 u64_stats_update_end(&(tmp)->syncp); \
682 static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring) in hns3_page_order() argument
685 if (ring->buf_size > (PAGE_SIZE / 2)) in hns3_page_order()
693 /* iterator for handling rings in ring group */
695 for (pos = (head).ring; (pos); pos = (pos)->next)
698 (((struct hns3_nic_priv *)netdev_priv(ndev))->ae_handle)
701 (pci_get_drvdata((handle)->pdev))
704 ((handle)->ae_algo->ops)
710 #define hns3_rl_round_down(int_rl) round_down(int_rl, 4)
716 void hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget);
719 void hns3_fini_ring(struct hns3_enet_ring *ring);
723 struct hns3_enet_ring *ring, int budget,