cregit-Linux how code gets into the kernel

Release 4.7 include/linux/netpoll.h

Directory: include/linux
/*
 * Common code for low-level network console, dump, and debugger code
 *
 * Derived from netconsole, kgdb-over-ethernet, and netdump patches
 */

#ifndef _LINUX_NETPOLL_H

#define _LINUX_NETPOLL_H

#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/rcupdate.h>
#include <linux/list.h>


union inet_addr {
	
__u32		all[4];
	
__be32		ip;
	
__be32		ip6[4];
	
struct in_addr	in;
	
struct in6_addr	in6;
};


struct netpoll {
	
struct net_device *dev;
	
char dev_name[IFNAMSIZ];
	
const char *name;

	

union inet_addr local_ip, remote_ip;
	
bool ipv6;
	

u16 local_port, remote_port;
	
u8 remote_mac[ETH_ALEN];

	
struct work_struct cleanup_work;
};


struct netpoll_info {
	
atomic_t refcnt;

	
struct semaphore dev_lock;

	
struct sk_buff_head txq;

	
struct delayed_work tx_work;

	
struct netpoll *netpoll;
	
struct rcu_head rcu;
};

#ifdef CONFIG_NETPOLL
extern void netpoll_poll_disable(struct net_device *dev);
extern void netpoll_poll_enable(struct net_device *dev);
#else

static inline void netpoll_poll_disable(struct net_device *dev) { return; }

Contributors

PersonTokensPropCommitsCommitProp
neil hormanneil horman1076.92%133.33%
ding tianhongding tianhong215.38%133.33%
eric w. biedermaneric w. biederman17.69%133.33%
Total13100.00%3100.00%


static inline void netpoll_poll_enable(struct net_device *dev) { return; }

Contributors

PersonTokensPropCommitsCommitProp
neil hormanneil horman1292.31%150.00%
eric w. biedermaneric w. biederman17.69%150.00%
Total13100.00%2100.00%

#endif void netpoll_send_udp(struct netpoll *np, const char *msg, int len); void netpoll_print_options(struct netpoll *np); int netpoll_parse_options(struct netpoll *np, char *opt); int __netpoll_setup(struct netpoll *np, struct net_device *ndev); int netpoll_setup(struct netpoll *np); void __netpoll_cleanup(struct netpoll *np); void __netpoll_free_async(struct netpoll *np); void netpoll_cleanup(struct netpoll *np); void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, struct net_device *dev);
static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { unsigned long flags; local_irq_save(flags); netpoll_send_skb_on_dev(np, skb, np->dev); local_irq_restore(flags); }

Contributors

PersonTokensPropCommitsCommitProp
neil hormanneil horman2866.67%150.00%
americo wangamerico wang1433.33%150.00%
Total42100.00%2100.00%

#ifdef CONFIG_NETPOLL
static inline void *netpoll_poll_lock(struct napi_struct *napi) { struct net_device *dev = napi->dev; if (dev && dev->npinfo) { spin_lock(&napi->poll_lock); napi->poll_owner = smp_processor_id(); return napi; } return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
matt mackallmatt mackall3566.04%240.00%
stephen hemmingerstephen hemminger1630.19%120.00%
david s. millerdavid s. miller11.89%120.00%
jeff moyerjeff moyer11.89%120.00%
Total53100.00%5100.00%


static inline void netpoll_poll_unlock(void *have) { struct napi_struct *napi = have; if (napi) { napi->poll_owner = -1; spin_unlock(&napi->poll_lock); } }

Contributors

PersonTokensPropCommitsCommitProp
matt mackallmatt mackall2564.10%250.00%
jeff moyerjeff moyer923.08%125.00%
stephen hemmingerstephen hemminger512.82%125.00%
Total39100.00%4100.00%


static inline bool netpoll_tx_running(struct net_device *dev) { return irqs_disabled(); }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu1593.75%150.00%
americo wangamerico wang16.25%150.00%
Total16100.00%2100.00%

#else
static inline void *netpoll_poll_lock(struct napi_struct *napi) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
stephen hemmingerstephen hemminger1381.25%150.00%
matt mackallmatt mackall318.75%150.00%
Total16100.00%2100.00%


static inline void netpoll_poll_unlock(void *have) { }

Contributors

PersonTokensPropCommitsCommitProp
stephen hemmingerstephen hemminger770.00%150.00%
matt mackallmatt mackall330.00%150.00%
Total10100.00%2100.00%


static inline void netpoll_netdev_init(struct net_device *dev) { }

Contributors

PersonTokensPropCommitsCommitProp
stephen hemmingerstephen hemminger11100.00%1100.00%
Total11100.00%1100.00%


static inline bool netpoll_tx_running(struct net_device *dev) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu1386.67%150.00%
americo wangamerico wang213.33%150.00%
Total15100.00%2100.00%

#endif #endif

Overall Contributors

PersonTokensPropCommitsCommitProp
matt mackallmatt mackall15832.05%414.29%
neil hormanneil horman8517.24%414.29%
americo wangamerico wang7515.21%517.86%
stephen hemmingerstephen hemminger6613.39%414.29%
herbert xuherbert xu469.33%27.14%
eric w. biedermaneric w. biederman295.88%27.14%
jeff moyerjeff moyer153.04%27.14%
satyam sharmasatyam sharma91.83%13.57%
jiri pirkojiri pirko51.01%13.57%
ding tianhongding tianhong30.61%13.57%
david s. millerdavid s. miller10.20%13.57%
david howellsdavid howells10.20%13.57%
Total493100.00%28100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}