Lines Matching refs:nn

28 #define nn_pr(nn, lvl, fmt, args...)					\  argument
30 struct nfp_net *__nn = (nn); \
38 #define nn_err(nn, fmt, args...) nn_pr(nn, KERN_ERR, fmt, ## args) argument
39 #define nn_warn(nn, fmt, args...) nn_pr(nn, KERN_WARNING, fmt, ## args) argument
40 #define nn_info(nn, fmt, args...) nn_pr(nn, KERN_INFO, fmt, ## args) argument
41 #define nn_dbg(nn, fmt, args...) nn_pr(nn, KERN_DEBUG, fmt, ## args) argument
769 int (*cfg)(struct nfp_net *nn, struct nfp_mbox_amsg_entry *entry);
774 int nfp_net_sched_mbox_amsg_work(struct nfp_net *nn, u32 cmd, const void *data, size_t len,
780 static inline u16 nn_readb(struct nfp_net *nn, int off) in nn_readb() argument
782 return readb(nn->dp.ctrl_bar + off); in nn_readb()
785 static inline void nn_writeb(struct nfp_net *nn, int off, u8 val) in nn_writeb() argument
787 writeb(val, nn->dp.ctrl_bar + off); in nn_writeb()
790 static inline u16 nn_readw(struct nfp_net *nn, int off) in nn_readw() argument
792 return readw(nn->dp.ctrl_bar + off); in nn_readw()
795 static inline void nn_writew(struct nfp_net *nn, int off, u16 val) in nn_writew() argument
797 writew(val, nn->dp.ctrl_bar + off); in nn_writew()
800 static inline u32 nn_readl(struct nfp_net *nn, int off) in nn_readl() argument
802 return readl(nn->dp.ctrl_bar + off); in nn_readl()
805 static inline void nn_writel(struct nfp_net *nn, int off, u32 val) in nn_writel() argument
807 writel(val, nn->dp.ctrl_bar + off); in nn_writel()
810 static inline u64 nn_readq(struct nfp_net *nn, int off) in nn_readq() argument
812 return readq(nn->dp.ctrl_bar + off); in nn_readq()
815 static inline void nn_writeq(struct nfp_net *nn, int off, u64 val) in nn_writeq() argument
817 writeq(val, nn->dp.ctrl_bar + off); in nn_writeq()
821 static inline void nn_pci_flush(struct nfp_net *nn) in nn_pci_flush() argument
823 nn_readl(nn, NFP_NET_CFG_VERSION); in nn_pci_flush()
914 static inline bool nfp_net_is_data_vnic(struct nfp_net *nn) in nfp_net_is_data_vnic() argument
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()
920 static inline bool nfp_net_running(struct nfp_net *nn) in nfp_net_running() argument
922 return nn->dp.ctrl & NFP_NET_CFG_CTRL_ENABLE; in nfp_net_running()
925 static inline const char *nfp_net_name(struct nfp_net *nn) in nfp_net_name() argument
927 return nn->dp.netdev ? nn->dp.netdev->name : "ctrl"; in nfp_net_name()
930 static inline void nfp_ctrl_lock(struct nfp_net *nn) in nfp_ctrl_lock() argument
931 __acquires(&nn->r_vecs[0].lock) in nfp_ctrl_lock()
933 spin_lock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_lock()
936 static inline void nfp_ctrl_unlock(struct nfp_net *nn) in nfp_ctrl_unlock() argument
937 __releases(&nn->r_vecs[0].lock) in nfp_ctrl_unlock()
939 spin_unlock_bh(&nn->r_vecs[0].lock); in nfp_ctrl_unlock()
942 static inline void nn_ctrl_bar_lock(struct nfp_net *nn) in nn_ctrl_bar_lock() argument
944 down(&nn->bar_lock); in nn_ctrl_bar_lock()
947 static inline bool nn_ctrl_bar_trylock(struct nfp_net *nn) in nn_ctrl_bar_trylock() argument
949 return !down_trylock(&nn->bar_lock); in nn_ctrl_bar_trylock()
952 static inline void nn_ctrl_bar_unlock(struct nfp_net *nn) in nn_ctrl_bar_unlock() argument
954 up(&nn->bar_lock); in nn_ctrl_bar_unlock()
985 void nfp_net_free(struct nfp_net *nn);
987 int nfp_net_init(struct nfp_net *nn);
988 void nfp_net_clean(struct nfp_net *nn);
990 int nfp_ctrl_open(struct nfp_net *nn);
991 void nfp_ctrl_close(struct nfp_net *nn);
994 void nfp_net_info(struct nfp_net *nn);
995 int __nfp_net_reconfig(struct nfp_net *nn, u32 update);
996 int nfp_net_reconfig(struct nfp_net *nn, u32 update);
997 unsigned int nfp_net_rss_key_sz(struct nfp_net *nn);
998 void nfp_net_rss_write_itbl(struct nfp_net *nn);
999 void nfp_net_rss_write_key(struct nfp_net *nn);
1000 void nfp_net_coalesce_write_cfg(struct nfp_net *nn);
1001 int nfp_net_mbox_lock(struct nfp_net *nn, unsigned int data_size);
1002 int nfp_net_mbox_reconfig(struct nfp_net *nn, u32 mbox_cmd);
1003 int nfp_net_mbox_reconfig_and_unlock(struct nfp_net *nn, u32 mbox_cmd);
1004 void nfp_net_mbox_reconfig_post(struct nfp_net *nn, u32 update);
1005 int nfp_net_mbox_reconfig_wait_posted(struct nfp_net *nn);
1012 nfp_net_irqs_assign(struct nfp_net *nn, struct msix_entry *irq_entries,
1019 struct nfp_net_dp *nfp_net_clone_dp(struct nfp_net *nn);
1020 int nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_dp *new,
1023 int nfp_net_fs_add_hw(struct nfp_net *nn, struct nfp_fs_entry *entry);
1024 int nfp_net_fs_del_hw(struct nfp_net *nn, struct nfp_fs_entry *entry);
1030 void nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir);
1047 nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir) in nfp_net_debugfs_vnic_add() argument