cregit-Linux how code gets into the kernel

Release 4.12 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 Horman1076.92%133.33%
Ding Tianhong215.38%133.33%
Eric W. Biedermann17.69%133.33%
Total13100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Neil Horman1292.31%150.00%
Eric W. Biedermann17.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 Horman2866.67%150.00%
Américo 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) { int owner = smp_processor_id(); while (cmpxchg(&napi->poll_owner, -1, owner) != -1) cpu_relax(); return napi; } return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Matt Mackall2944.62%240.00%
Eric Dumazet2030.77%120.00%
Stephen Hemminger1523.08%120.00%
Jeff Moyer11.54%120.00%
Total65100.00%5100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Matt Mackall2163.64%240.00%
Jeff Moyer412.12%120.00%
Eric Dumazet412.12%120.00%
Stephen Hemminger412.12%120.00%
Total33100.00%5100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Herbert Xu1593.75%150.00%
Américo Wang16.25%150.00%
Total16100.00%2100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
Stephen Hemminger1381.25%150.00%
Matt Mackall318.75%150.00%
Total16100.00%2100.00%


static inline void netpoll_poll_unlock(void *have) { }

Contributors

PersonTokensPropCommitsCommitProp
Stephen Hemminger770.00%150.00%
Matt Mackall330.00%150.00%
Total10100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Stephen Hemminger11100.00%1100.00%
Total11100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Herbert Xu1386.67%150.00%
Américo Wang213.33%150.00%
Total15100.00%2100.00%

#endif #endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Matt Mackall14829.66%414.29%
Neil Horman8517.03%414.29%
Américo Wang7515.03%517.86%
Stephen Hemminger6412.83%414.29%
Herbert Xu469.22%27.14%
Eric W. Biedermann295.81%27.14%
Eric Dumazet244.81%13.57%
Jeff Moyer102.00%27.14%
Satyam Sharma91.80%13.57%
Jiri Pirko51.00%13.57%
Ding Tianhong30.60%13.57%
David Howells10.20%13.57%
Total499100.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.
Created with cregit.