Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1668634
| From | Bo Yu <tsu.yubo@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC |
| Date | 2017-06-18 19:00 +0200 |
| Message-ID | <tTLIm-7ER-5@gated-at.bofh.it> (permalink) |
| References | <tTpHP-1Qt-1@gated-at.bofh.it> <tTpHQ-1Qt-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On Sat, Jun 17, 2017 at 06:24:24PM +0100, Salil Mehta wrote:
>+ struct notifier_block notifier_block;
>+ /* Vxlan/Geneve information */
>+ struct hns3_udp_tunnel udp_tnl[HNS3_UDP_TNL_MAX];
>+};
>+
>+/* the distance between [begin, end) in a ring buffer
>+ * note: there is a unuse slot between the begin and the end
>+ */
>+static inline int ring_dist(struct hns3_enet_ring *ring, int begin, int end)
>+{
>+ return (end - begin + ring->desc_num) % ring->desc_num;
>+}
>+
>+static inline int ring_space(struct hns3_enet_ring *ring)
>+{
>+ return ring->desc_num -
>+ ring_dist(ring, ring->next_to_clean, ring->next_to_use) - 1;
>+}
>+
>+static inline int is_ring_empty(struct hns3_enet_ring *ring)
>+{
>+ return ring->next_to_use == ring->next_to_clean;
>+}
>+
>+static inline void hns3_write_reg(void __iomem *base, u32 reg, u32 value)
>+{
>+ u8 __iomem *reg_addr = READ_ONCE(base);
>+
>+ writel(value, reg_addr + reg);
>+}
>+
>+#define hns3_write_dev(a, reg, value) \
>+ hns3_write_reg((a)->io_base, (reg), (value))
>+
>+#define hnae_queue_xmit(tqp, buf_num) writel_relaxed(buf_num, \
>+ (tqp)->io_base + HNS3_RING_TX_RING_TAIL_REG)
>+
>+#define ring_to_dev(ring) (&(ring)->tqp->handle->pdev->dev)
>+
>+#define ring_to_dma_dir(ring) (HNAE3_IS_TX_RING(ring) ? \
>+ DMA_TO_DEVICE : DMA_FROM_DEVICE)
>+
>+#define tx_ring_data(priv, idx) ((priv)->ring_data[idx])
>+
>+#define hnae_buf_size(_ring) ((_ring)->buf_size)
>+#define hnae_page_order(_ring) (get_order(hnae_buf_size(_ring)))
>+#define hnae_page_size(_ring) (PAGE_SIZE << hnae_page_order(_ring))
>+
>+/* iterator for handling rings in ring group */
>+#define hns3_for_each_ring(pos, head) \
>+ for (pos = (head).ring; pos != NULL; pos = pos->next)
Only a pos? Comparsion to NULL could be written "pos" noticed by
checkpatch.
>+
>+void hns3_ethtool_set_ops(struct net_device *ndev);
>+
>+int hns3_nic_net_xmit_hw(
>+ struct net_device *ndev,
>+ struct sk_buff *skb,
>+ struct hns3_nic_ring_data *ring_data);
>+int hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget);
>+int hns3_clean_rx_ring_ex(
>+ struct hns3_enet_ring *ring,
>+ struct sk_buff **skb_ex,
>+ int budget);
>+#endif
>--
>2.7.4
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet Driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
[PATCH V3 net-next 3/8] net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
[PATCH V3 net-next 8/8] net: hns3: Add HNS3 driver to kernel build framework & MAINTAINERS Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
[PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Andrew Lunn <andrew@lunn.ch> - 2017-06-17 21:50 +0200
Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Andrew Lunn <andrew@lunn.ch> - 2017-06-18 17:10 +0200
Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Bo Yu <tsu.yubo@gmail.com> - 2017-06-18 18:50 +0200
Re: [PATCH V3 net-next 2/8] net: hns3: Add support of the HNAE3 framework Stephen Hemminger <stephen@networkplumber.org> - 2017-06-19 19:00 +0200
[PATCH V3 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
[PATCH V3 net-next 6/8] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
Re: [PATCH V3 net-next 6/8] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-19 06:00 +0200
[PATCH V3 net-next 5/8] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Salil Mehta <salil.mehta@huawei.com> - 2017-06-17 19:30 +0200
Re: [PATCH V3 net-next 5/8] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Richard Cochran <richardcochran@gmail.com> - 2017-06-18 18:50 +0200
Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-17 20:00 +0200
Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Andrew Lunn <andrew@lunn.ch> - 2017-06-17 21:50 +0200
Re: [PATCH V3 net-next 0/8] Hisilicon Network Subsystem 3 Ethernet Driver Leon Romanovsky <leon@kernel.org> - 2017-06-18 08:10 +0200
Re: [PATCH V3 net-next 1/8] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Bo Yu <tsu.yubo@gmail.com> - 2017-06-18 19:00 +0200
csiph-web