Lines Matching +full:msi +full:- +full:base +full:- +full:vec
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2015-2018 Netronome Systems, Inc. */
21 #include <linux/io-64-nonatomic-hi-lo.h>
32 if (__nn->dp.netdev) \
33 netdev_printk(lvl, __nn->dp.netdev, fmt, ## args); \
35 dev_printk(lvl, __nn->dp.dev, "ctrl: " fmt, ## args); \
48 if (__dp->netdev) \
49 netdev_warn(__dp->netdev, fmt, ## args); \
51 dev_warn(__dp->dev, fmt, ## args); \
118 #define D_IDX(ring, idx) ((idx) & ((ring)->cnt - 1))
126 __d->dma_addr_lo = cpu_to_le32(lower_32_bits(__addr)); \
127 __d->dma_addr_hi = upper_32_bits(__addr) & 0xff; \
135 __d->dma_addr_hi = cpu_to_le16(upper_32_bits(__addr)); \
136 __d->dma_addr_lo = cpu_to_le32(lower_32_bits(__addr)); \
140 * struct nfp_net_tx_ring - TX ring structure
144 * @qcp_q: Pointer to base of the QCP TX queue
253 #define NFP_NET_META_FIELD_MASK GENMASK(NFP_NET_META_FIELD_SIZE - 1, 0)
281 * struct nfp_net_rx_buf - software RX buffer descriptor
291 * struct nfp_net_xsk_rx_buf - software RX XSK buffer descriptor
301 * struct nfp_net_rx_ring - RX ring structure
308 * @qcp_fl: Pointer to base of the QCP freelist queue
312 * @xdp_rxq: RX-ring info avail for XDP
339 * struct nfp_net_r_vector - Per ring interrupt vector configuration
341 * @napi: NAPI structure for this ring vec
349 * @irq_entry: MSI-X table entry (use for talking to the device)
460 return fw_ver->extend == extend && in nfp_net_fw_ver_eq()
461 fw_ver->class == class && in nfp_net_fw_ver_eq()
462 fw_ver->major == major && in nfp_net_fw_ver_eq()
463 fw_ver->minor == minor; in nfp_net_fw_ver_eq()
472 * struct nfp_net_dp - NFP network device datapath data structure
485 * @tx_rings: Array of pre-allocated TX ring structures
486 * @rx_rings: Array of pre-allocated RX ring structures
547 * struct nfp_net - NFP network device structure
566 * @r_vecs: Pre-allocated array of ring vectors
567 * @irq_entries: Pre-allocated array of MSI-X entries
617 * @vnic_no_name: For non-port PF vNIC make ndo_get_phys_port_name return
618 * -EOPNOTSUPP to keep backwards compatibility (set by app)
782 return readb(nn->dp.ctrl_bar + off); in nn_readb()
787 writeb(val, nn->dp.ctrl_bar + off); in nn_writeb()
792 return readw(nn->dp.ctrl_bar + off); in nn_readw()
797 writew(val, nn->dp.ctrl_bar + off); in nn_writew()
802 return readl(nn->dp.ctrl_bar + off); in nn_readl()
807 writel(val, nn->dp.ctrl_bar + off); in nn_writel()
812 return readq(nn->dp.ctrl_bar + off); in nn_readq()
817 writeq(val, nn->dp.ctrl_bar + off); in nn_writeq()
844 /* nfp_qcp_ptr - Read or Write Pointer of a queue */
851 * nfp_qcp_rd_ptr_add() - Add the value to the read pointer of a queue
853 * @q: Base address for queue structure
862 * nfp_qcp_wr_ptr_add() - Add the value to the write pointer of a queue
864 * @q: Base address for queue structure
891 * nfp_qcp_rd_ptr_read() - Read the current read pointer value for a queue
892 * @q: Base address for queue structure
902 * nfp_qcp_wr_ptr_read() - Read the current write pointer value for a queue
903 * @q: Base address for queue structure
916 WARN_ON_ONCE(!nn->dp.netdev && nn->port); in nfp_net_is_data_vnic()
917 return !!nn->dp.netdev; in nfp_net_is_data_vnic()
922 return nn->dp.ctrl & NFP_NET_CFG_CTRL_ENABLE; in nfp_net_running()
927 return nn->dp.netdev ? nn->dp.netdev->name : "ctrl"; in nfp_net_name()
931 __acquires(&nn->r_vecs[0].lock) in nfp_ctrl_lock()
933 spin_lock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_lock()
937 __releases(&nn->r_vecs[0].lock) in nfp_ctrl_unlock()
939 spin_unlock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_unlock()
944 down(&nn->bar_lock); in nn_ctrl_bar_lock()
949 return !down_trylock(&nn->bar_lock); in nn_ctrl_bar_trylock()
954 up(&nn->bar_lock); in nn_ctrl_bar_unlock()
965 return netdev->netdev_ops == &nfp_nfd3_netdev_ops || in nfp_netdev_is_nfp_net()
966 netdev->netdev_ops == &nfp_nfdk_netdev_ops; in nfp_netdev_is_nfp_net()
971 if (param >= ((1 << 16) - 1)) in nfp_net_coalesce_para_check()
972 return -EINVAL; in nfp_net_coalesce_para_check()