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
626 static inline u32 ring_space(struct hns3_enet_ring *ring) in ring_space() argument
631 int begin = smp_load_acquire(&ring->next_to_clean); in ring_space()
632 int end = READ_ONCE(ring->next_to_use); in ring_space()
634 return ((end >= begin) ? (ring->desc_num - end + begin) : in ring_space()
635 (begin - end)) - 1; in ring_space()
638 static inline u32 hns3_tqp_read_reg(struct hns3_enet_ring *ring, u32 reg) in hns3_tqp_read_reg() argument
640 return readl_relaxed(ring->tqp->io_base + reg); in hns3_tqp_read_reg()
656 hns3_read_reg((a)->io_base, reg)
662 return test_bit(HNS3_NIC_STATE_RESETTING, &priv->state); in hns3_nic_resetting()
666 hns3_write_reg((a)->io_base, reg, value)
668 #define ring_to_dev(ring) ((ring)->dev) argument
670 #define ring_to_netdev(ring) ((ring)->tqp_vector->napi.dev) argument
672 #define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \ argument
675 #define hns3_buf_size(_ring) ((_ring)->buf_size)
677 #define hns3_ring_stats_update(ring, cnt) do { \ argument
678 typeof(ring) (tmp) = (ring); \
679 u64_stats_update_begin(&(tmp)->syncp); \
680 ((tmp)->stats.cnt)++; \
681 u64_stats_update_end(&(tmp)->syncp); \
684 static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring) in hns3_page_order() argument
687 if (ring->buf_size > (PAGE_SIZE / 2)) in hns3_page_order()
695 /* iterator for handling rings in ring group */
697 for ((pos) = (head).ring; (pos); (pos) = (pos)->next)
700 (((struct hns3_nic_priv *)netdev_priv(ndev))->ae_handle)
703 (pci_get_drvdata((handle)->pdev))
706 ((handle)->ae_algo->ops)
712 #define hns3_rl_round_down(int_rl) round_down(int_rl, 4)
718 void hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget);
721 void hns3_fini_ring(struct hns3_enet_ring *ring);
725 struct hns3_enet_ring *ring, int budget,