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. */
20 #include <linux/io-64-nonatomic-hi-lo.h>
31 if (__nn->dp.netdev) \
32 netdev_printk(lvl, __nn->dp.netdev, fmt, ## args); \
34 dev_printk(lvl, __nn->dp.dev, "ctrl: " fmt, ## args); \
47 if (__dp->netdev) \
48 netdev_warn(__dp->netdev, fmt, ## args); \
50 dev_warn(__dp->dev, fmt, ## args); \
113 #define D_IDX(ring, idx) ((idx) & ((ring)->cnt - 1))
121 __d->dma_addr_lo = cpu_to_le32(lower_32_bits(__addr)); \
122 __d->dma_addr_hi = upper_32_bits(__addr) & 0xff; \
169 * struct nfp_net_tx_buf - software TX buffer descriptor
173 * @fidx: Fragment index (-1 for the head and [0..nr_frags-1] for frags)
176 * Will be 1 for all non-TSO packets.
178 * on the head's buffer). Equal to skb->len for non-TSO packets.
192 * struct nfp_net_tx_ring - TX ring structure
196 * @qcp_q: Pointer to base of the QCP TX queue
290 #define NFP_NET_META_FIELD_MASK GENMASK(NFP_NET_META_FIELD_SIZE - 1, 0)
307 * struct nfp_net_rx_buf - software RX buffer descriptor
317 * struct nfp_net_rx_ring - RX ring structure
324 * @qcp_fl: Pointer to base of the QCP freelist queue
327 * @xdp_rxq: RX-ring info avail for XDP
353 * struct nfp_net_r_vector - Per ring interrupt vector configuration
355 * @napi: NAPI structure for this ring vec
362 * @irq_entry: MSI-X table entry (use for talking to the device)
461 return fw_ver->resv == resv && in nfp_net_fw_ver_eq()
462 fw_ver->class == class && in nfp_net_fw_ver_eq()
463 fw_ver->major == major && in nfp_net_fw_ver_eq()
464 fw_ver->minor == minor; in nfp_net_fw_ver_eq()
473 * 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
535 * struct nfp_net - NFP network device structure
552 * @r_vecs: Pre-allocated array of ring vectors
553 * @irq_entries: Pre-allocated array of MSI-X entries
601 * @vnic_no_name: For non-port PF vNIC make ndo_get_phys_port_name return
602 * -EOPNOTSUPP to keep backwards compatibility (set by app)
707 return readb(nn->dp.ctrl_bar + off); in nn_readb()
712 writeb(val, nn->dp.ctrl_bar + off); in nn_writeb()
717 return readw(nn->dp.ctrl_bar + off); in nn_readw()
722 writew(val, nn->dp.ctrl_bar + off); in nn_writew()
727 return readl(nn->dp.ctrl_bar + off); in nn_readl()
732 writel(val, nn->dp.ctrl_bar + off); in nn_writel()
737 return readq(nn->dp.ctrl_bar + off); in nn_readq()
742 writeq(val, nn->dp.ctrl_bar + off); in nn_writeq()
773 /* nfp_qcp_ptr - Read or Write Pointer of a queue */
797 val -= NFP_QCP_MAX_ADD; in _nfp_qcp_ptr_add()
804 * nfp_qcp_rd_ptr_add() - Add the value to the read pointer of a queue
806 * @q: Base address for queue structure
817 * nfp_qcp_wr_ptr_add() - Add the value to the write pointer of a queue
819 * @q: Base address for queue structure
848 * nfp_qcp_rd_ptr_read() - Read the current read pointer value for a queue
849 * @q: Base address for queue structure
859 * nfp_qcp_wr_ptr_read() - Read the current write pointer value for a queue
860 * @q: Base address for queue structure
871 WARN_ON_ONCE(!nn->dp.netdev && nn->port); in nfp_net_is_data_vnic()
872 return !!nn->dp.netdev; in nfp_net_is_data_vnic()
877 return nn->dp.ctrl & NFP_NET_CFG_CTRL_ENABLE; in nfp_net_running()
882 return nn->dp.netdev ? nn->dp.netdev->name : "ctrl"; in nfp_net_name()
886 __acquires(&nn->r_vecs[0].lock) in nfp_ctrl_lock()
888 spin_lock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_lock()
892 __releases(&nn->r_vecs[0].lock) in nfp_ctrl_unlock()
894 spin_unlock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_unlock()
899 down(&nn->bar_lock); in nn_ctrl_bar_lock()
904 return !down_trylock(&nn->bar_lock); in nn_ctrl_bar_trylock()
909 up(&nn->bar_lock); in nn_ctrl_bar_unlock()
919 return netdev->netdev_ops == &nfp_net_netdev_ops; in nfp_netdev_is_nfp_net()