Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
netdevice.h File Reference
#include <linux/pm_qos.h>
#include <linux/timer.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/atomic.h>
#include <asm/cache.h>
#include <asm/byteorder.h>
#include <linux/percpu.h>
#include <linux/rculist.h>
#include <linux/dmaengine.h>
#include <linux/workqueue.h>
#include <linux/dynamic_queue_limits.h>
#include <linux/ethtool.h>
#include <net/net_namespace.h>
#include <net/dsa.h>
#include <net/netprio_cgroup.h>
#include <linux/netdev_features.h>
#include <linux/neighbour.h>
#include <uapi/linux/netdevice.h>
#include <linux/cache.h>
#include <linux/skbuff.h>
#include <linux/notifier.h>

Go to the source code of this file.

Data Structures

struct  net_device_stats
 
struct  netdev_hw_addr
 
struct  netdev_hw_addr_list
 
struct  hh_cache
 
struct  header_ops
 
struct  netdev_boot_setup
 
struct  napi_struct
 
struct  netdev_queue
 
struct  netdev_tc_txq
 
struct  net_device_ops
 
struct  net_device
 
struct  napi_gro_cb
 
struct  packet_type
 
struct  softnet_data
 

Macros

#define SET_ETHTOOL_OPS(netdev, ops)   ( (netdev)->ethtool_ops = (ops) )
 
#define NET_ADDR_PERM   0 /* address is permanent (default) */
 
#define NET_ADDR_RANDOM   1 /* address is generated randomly */
 
#define NET_ADDR_STOLEN   2 /* address is stolen from other device */
 
#define NET_RX_SUCCESS   0 /* keep 'em coming, baby */
 
#define NET_RX_DROP   1 /* packet dropped */
 
#define NET_XMIT_SUCCESS   0x00
 
#define NET_XMIT_DROP   0x01 /* skb dropped */
 
#define NET_XMIT_CN   0x02 /* congestion notification */
 
#define NET_XMIT_POLICED   0x03 /* skb is shot by police */
 
#define NET_XMIT_MASK   0x0f /* qdisc flags in net/sch_generic.h */
 
#define net_xmit_eval(e)   ((e) == NET_XMIT_CN ? 0 : (e))
 
#define net_xmit_errno(e)   ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
 
#define NETDEV_TX_MASK   0xf0
 
#define LL_MAX_HEADER   32
 
#define MAX_HEADER   LL_MAX_HEADER
 
#define NETDEV_HW_ADDR_T_LAN   1
 
#define NETDEV_HW_ADDR_T_SAN   2
 
#define NETDEV_HW_ADDR_T_SLAVE   3
 
#define NETDEV_HW_ADDR_T_UNICAST   4
 
#define NETDEV_HW_ADDR_T_MULTICAST   5
 
#define netdev_hw_addr_list_count(l)   ((l)->count)
 
#define netdev_hw_addr_list_empty(l)   (netdev_hw_addr_list_count(l) == 0)
 
#define netdev_hw_addr_list_for_each(ha, l)   list_for_each_entry(ha, &(l)->list, list)
 
#define netdev_uc_count(dev)   netdev_hw_addr_list_count(&(dev)->uc)
 
#define netdev_uc_empty(dev)   netdev_hw_addr_list_empty(&(dev)->uc)
 
#define netdev_for_each_uc_addr(ha, dev)   netdev_hw_addr_list_for_each(ha, &(dev)->uc)
 
#define netdev_mc_count(dev)   netdev_hw_addr_list_count(&(dev)->mc)
 
#define netdev_mc_empty(dev)   netdev_hw_addr_list_empty(&(dev)->mc)
 
#define netdev_for_each_mc_addr(ha, dev)   netdev_hw_addr_list_for_each(ha, &(dev)->mc)
 
#define HH_DATA_MOD   16
 
#define HH_DATA_OFF(__len)   (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))
 
#define HH_DATA_ALIGN(__len)   (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
 
#define LL_RESERVED_SPACE(dev)   ((((dev)->hard_header_len+(dev)->needed_headroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
 
#define LL_RESERVED_SPACE_EXTRA(dev, extra)   ((((dev)->hard_header_len+(dev)->needed_headroom+(extra))&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
 
#define NETDEV_BOOT_SETUP_MAX   8
 
#define napi_synchronize(n)   barrier()
 
#define QUEUE_STATE_ANY_XOFF
 
#define QUEUE_STATE_ANY_XOFF_OR_FROZEN
 
#define TC_MAX_QUEUE   16
 
#define TC_BITMASK   15
 
#define GSO_MAX_SIZE   65536
 
#define GSO_MAX_SEGS   65535
 
#define to_net_dev(d)   container_of(d, struct net_device, dev)
 
#define NETDEV_ALIGN   32
 
#define SET_NETDEV_DEV(net, pdev)   ((net)->dev.parent = (pdev))
 
#define SET_NETDEV_DEVTYPE(net, devtype)   ((net)->dev.type = (devtype))
 
#define NAPI_GRO_FREE   1
 
#define NAPI_GRO_FREE_STOLEN_HEAD   2
 
#define NAPI_GRO_CB(skb)   ((struct napi_gro_cb *)(skb)->cb)
 
#define NETDEV_UP   0x0001 /* For now you can't veto a device up/down */
 
#define NETDEV_DOWN   0x0002
 
#define NETDEV_REBOOT
 
#define NETDEV_CHANGE   0x0004 /* Notify device state change */
 
#define NETDEV_REGISTER   0x0005
 
#define NETDEV_UNREGISTER   0x0006
 
#define NETDEV_CHANGEMTU   0x0007
 
#define NETDEV_CHANGEADDR   0x0008
 
#define NETDEV_GOING_DOWN   0x0009
 
#define NETDEV_CHANGENAME   0x000A
 
#define NETDEV_FEAT_CHANGE   0x000B
 
#define NETDEV_BONDING_FAILOVER   0x000C
 
#define NETDEV_PRE_UP   0x000D
 
#define NETDEV_PRE_TYPE_CHANGE   0x000E
 
#define NETDEV_POST_TYPE_CHANGE   0x000F
 
#define NETDEV_POST_INIT   0x0010
 
#define NETDEV_UNREGISTER_FINAL   0x0011
 
#define NETDEV_RELEASE   0x0012
 
#define NETDEV_NOTIFY_PEERS   0x0013
 
#define NETDEV_JOIN   0x0014
 
#define for_each_netdev(net, d)   list_for_each_entry(d, &(net)->dev_base_head, dev_list)
 
#define for_each_netdev_reverse(net, d)   list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list)
 
#define for_each_netdev_rcu(net, d)   list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
 
#define for_each_netdev_safe(net, d, n)   list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)
 
#define for_each_netdev_continue(net, d)   list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
 
#define for_each_netdev_continue_rcu(net, d)   list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
 
#define net_device_entry(lh)   list_entry(lh, struct net_device, dev_list)
 
#define DEFAULT_MAX_NUM_RSS_QUEUES   (8)
 
#define netif_msg_drv(p)   ((p)->msg_enable & NETIF_MSG_DRV)
 
#define netif_msg_probe(p)   ((p)->msg_enable & NETIF_MSG_PROBE)
 
#define netif_msg_link(p)   ((p)->msg_enable & NETIF_MSG_LINK)
 
#define netif_msg_timer(p)   ((p)->msg_enable & NETIF_MSG_TIMER)
 
#define netif_msg_ifdown(p)   ((p)->msg_enable & NETIF_MSG_IFDOWN)
 
#define netif_msg_ifup(p)   ((p)->msg_enable & NETIF_MSG_IFUP)
 
#define netif_msg_rx_err(p)   ((p)->msg_enable & NETIF_MSG_RX_ERR)
 
#define netif_msg_tx_err(p)   ((p)->msg_enable & NETIF_MSG_TX_ERR)
 
#define netif_msg_tx_queued(p)   ((p)->msg_enable & NETIF_MSG_TX_QUEUED)
 
#define netif_msg_intr(p)   ((p)->msg_enable & NETIF_MSG_INTR)
 
#define netif_msg_tx_done(p)   ((p)->msg_enable & NETIF_MSG_TX_DONE)
 
#define netif_msg_rx_status(p)   ((p)->msg_enable & NETIF_MSG_RX_STATUS)
 
#define netif_msg_pktdata(p)   ((p)->msg_enable & NETIF_MSG_PKTDATA)
 
#define netif_msg_hw(p)   ((p)->msg_enable & NETIF_MSG_HW)
 
#define netif_msg_wol(p)   ((p)->msg_enable & NETIF_MSG_WOL)
 
#define HARD_TX_LOCK(dev, txq, cpu)
 
#define HARD_TX_UNLOCK(dev, txq)
 
#define for_each_dev_addr(dev, ha)   list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list)
 
#define alloc_netdev(sizeof_priv, name, setup)   alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
 
#define alloc_netdev_mq(sizeof_priv, name, setup, count)   alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
 
#define MODULE_ALIAS_NETDEV(device)   MODULE_ALIAS("netdev-" device)
 
#define netdev_dbg(__dev, format, args...)
 
#define netdev_vdbg(dev, format, args...)
 
#define netdev_WARN(dev, format, args...)   WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
 
#define netif_printk(priv, type, level, dev, fmt, args...)
 
#define netif_level(level, priv, type, dev, fmt, args...)
 
#define netif_emerg(priv, type, dev, fmt, args...)   netif_level(emerg, priv, type, dev, fmt, ##args)
 
#define netif_alert(priv, type, dev, fmt, args...)   netif_level(alert, priv, type, dev, fmt, ##args)
 
#define netif_crit(priv, type, dev, fmt, args...)   netif_level(crit, priv, type, dev, fmt, ##args)
 
#define netif_err(priv, type, dev, fmt, args...)   netif_level(err, priv, type, dev, fmt, ##args)
 
#define netif_warn(priv, type, dev, fmt, args...)   netif_level(warn, priv, type, dev, fmt, ##args)
 
#define netif_notice(priv, type, dev, fmt, args...)   netif_level(notice, priv, type, dev, fmt, ##args)
 
#define netif_info(priv, type, dev, fmt, args...)   netif_level(info, priv, type, dev, fmt, ##args)
 
#define netif_dbg(priv, type, dev, format, args...)
 
#define netif_vdbg(priv, type, dev, format, args...)
 

Typedefs

typedef enum netdev_tx netdev_tx_t
 
typedef enum gro_result gro_result_t
 
typedef enum rx_handler_result rx_handler_result_t
 
typedef rx_handler_result_t rx_handler_func_t (struct sk_buff **pskb)
 
typedef int gifconf_func_t (struct net_device *dev, char __user *bufptr, int len)
 

Enumerations

enum  netdev_tx { __NETDEV_TX_MIN = INT_MIN, NETDEV_TX_OK = 0x00, NETDEV_TX_BUSY = 0x10, NETDEV_TX_LOCKED = 0x20 }
 
enum  netdev_state_t {
  __LINK_STATE_START, __LINK_STATE_PRESENT, __LINK_STATE_NOCARRIER, __LINK_STATE_LINKWATCH_PENDING,
  __LINK_STATE_DORMANT
}
 
enum  { NAPI_STATE_SCHED, NAPI_STATE_DISABLE, NAPI_STATE_NPSVC }
 
enum  gro_result {
  GRO_MERGED, GRO_MERGED_FREE, GRO_HELD, GRO_NORMAL,
  GRO_DROP
}
 
enum  rx_handler_result { RX_HANDLER_CONSUMED, RX_HANDLER_ANOTHER, RX_HANDLER_EXACT, RX_HANDLER_PASS }
 
enum  netdev_queue_state_t { __QUEUE_STATE_DRV_XOFF, __QUEUE_STATE_STACK_XOFF, __QUEUE_STATE_FROZEN }
 
enum  {
  NETIF_MSG_DRV = 0x0001, NETIF_MSG_PROBE = 0x0002, NETIF_MSG_LINK = 0x0004, NETIF_MSG_TIMER = 0x0008,
  NETIF_MSG_IFDOWN = 0x0010, NETIF_MSG_IFUP = 0x0020, NETIF_MSG_RX_ERR = 0x0040, NETIF_MSG_TX_ERR = 0x0080,
  NETIF_MSG_TX_QUEUED = 0x0100, NETIF_MSG_INTR = 0x0200, NETIF_MSG_TX_DONE = 0x0400, NETIF_MSG_RX_STATUS = 0x0800,
  NETIF_MSG_PKTDATA = 0x1000, NETIF_MSG_HW = 0x2000, NETIF_MSG_WOL = 0x4000
}
 

Functions

int __init netdev_boot_setup (char *str)
 
void __napi_schedule (struct napi_struct *n)
 
void __napi_complete (struct napi_struct *n)
 
void napi_complete (struct napi_struct *n)
 
struct netdev_queuenetdev_pick_tx (struct net_device *dev, struct sk_buff *skb)
 
void netif_napi_add (struct net_device *dev, struct napi_struct *napi, int(*poll)(struct napi_struct *, int), int weight)
 
void netif_napi_del (struct napi_struct *napi)
 
int register_netdevice_notifier (struct notifier_block *nb)
 
int unregister_netdevice_notifier (struct notifier_block *nb)
 
int call_netdevice_notifiers (unsigned long val, struct net_device *dev)
 
int netdev_boot_setup_check (struct net_device *dev)
 
unsigned long netdev_boot_base (const char *prefix, int unit)
 
struct net_devicedev_getbyhwaddr_rcu (struct net *net, unsigned short type, const char *hwaddr)
 
struct net_devicedev_getfirstbyhwtype (struct net *net, unsigned short type)
 
struct net_device__dev_getfirstbyhwtype (struct net *net, unsigned short type)
 
void dev_add_pack (struct packet_type *pt)
 
void dev_remove_pack (struct packet_type *pt)
 
void __dev_remove_pack (struct packet_type *pt)
 
struct net_devicedev_get_by_flags_rcu (struct net *net, unsigned short flags, unsigned short mask)
 
struct net_devicedev_get_by_name (struct net *net, const char *name)
 
struct net_devicedev_get_by_name_rcu (struct net *net, const char *name)
 
struct net_device__dev_get_by_name (struct net *net, const char *name)
 
int dev_alloc_name (struct net_device *dev, const char *name)
 
int dev_open (struct net_device *dev)
 
int dev_close (struct net_device *dev)
 
void dev_disable_lro (struct net_device *dev)
 
int dev_loopback_xmit (struct sk_buff *newskb)
 
int dev_queue_xmit (struct sk_buff *skb)
 
int register_netdevice (struct net_device *dev)
 
void unregister_netdevice_queue (struct net_device *dev, struct list_head *head)
 
void unregister_netdevice_many (struct list_head *head)
 
int netdev_refcnt_read (const struct net_device *dev)
 
void free_netdev (struct net_device *dev)
 
void synchronize_net (void)
 
int init_dummy_netdev (struct net_device *dev)
 
void netdev_resync_ops (struct net_device *dev)
 
struct net_devicedev_get_by_index (struct net *net, int ifindex)
 
struct net_device__dev_get_by_index (struct net *net, int ifindex)
 
struct net_devicedev_get_by_index_rcu (struct net *net, int ifindex)
 
int dev_restart (struct net_device *dev)
 
int skb_gro_receive (struct sk_buff **head, struct sk_buff *skb)
 
int register_gifconf (unsigned int family, gifconf_func_t *gifconf)
 
 DECLARE_PER_CPU_ALIGNED (struct softnet_data, softnet_data)
 
void __netif_schedule (struct Qdisc *q)
 
int netif_set_real_num_tx_queues (struct net_device *dev, unsigned int txq)
 
int netif_get_num_default_rss_queues (void)
 
void dev_kfree_skb_irq (struct sk_buff *skb)
 
void dev_kfree_skb_any (struct sk_buff *skb)
 
int netif_rx (struct sk_buff *skb)
 
int netif_rx_ni (struct sk_buff *skb)
 
int netif_receive_skb (struct sk_buff *skb)
 
gro_result_t dev_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 
gro_result_t napi_skb_finish (gro_result_t ret, struct sk_buff *skb)
 
gro_result_t napi_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 
void napi_gro_flush (struct napi_struct *napi, bool flush_old)
 
struct sk_buffnapi_get_frags (struct napi_struct *napi)
 
gro_result_t napi_frags_finish (struct napi_struct *napi, struct sk_buff *skb, gro_result_t ret)
 
gro_result_t napi_gro_frags (struct napi_struct *napi)
 
int netdev_rx_handler_register (struct net_device *dev, rx_handler_func_t *rx_handler, void *rx_handler_data)
 
void netdev_rx_handler_unregister (struct net_device *dev)
 
bool dev_valid_name (const char *name)
 
int dev_ioctl (struct net *net, unsigned int cmd, void __user *)
 
int dev_ethtool (struct net *net, struct ifreq *)
 
unsigned int dev_get_flags (const struct net_device *)
 
int __dev_change_flags (struct net_device *, unsigned int flags)
 
int dev_change_flags (struct net_device *, unsigned int)
 
void __dev_notify_flags (struct net_device *, unsigned int old_flags)
 
int dev_change_name (struct net_device *, const char *)
 
int dev_set_alias (struct net_device *, const char *, size_t)
 
int dev_change_net_namespace (struct net_device *, struct net *, const char *)
 
int dev_set_mtu (struct net_device *, int)
 
void dev_set_group (struct net_device *, int)
 
int dev_set_mac_address (struct net_device *, struct sockaddr *)
 
int dev_hard_start_xmit (struct sk_buff *skb, struct net_device *dev, struct netdev_queue *txq)
 
int dev_forward_skb (struct net_device *dev, struct sk_buff *skb)
 
void netdev_run_todo (void)
 
void linkwatch_init_dev (struct net_device *dev)
 
void linkwatch_fire_event (struct net_device *dev)
 
void linkwatch_forget_dev (struct net_device *dev)
 
unsigned long dev_trans_start (struct net_device *dev)
 
void __netdev_watchdog_up (struct net_device *dev)
 
void netif_carrier_on (struct net_device *dev)
 
void netif_carrier_off (struct net_device *dev)
 
void netif_device_detach (struct net_device *dev)
 
void netif_device_attach (struct net_device *dev)
 
void ether_setup (struct net_device *dev)
 
struct net_devicealloc_netdev_mqs (int sizeof_priv, const char *name, void(*setup)(struct net_device *), unsigned int txqs, unsigned int rxqs)
 
int register_netdev (struct net_device *dev)
 
void unregister_netdev (struct net_device *dev)
 
int __hw_addr_add_multiple (struct netdev_hw_addr_list *to_list, struct netdev_hw_addr_list *from_list, int addr_len, unsigned char addr_type)
 
void __hw_addr_del_multiple (struct netdev_hw_addr_list *to_list, struct netdev_hw_addr_list *from_list, int addr_len, unsigned char addr_type)
 
int __hw_addr_sync (struct netdev_hw_addr_list *to_list, struct netdev_hw_addr_list *from_list, int addr_len)
 
void __hw_addr_unsync (struct netdev_hw_addr_list *to_list, struct netdev_hw_addr_list *from_list, int addr_len)
 
void __hw_addr_flush (struct netdev_hw_addr_list *list)
 
void __hw_addr_init (struct netdev_hw_addr_list *list)
 
int dev_addr_add (struct net_device *dev, const unsigned char *addr, unsigned char addr_type)
 
int dev_addr_del (struct net_device *dev, const unsigned char *addr, unsigned char addr_type)
 
int dev_addr_add_multiple (struct net_device *to_dev, struct net_device *from_dev, unsigned char addr_type)
 
int dev_addr_del_multiple (struct net_device *to_dev, struct net_device *from_dev, unsigned char addr_type)
 
void dev_addr_flush (struct net_device *dev)
 
int dev_addr_init (struct net_device *dev)
 
int dev_uc_add (struct net_device *dev, const unsigned char *addr)
 
int dev_uc_add_excl (struct net_device *dev, const unsigned char *addr)
 
int dev_uc_del (struct net_device *dev, const unsigned char *addr)
 
int dev_uc_sync (struct net_device *to, struct net_device *from)
 
void dev_uc_unsync (struct net_device *to, struct net_device *from)
 
void dev_uc_flush (struct net_device *dev)
 
void dev_uc_init (struct net_device *dev)
 
int dev_mc_add (struct net_device *dev, const unsigned char *addr)
 
int dev_mc_add_global (struct net_device *dev, const unsigned char *addr)
 
int dev_mc_add_excl (struct net_device *dev, const unsigned char *addr)
 
int dev_mc_del (struct net_device *dev, const unsigned char *addr)
 
int dev_mc_del_global (struct net_device *dev, const unsigned char *addr)
 
int dev_mc_sync (struct net_device *to, struct net_device *from)
 
void dev_mc_unsync (struct net_device *to, struct net_device *from)
 
void dev_mc_flush (struct net_device *dev)
 
void dev_mc_init (struct net_device *dev)
 
void dev_set_rx_mode (struct net_device *dev)
 
void __dev_set_rx_mode (struct net_device *dev)
 
int dev_set_promiscuity (struct net_device *dev, int inc)
 
int dev_set_allmulti (struct net_device *dev, int inc)
 
void netdev_state_change (struct net_device *dev)
 
void netdev_notify_peers (struct net_device *dev)
 
void netdev_features_change (struct net_device *dev)
 
void dev_load (struct net *net, const char *name)
 
void dev_mcast_init (void)
 
struct rtnl_link_stats64dev_get_stats (struct net_device *dev, struct rtnl_link_stats64 *storage)
 
void netdev_stats_to_stats64 (struct rtnl_link_stats64 *stats64, const struct net_device_stats *netdev_stats)
 
int netdev_set_master (struct net_device *dev, struct net_device *master)
 
int netdev_set_bond_master (struct net_device *dev, struct net_device *master)
 
int skb_checksum_help (struct sk_buff *skb)
 
struct sk_buffskb_gso_segment (struct sk_buff *skb, netdev_features_t features)
 
void net_enable_timestamp (void)
 
void net_disable_timestamp (void)
 
int netdev_class_create_file (struct class_attribute *class_attr)
 
void netdev_class_remove_file (struct class_attribute *class_attr)
 
const charnetdev_drivername (const struct net_device *dev)
 
void linkwatch_run_queue (void)
 
netdev_features_t netdev_increment_features (netdev_features_t all, netdev_features_t one, netdev_features_t mask)
 
int __netdev_update_features (struct net_device *dev)
 
void netdev_update_features (struct net_device *dev)
 
void netdev_change_features (struct net_device *dev)
 
void netif_stacked_transfer_operstate (const struct net_device *rootdev, struct net_device *dev)
 
netdev_features_t netif_skb_features (struct sk_buff *skb)
 
 __printf (3, 4) int netdev_printk(const char *level
 
struct net_device const char __printf (2, 3) int netdev_emerg(const struct net_device *dev
 

Variables

struct netdev_queue ____cacheline_aligned_in_smp
 
rwlock_t dev_base_lock
 
int netdev_budget
 
int netdev_max_backlog
 
int netdev_tstamp_prequeue
 
int weight_p
 
int bpf_jit_enable
 
struct kobj_ns_type_operations net_ns_type_operations
 
struct pernet_operations
__net_initdata 
loopback_net_ops
 
struct net_devicedev
 
struct net_device const charformat
 

Macro Definition Documentation

#define alloc_netdev (   sizeof_priv,
  name,
  setup 
)    alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)

Definition at line 2518 of file netdevice.h.

#define alloc_netdev_mq (   sizeof_priv,
  name,
  setup,
  count 
)    alloc_netdev_mqs(sizeof_priv, name, setup, count, count)

Definition at line 2521 of file netdevice.h.

#define DEFAULT_MAX_NUM_RSS_QUEUES   (8)

Definition at line 2114 of file netdevice.h.

#define for_each_dev_addr (   dev,
  ha 
)    list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list)

Definition at line 2507 of file netdevice.h.

#define for_each_netdev (   net,
  d 
)    list_for_each_entry(d, &(net)->dev_base_head, dev_list)

Definition at line 1552 of file netdevice.h.

#define for_each_netdev_continue (   net,
  d 
)    list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)

Definition at line 1560 of file netdevice.h.

#define for_each_netdev_continue_rcu (   net,
  d 
)    list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)

Definition at line 1562 of file netdevice.h.

#define for_each_netdev_rcu (   net,
  d 
)    list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)

Definition at line 1556 of file netdevice.h.

#define for_each_netdev_reverse (   net,
  d 
)    list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list)

Definition at line 1554 of file netdevice.h.

#define for_each_netdev_safe (   net,
  d,
  n 
)    list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)

Definition at line 1558 of file netdevice.h.

#define GSO_MAX_SEGS   65535

Definition at line 1276 of file netdevice.h.

#define GSO_MAX_SIZE   65536

Definition at line 1274 of file netdevice.h.

#define HARD_TX_LOCK (   dev,
  txq,
  cpu 
)
Value:
{ \
if ((dev->features & NETIF_F_LLTX) == 0) { \
__netif_tx_lock(txq, cpu); \
} \
}

Definition at line 2449 of file netdevice.h.

#define HARD_TX_UNLOCK (   dev,
  txq 
)
Value:
{ \
if ((dev->features & NETIF_F_LLTX) == 0) { \
__netif_tx_unlock(txq); \
} \
}

Definition at line 2455 of file netdevice.h.

#define HH_DATA_ALIGN (   __len)    (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))

Definition at line 243 of file netdevice.h.

#define HH_DATA_MOD   16

Definition at line 240 of file netdevice.h.

#define HH_DATA_OFF (   __len)    (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))

Definition at line 241 of file netdevice.h.

#define LL_MAX_HEADER   32

Definition at line 145 of file netdevice.h.

#define LL_RESERVED_SPACE (   dev)    ((((dev)->hard_header_len+(dev)->needed_headroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)

Definition at line 256 of file netdevice.h.

#define LL_RESERVED_SPACE_EXTRA (   dev,
  extra 
)    ((((dev)->hard_header_len+(dev)->needed_headroom+(extra))&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)

Definition at line 258 of file netdevice.h.

#define MAX_HEADER   LL_MAX_HEADER

Definition at line 150 of file netdevice.h.

#define MODULE_ALIAS_NETDEV (   device)    MODULE_ALIAS("netdev-" device)

Definition at line 2721 of file netdevice.h.

#define NAPI_GRO_CB (   skb)    ((struct napi_gro_cb *)(skb)->cb)

Definition at line 1496 of file netdevice.h.

#define NAPI_GRO_FREE   1

Definition at line 1483 of file netdevice.h.

#define NAPI_GRO_FREE_STOLEN_HEAD   2

Definition at line 1484 of file netdevice.h.

#define napi_synchronize (   n)    barrier()

Definition at line 488 of file netdevice.h.

#define NET_ADDR_PERM   0 /* address is permanent (default) */

Definition at line 64 of file netdevice.h.

#define NET_ADDR_RANDOM   1 /* address is generated randomly */

Definition at line 65 of file netdevice.h.

#define NET_ADDR_STOLEN   2 /* address is stolen from other device */

Definition at line 66 of file netdevice.h.

#define net_device_entry (   lh)    list_entry(lh, struct net_device, dev_list)

Definition at line 1564 of file netdevice.h.

#define NET_RX_DROP   1 /* packet dropped */

Definition at line 70 of file netdevice.h.

#define NET_RX_SUCCESS   0 /* keep 'em coming, baby */

Definition at line 69 of file netdevice.h.

#define NET_XMIT_CN   0x02 /* congestion notification */

Definition at line 92 of file netdevice.h.

#define NET_XMIT_DROP   0x01 /* skb dropped */

Definition at line 91 of file netdevice.h.

#define net_xmit_errno (   e)    ((e) != NET_XMIT_CN ? -ENOBUFS : 0)

Definition at line 100 of file netdevice.h.

#define net_xmit_eval (   e)    ((e) == NET_XMIT_CN ? 0 : (e))

Definition at line 99 of file netdevice.h.

#define NET_XMIT_MASK   0x0f /* qdisc flags in net/sch_generic.h */

Definition at line 94 of file netdevice.h.

#define NET_XMIT_POLICED   0x03 /* skb is shot by police */

Definition at line 93 of file netdevice.h.

#define NET_XMIT_SUCCESS   0x00

Definition at line 90 of file netdevice.h.

#define NETDEV_ALIGN   32

Definition at line 1306 of file netdevice.h.

#define NETDEV_BONDING_FAILOVER   0x000C

Definition at line 1534 of file netdevice.h.

#define NETDEV_BOOT_SETUP_MAX   8

Definition at line 295 of file netdevice.h.

#define NETDEV_CHANGE   0x0004 /* Notify device state change */

Definition at line 1526 of file netdevice.h.

#define NETDEV_CHANGEADDR   0x0008

Definition at line 1530 of file netdevice.h.

#define NETDEV_CHANGEMTU   0x0007

Definition at line 1529 of file netdevice.h.

#define NETDEV_CHANGENAME   0x000A

Definition at line 1532 of file netdevice.h.

#define netdev_dbg (   __dev,
  format,
  args... 
)
Value:
({ \
if (0) \
netdev_printk(KERN_DEBUG, __dev, format, ##args); \
0; \
})

Definition at line 2733 of file netdevice.h.

#define NETDEV_DOWN   0x0002

Definition at line 1524 of file netdevice.h.

#define NETDEV_FEAT_CHANGE   0x000B

Definition at line 1533 of file netdevice.h.

#define netdev_for_each_mc_addr (   ha,
  dev 
)    netdev_hw_addr_list_for_each(ha, &(dev)->mc)

Definition at line 231 of file netdevice.h.

#define netdev_for_each_uc_addr (   ha,
  dev 
)    netdev_hw_addr_list_for_each(ha, &(dev)->uc)

Definition at line 226 of file netdevice.h.

#define NETDEV_GOING_DOWN   0x0009

Definition at line 1531 of file netdevice.h.

#define netdev_hw_addr_list_count (   l)    ((l)->count)

Definition at line 219 of file netdevice.h.

#define netdev_hw_addr_list_empty (   l)    (netdev_hw_addr_list_count(l) == 0)

Definition at line 220 of file netdevice.h.

#define netdev_hw_addr_list_for_each (   ha,
  l 
)    list_for_each_entry(ha, &(l)->list, list)

Definition at line 221 of file netdevice.h.

#define NETDEV_HW_ADDR_T_LAN   1

Definition at line 203 of file netdevice.h.

#define NETDEV_HW_ADDR_T_MULTICAST   5

Definition at line 207 of file netdevice.h.

#define NETDEV_HW_ADDR_T_SAN   2

Definition at line 204 of file netdevice.h.

#define NETDEV_HW_ADDR_T_SLAVE   3

Definition at line 205 of file netdevice.h.

#define NETDEV_HW_ADDR_T_UNICAST   4

Definition at line 206 of file netdevice.h.

#define NETDEV_JOIN   0x0014

Definition at line 1542 of file netdevice.h.

#define netdev_mc_count (   dev)    netdev_hw_addr_list_count(&(dev)->mc)

Definition at line 229 of file netdevice.h.

#define netdev_mc_empty (   dev)    netdev_hw_addr_list_empty(&(dev)->mc)

Definition at line 230 of file netdevice.h.

#define NETDEV_NOTIFY_PEERS   0x0013

Definition at line 1541 of file netdevice.h.

#define NETDEV_POST_INIT   0x0010

Definition at line 1538 of file netdevice.h.

#define NETDEV_POST_TYPE_CHANGE   0x000F

Definition at line 1537 of file netdevice.h.

#define NETDEV_PRE_TYPE_CHANGE   0x000E

Definition at line 1536 of file netdevice.h.

#define NETDEV_PRE_UP   0x000D

Definition at line 1535 of file netdevice.h.

#define NETDEV_REBOOT
Value:
0x0003 /* Tell a protocol stack a network interface
detected a hardware crash and restarted
- we can use this eg to kick tcp sessions
once done */

Definition at line 1525 of file netdevice.h.

#define NETDEV_REGISTER   0x0005

Definition at line 1527 of file netdevice.h.

#define NETDEV_RELEASE   0x0012

Definition at line 1540 of file netdevice.h.

#define NETDEV_TX_MASK   0xf0

Definition at line 103 of file netdevice.h.

#define netdev_uc_count (   dev)    netdev_hw_addr_list_count(&(dev)->uc)

Definition at line 224 of file netdevice.h.

#define netdev_uc_empty (   dev)    netdev_hw_addr_list_empty(&(dev)->uc)

Definition at line 225 of file netdevice.h.

#define NETDEV_UNREGISTER   0x0006

Definition at line 1528 of file netdevice.h.

#define NETDEV_UNREGISTER_FINAL   0x0011

Definition at line 1539 of file netdevice.h.

#define NETDEV_UP   0x0001 /* For now you can't veto a device up/down */

Definition at line 1523 of file netdevice.h.

#define netdev_vdbg (   dev,
  format,
  args... 
)
Value:
({ \
if (0) \
netdev_printk(KERN_DEBUG, dev, format, ##args); \
0; \
})

Definition at line 2745 of file netdevice.h.

#define netdev_WARN (   dev,
  format,
  args... 
)    WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);

Definition at line 2758 of file netdevice.h.

#define netif_alert (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(alert, priv, type, dev, fmt, ##args)

Definition at line 2777 of file netdevice.h.

#define netif_crit (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(crit, priv, type, dev, fmt, ##args)

Definition at line 2779 of file netdevice.h.

#define netif_dbg (   priv,
  type,
  dev,
  format,
  args... 
)
Value:
({ \
if (0) \
netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
0; \
})

Definition at line 2800 of file netdevice.h.

#define netif_emerg (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(emerg, priv, type, dev, fmt, ##args)

Definition at line 2775 of file netdevice.h.

#define netif_err (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(err, priv, type, dev, fmt, ##args)

Definition at line 2781 of file netdevice.h.

#define netif_info (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(info, priv, type, dev, fmt, ##args)

Definition at line 2787 of file netdevice.h.

#define netif_level (   level,
  priv,
  type,
  dev,
  fmt,
  args... 
)
Value:
do { \
if (netif_msg_##type(priv)) \
netdev_##level(dev, fmt, ##args); \
} while (0)

Definition at line 2769 of file netdevice.h.

#define netif_msg_drv (   p)    ((p)->msg_enable & NETIF_MSG_DRV)

Definition at line 2327 of file netdevice.h.

#define netif_msg_hw (   p)    ((p)->msg_enable & NETIF_MSG_HW)

Definition at line 2340 of file netdevice.h.

#define netif_msg_ifdown (   p)    ((p)->msg_enable & NETIF_MSG_IFDOWN)

Definition at line 2331 of file netdevice.h.

#define netif_msg_ifup (   p)    ((p)->msg_enable & NETIF_MSG_IFUP)

Definition at line 2332 of file netdevice.h.

#define netif_msg_intr (   p)    ((p)->msg_enable & NETIF_MSG_INTR)

Definition at line 2336 of file netdevice.h.

#define netif_msg_link (   p)    ((p)->msg_enable & NETIF_MSG_LINK)

Definition at line 2329 of file netdevice.h.

#define netif_msg_pktdata (   p)    ((p)->msg_enable & NETIF_MSG_PKTDATA)

Definition at line 2339 of file netdevice.h.

#define netif_msg_probe (   p)    ((p)->msg_enable & NETIF_MSG_PROBE)

Definition at line 2328 of file netdevice.h.

#define netif_msg_rx_err (   p)    ((p)->msg_enable & NETIF_MSG_RX_ERR)

Definition at line 2333 of file netdevice.h.

#define netif_msg_rx_status (   p)    ((p)->msg_enable & NETIF_MSG_RX_STATUS)

Definition at line 2338 of file netdevice.h.

#define netif_msg_timer (   p)    ((p)->msg_enable & NETIF_MSG_TIMER)

Definition at line 2330 of file netdevice.h.

#define netif_msg_tx_done (   p)    ((p)->msg_enable & NETIF_MSG_TX_DONE)

Definition at line 2337 of file netdevice.h.

#define netif_msg_tx_err (   p)    ((p)->msg_enable & NETIF_MSG_TX_ERR)

Definition at line 2334 of file netdevice.h.

#define netif_msg_tx_queued (   p)    ((p)->msg_enable & NETIF_MSG_TX_QUEUED)

Definition at line 2335 of file netdevice.h.

#define netif_msg_wol (   p)    ((p)->msg_enable & NETIF_MSG_WOL)

Definition at line 2341 of file netdevice.h.

#define netif_notice (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(notice, priv, type, dev, fmt, ##args)

Definition at line 2785 of file netdevice.h.

#define netif_printk (   priv,
  type,
  level,
  dev,
  fmt,
  args... 
)
Value:
do { \
if (netif_msg_##type(priv)) \
netdev_printk(level, (dev), fmt, ##args); \
} while (0)

Definition at line 2763 of file netdevice.h.

#define netif_vdbg (   priv,
  type,
  dev,
  format,
  args... 
)
Value:
({ \
if (0) \
netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
0; \
})

Definition at line 2811 of file netdevice.h.

#define netif_warn (   priv,
  type,
  dev,
  fmt,
  args... 
)    netif_level(warn, priv, type, dev, fmt, ##args)

Definition at line 2783 of file netdevice.h.

#define QUEUE_STATE_ANY_XOFF
Value:

Definition at line 495 of file netdevice.h.

#define QUEUE_STATE_ANY_XOFF_OR_FROZEN
Value:

Definition at line 497 of file netdevice.h.

#define SET_ETHTOOL_OPS (   netdev,
  ops 
)    ( (netdev)->ethtool_ops = (ops) )

Definition at line 60 of file netdevice.h.

#define SET_NETDEV_DEV (   net,
  pdev 
)    ((net)->dev.parent = (pdev))

Definition at line 1433 of file netdevice.h.

#define SET_NETDEV_DEVTYPE (   net,
  devtype 
)    ((net)->dev.type = (devtype))

Definition at line 1439 of file netdevice.h.

#define TC_BITMASK   15

Definition at line 675 of file netdevice.h.

#define TC_MAX_QUEUE   16

Definition at line 674 of file netdevice.h.

#define to_net_dev (   d)    container_of(d, struct net_device, dev)

Definition at line 1304 of file netdevice.h.

Typedef Documentation

typedef int gifconf_func_t(struct net_device *dev, char __user *bufptr, int len)

Definition at line 1714 of file netdevice.h.

typedef enum gro_result gro_result_t

Definition at line 338 of file netdevice.h.

typedef enum netdev_tx netdev_tx_t

Definition at line 111 of file netdevice.h.

typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb)

Definition at line 388 of file netdevice.h.

Definition at line 387 of file netdevice.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NAPI_STATE_SCHED 
NAPI_STATE_DISABLE 
NAPI_STATE_NPSVC 

Definition at line 325 of file netdevice.h.

anonymous enum
Enumerator:
NETIF_MSG_DRV 
NETIF_MSG_PROBE 
NETIF_MSG_LINK 
NETIF_MSG_TIMER 
NETIF_MSG_IFDOWN 
NETIF_MSG_IFUP 
NETIF_MSG_RX_ERR 
NETIF_MSG_TX_ERR 
NETIF_MSG_TX_QUEUED 
NETIF_MSG_INTR 
NETIF_MSG_TX_DONE 
NETIF_MSG_RX_STATUS 
NETIF_MSG_PKTDATA 
NETIF_MSG_HW 
NETIF_MSG_WOL 

Definition at line 2309 of file netdevice.h.

enum gro_result
Enumerator:
GRO_MERGED 
GRO_MERGED_FREE 
GRO_HELD 
GRO_NORMAL 
GRO_DROP 

Definition at line 331 of file netdevice.h.

Enumerator:
__QUEUE_STATE_DRV_XOFF 
__QUEUE_STATE_STACK_XOFF 
__QUEUE_STATE_FROZEN 

Definition at line 491 of file netdevice.h.

Enumerator:
__LINK_STATE_START 
__LINK_STATE_PRESENT 
__LINK_STATE_NOCARRIER 
__LINK_STATE_LINKWATCH_PENDING 
__LINK_STATE_DORMANT 

Definition at line 278 of file netdevice.h.

enum netdev_tx
Enumerator:
__NETDEV_TX_MIN 
NETDEV_TX_OK 
NETDEV_TX_BUSY 
NETDEV_TX_LOCKED 

Definition at line 105 of file netdevice.h.

Enumerator:
RX_HANDLER_CONSUMED 
RX_HANDLER_ANOTHER 
RX_HANDLER_EXACT 
RX_HANDLER_PASS 

Definition at line 381 of file netdevice.h.

Function Documentation

int __dev_change_flags ( struct net_device ,
unsigned int  flags 
)

Definition at line 4756 of file dev.c.

struct net_device* __dev_get_by_index ( struct net net,
int  ifindex 
)
read

__dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device

Search for an interface by index. Returns NULL if the device is not found or a pointer to the device. The device has not had its reference counter increased so the caller must be careful about locking. The caller must hold either the RTNL semaphore or .

Definition at line 693 of file dev.c.

struct net_device* __dev_get_by_name ( struct net net,
const char name 
)
read

Definition at line 616 of file dev.c.

struct net_device* __dev_getfirstbyhwtype ( struct net net,
unsigned short  type 
)
read

Definition at line 785 of file dev.c.

void __dev_notify_flags ( struct net_device ,
unsigned int  old_flags 
)

Definition at line 4817 of file dev.c.

void __dev_remove_pack ( struct packet_type pt)

__dev_remove_pack - remove packet handler : packet type declaration

Remove a protocol handler that was previously added to the kernel protocol handlers by dev_add_pack(). The passed &packet_type is removed from the kernel lists and can be freed or reused once this function returns.

The packet type might still be in use by receivers

and must not be freed until after all the CPU's have gone through a quiescent state.

Definition at line 433 of file dev.c.

void __dev_set_rx_mode ( struct net_device dev)

Definition at line 4690 of file dev.c.

int __hw_addr_add_multiple ( struct netdev_hw_addr_list to_list,
struct netdev_hw_addr_list from_list,
int  addr_len,
unsigned char  addr_type 
)

Definition at line 115 of file dev_addr_lists.c.

void __hw_addr_del_multiple ( struct netdev_hw_addr_list to_list,
struct netdev_hw_addr_list from_list,
int  addr_len,
unsigned char  addr_type 
)

Definition at line 142 of file dev_addr_lists.c.

void __hw_addr_flush ( struct netdev_hw_addr_list list)

Definition at line 198 of file dev_addr_lists.c.

void __hw_addr_init ( struct netdev_hw_addr_list list)

Definition at line 210 of file dev_addr_lists.c.

int __hw_addr_sync ( struct netdev_hw_addr_list to_list,
struct netdev_hw_addr_list from_list,
int  addr_len 
)

Definition at line 156 of file dev_addr_lists.c.

void __hw_addr_unsync ( struct netdev_hw_addr_list to_list,
struct netdev_hw_addr_list from_list,
int  addr_len 
)

Definition at line 180 of file dev_addr_lists.c.

void __napi_complete ( struct napi_struct n)

napi_complete - NAPI processing complete
: napi context

Mark NAPI processing as complete.

Definition at line 3881 of file dev.c.

void __napi_schedule ( struct napi_struct n)

__napi_schedule - schedule for receive
: entry to schedule

The entry's receive function will be scheduled to run

Definition at line 3871 of file dev.c.

int __netdev_update_features ( struct net_device dev)

Definition at line 5453 of file dev.c.

void __netdev_watchdog_up ( struct net_device dev)

Definition at line 269 of file sch_generic.c.

void __netif_schedule ( struct Qdisc q)

Definition at line 1863 of file dev.c.

__printf ( ,
 
) const
struct net_device const char __printf ( ,
 
) const
struct net_device* alloc_netdev_mqs ( int  sizeof_priv,
const char name,
void(*)(struct net_device *)  setup,
unsigned int  txqs,
unsigned int  rxqs 
)
read

Definition at line 6027 of file dev.c.

int call_netdevice_notifiers ( unsigned long  val,
struct net_device dev 
)

call_netdevice_notifiers - call all network notifier blocks : value passed unmodified to notifier function : net_device pointer passed unmodified to notifier function

Call all network notifier blocks. Parameters and return value are as for raw_notifier_call_chain().

Definition at line 1479 of file dev.c.

DECLARE_PER_CPU_ALIGNED ( struct softnet_data  ,
softnet_data   
)
void dev_add_pack ( struct packet_type pt)

dev_add_pack - add packet handler : packet type declaration

Add a protocol handler to the networking stack. The passed &packet_type is linked into kernel lists and may not be freed until it has been removed from the kernel lists.

This call does not sleep therefore it can not guarantee all CPU's that are in middle of receiving packets will see the new packet type (until the next received packet).

Definition at line 410 of file dev.c.

int dev_addr_add ( struct net_device dev,
const unsigned char addr,
unsigned char  addr_type 
)

dev_addr_add - Add a device address : device : address to add : address type

Add a device address to the device or increase the reference count if it already exists.

The caller must hold the rtnl_mutex.

Definition at line 283 of file dev_addr_lists.c.

int dev_addr_add_multiple ( struct net_device to_dev,
struct net_device from_dev,
unsigned char  addr_type 
)

dev_addr_add_multiple - Add device addresses from another device : device to which addresses will be added : device from which addresses will be added : address type - 0 means type will be used from from_dev

Add device addresses of the one device to another.

The caller must hold the rtnl_mutex.

Definition at line 344 of file dev_addr_lists.c.

int dev_addr_del ( struct net_device dev,
const unsigned char addr,
unsigned char  addr_type 
)

dev_addr_del - Release a device address. : device : address to delete : address type

Release reference to a device address and remove it from the device if the reference count drops to zero.

The caller must hold the rtnl_mutex.

Definition at line 308 of file dev_addr_lists.c.

int dev_addr_del_multiple ( struct net_device to_dev,
struct net_device from_dev,
unsigned char  addr_type 
)

dev_addr_del_multiple - Delete device addresses by another device : device where the addresses will be deleted : device supplying the addresses to be deleted : address type - 0 means type will be used from from_dev

Deletes addresses in to device by the list of addresses in from device.

The caller must hold the rtnl_mutex.

Definition at line 372 of file dev_addr_lists.c.

void dev_addr_flush ( struct net_device dev)

dev_addr_flush - Flush device address list : device

Flush device address list and reset ->dev_addr.

The caller must hold the rtnl_mutex.

Definition at line 229 of file dev_addr_lists.c.

int dev_addr_init ( struct net_device dev)

dev_addr_init - Init device address list : device

Init device address list and create the first element, used by ->dev_addr.

The caller must hold the rtnl_mutex.

Definition at line 247 of file dev_addr_lists.c.

int dev_alloc_name ( struct net_device dev,
const char name 
)

Definition at line 947 of file dev.c.

int dev_change_flags ( struct net_device dev,
unsigned int  flags 
)

dev_change_flags - change device settings : device : device state flags

Change settings on device based state flags. The flags are in the userspace exported format.

Definition at line 4841 of file dev.c.

int dev_change_name ( struct net_device dev,
const char newname 
)

dev_change_name - change name of a device : device : name (or format string) must be at least IFNAMSIZ

Change name of a device, can pass format strings "eth%d". for wildcarding.

Definition at line 1002 of file dev.c.

int dev_change_net_namespace ( struct net_device dev,
struct net net,
const char pat 
)

dev_change_net_namespace - move device to different nethost namespace : device : network namespace : If not NULL name pattern to try if the current device name is already taken in the destination network namespace.

This function shuts down a device interface and moves it to a new network namespace. On success 0 is returned, on a failure a netagive errno code is returned.

Callers must hold the rtnl semaphore.

Definition at line 6259 of file dev.c.

int dev_close ( struct net_device dev)

dev_close - shutdown an interface. : device to shutdown

This function moves an active device into down state. A NETDEV_GOING_DOWN is sent to the netdev notifier chain. The device is then deactivated and finally a NETDEV_DOWN is sent to the notifier chain.

Definition at line 1322 of file dev.c.

void dev_disable_lro ( struct net_device dev)

dev_disable_lro - disable Large Receive Offload on a device : device

Disable Large Receive Offload (LRO) on a net device. Must be called under RTNL. This is needed if received packets may be forwarded to another interface.

Definition at line 1344 of file dev.c.

int dev_ethtool ( struct net net,
struct ifreq  
)

Definition at line 1415 of file ethtool.c.

int dev_forward_skb ( struct net_device dev,
struct sk_buff skb 
)

dev_forward_skb - loopback an skb to another netif

: destination network device : buffer to forward

return values: NET_RX_SUCCESS (no congestion) NET_RX_DROP (packet was dropped, but freed)

dev_forward_skb can be used for injecting an skb from the start_xmit function of one device into the receive queue of another device.

The receiving device may be in another namespace, so we have to clear all information in the skb that could impact namespace isolation.

Definition at line 1626 of file dev.c.

struct net_device* dev_get_by_flags_rcu ( struct net net,
unsigned short  if_flags,
unsigned short  mask 
)
read

dev_get_by_flags_rcu - find any device with given flags : the applicable net namespace : IFF_* values : bitmask of bits in if_flags to check

Search for any interface with the given flags. Returns NULL if a device is not found or a pointer to the device. Must be called inside rcu_read_lock(), and result refcount is unchanged.

Definition at line 825 of file dev.c.

struct net_device* dev_get_by_index ( struct net net,
int  ifindex 
)
read

dev_get_by_index - find a device by its ifindex : the applicable net namespace : index of device

Search for an interface by index. Returns NULL if the device is not found or a pointer to the device. The device returned has had a reference added and the pointer is safe until the user calls dev_put to indicate they have finished with it.

Definition at line 744 of file dev.c.

struct net_device* dev_get_by_index_rcu ( struct net net,
int  ifindex 
)
read

dev_get_by_index_rcu - find a device by its ifindex : the applicable net namespace : index of device

Search for an interface by index. Returns NULL if the device is not found or a pointer to the device. The device has not had its reference counter increased so the caller must be careful about locking. The caller must hold RCU lock.

Definition at line 718 of file dev.c.

struct net_device* dev_get_by_name ( struct net net,
const char name 
)
read

Definition at line 668 of file dev.c.

struct net_device* dev_get_by_name_rcu ( struct net net,
const char name 
)
read

Definition at line 642 of file dev.c.

unsigned int dev_get_flags ( const struct net_device dev)

dev_get_flags - get flags reported to userspace : device

Get the combination of flag bits exported through APIs to userspace.

Definition at line 4731 of file dev.c.

struct rtnl_link_stats64* dev_get_stats ( struct net_device dev,
struct rtnl_link_stats64 storage 
)
read

dev_get_stats - get network device statistics : device to get statistics from : place to store stats

Get network statistics from device. Return . The device driver may provide its own method by setting dev->netdev_ops->get_stats64 or dev->netdev_ops->get_stats; otherwise the internal statistics structure is used.

Definition at line 5977 of file dev.c.

struct net_device* dev_getbyhwaddr_rcu ( struct net net,
unsigned short  type,
const char ha 
)
read

dev_getbyhwaddr_rcu - find a device by its hardware address : the applicable net namespace : media type of device : hardware address

Search for an interface by MAC address. Returns NULL if the device is not found or a pointer to the device. The caller must hold RCU or RTNL. The returned device has not had its ref count increased and the caller must therefore be careful about locking

Definition at line 771 of file dev.c.

struct net_device* dev_getfirstbyhwtype ( struct net net,
unsigned short  type 
)
read

Definition at line 798 of file dev.c.

gro_result_t dev_gro_receive ( struct napi_struct napi,
struct sk_buff skb 
)

Definition at line 3510 of file dev.c.

int dev_hard_start_xmit ( struct sk_buff skb,
struct net_device dev,
struct netdev_queue txq 
)

Definition at line 2212 of file dev.c.

int dev_ioctl ( struct net net,
unsigned int  cmd,
void __user arg 
)

dev_ioctl - network device ioctl : the applicable net namespace : command to issue

  • : pointer to a struct ifreq in user space

Issue ioctl functions to devices. This is normally called by the user space syscall interfaces but can sometimes be useful for other purposes. The return value is the return from the syscall if positive or a negative errno code on error.

Definition at line 5123 of file dev.c.

void dev_kfree_skb_any ( struct sk_buff skb)

Definition at line 1886 of file dev.c.

void dev_kfree_skb_irq ( struct sk_buff skb)

Definition at line 1870 of file dev.c.

void dev_load ( struct net net,
const char name 
)

Definition at line 1152 of file dev.c.

int dev_loopback_xmit ( struct sk_buff skb)

dev_loopback_xmit - loop back : buffer to transmit

Definition at line 2523 of file dev.c.

int dev_mc_add ( struct net_device dev,
const unsigned char addr 
)

dev_mc_add - Add a multicast address : device : address to add

Add a multicast address to the device or increase the reference count if it already exists.

Definition at line 593 of file dev_addr_lists.c.

int dev_mc_add_excl ( struct net_device dev,
const unsigned char addr 
)

dev_mc_add_excl - Add a global secondary multicast address : device : address to add

Definition at line 549 of file dev_addr_lists.c.

int dev_mc_add_global ( struct net_device dev,
const unsigned char addr 
)

dev_mc_add_global - Add a global multicast address : device : address to add

Add a global multicast address to the device.

Definition at line 606 of file dev_addr_lists.c.

int dev_mc_del ( struct net_device dev,
const unsigned char addr 
)

dev_mc_del - Delete a multicast address. : device : address to delete

Release reference to a multicast address and remove it from the device if the reference count drops to zero.

Definition at line 634 of file dev_addr_lists.c.

int dev_mc_del_global ( struct net_device dev,
const unsigned char addr 
)

dev_mc_del_global - Delete a global multicast address. : device : address to delete

Release reference to a multicast address and remove it from the device if the reference count drops to zero.

Definition at line 648 of file dev_addr_lists.c.

void dev_mc_flush ( struct net_device dev)

dev_mc_flush - Flush multicast addresses : device

Flush multicast addresses.

Definition at line 711 of file dev_addr_lists.c.

void dev_mc_init ( struct net_device dev)

dev_mc_flush - Init multicast address list : device

Init multicast address list.

Definition at line 725 of file dev_addr_lists.c.

int dev_mc_sync ( struct net_device to,
struct net_device from 
)

dev_mc_sync - Synchronize device's unicast list to another device : destination device : source device

Add newly added addresses to the destination device and release addresses that have no users left. The source device must be locked by netif_addr_lock_bh.

This function is intended to be called from the ndo_set_rx_mode function of layered software devices.

Definition at line 666 of file dev_addr_lists.c.

void dev_mc_unsync ( struct net_device to,
struct net_device from 
)

dev_mc_unsync - Remove synchronized addresses from the destination device : destination device : source device

Remove all addresses that were added to the destination device by dev_mc_sync(). This function is intended to be called from the dev->stop function of layered software devices.

Definition at line 691 of file dev_addr_lists.c.

void dev_mcast_init ( void  )

Definition at line 798 of file dev_addr_lists.c.

int dev_open ( struct net_device dev)

dev_open - prepare an interface for use. : device to open

Takes a device from down to up state. The device's private open function is invoked and then the multicast lists are loaded. Finally the device is moved into the up state and a NETDEV_UP message is sent to the netdev notifier chain.

Calling this function on an active interface is a nop. On a failure a negative errno code is returned.

Definition at line 1220 of file dev.c.

int dev_queue_xmit ( struct sk_buff skb)

dev_queue_xmit - transmit a buffer : buffer to transmit

Queue a buffer for transmission to a network device. The caller must have set the device and priority and built the buffer before calling this function. The function can be called from an interrupt.

A negative errno code is returned on a failure. A success does not guarantee the frame will be transmitted as it may be dropped due to congestion or traffic shaping.


I notice this method can also return errors from the queue disciplines, including NET_XMIT_DROP, which is a positive value. So, errors can also be positive.

Regardless of the return value, the skb is consumed, so it is currently difficult to retry a send to this method. (You can bump the ref count before sending to hold a reference for retry if you are careful.)

When calling this method, interrupts MUST be enabled. This is because the BH enable code must have IRQs enabled so that it will not deadlock. –BLG

Definition at line 2561 of file dev.c.

void dev_remove_pack ( struct packet_type pt)

dev_remove_pack - remove packet handler : packet type declaration

Remove a protocol handler that was previously added to the kernel protocol handlers by dev_add_pack(). The passed &packet_type is removed from the kernel lists and can be freed or reused once this function returns.

This call sleeps to guarantee that no CPU is looking at the packet type after return.

Definition at line 465 of file dev.c.

int dev_restart ( struct net_device dev)
int dev_set_alias ( struct net_device dev,
const char alias,
size_t  len 
)

dev_set_alias - change ifalias of a device : device : name up to IFALIASZ : limit of bytes to copy from info

Set ifalias for a device,

Definition at line 1068 of file dev.c.

int dev_set_allmulti ( struct net_device dev,
int  inc 
)

dev_set_allmulti - update allmulti count on a device : device : modifier

Add or remove reception of all multicast frames to a device. While the count in the device remains above zero the interface remains listening to all interfaces. Once it hits zero the device reverts back to normal filtering operation. A negative value is used to drop the counter when releasing a resource needing all multicasts. Return 0 if successful or a negative errno code on error.

Definition at line 4654 of file dev.c.

void dev_set_group ( struct net_device dev,
int  new_group 
)

dev_set_group - Change group this device belongs to : device : group this device should belong to

Definition at line 4898 of file dev.c.

int dev_set_mac_address ( struct net_device dev,
struct sockaddr sa 
)

dev_set_mac_address - Change Media Access Control Address : device

See Also
: new address

Change the hardware (MAC) address of the device

Definition at line 4911 of file dev.c.

int dev_set_mtu ( struct net_device dev,
int  new_mtu 
)

dev_set_mtu - Change maximum transfer unit : device : new transfer unit

Change the maximum transfer size of the network device.

Definition at line 4866 of file dev.c.

int dev_set_promiscuity ( struct net_device dev,
int  inc 
)

dev_set_promiscuity - update promiscuity count on a device : device : modifier

Add or remove promiscuity from a device. While the count in the device remains above zero the interface remains promiscuous. Once it hits zero the device reverts back to normal filtering operation. A negative inc value is used to drop promiscuity on the device. Return 0 if successful or a negative errno code on error.

Definition at line 4627 of file dev.c.

void dev_set_rx_mode ( struct net_device dev)

Definition at line 4718 of file dev.c.

unsigned long dev_trans_start ( struct net_device dev)

Definition at line 208 of file sch_generic.c.

int dev_uc_add ( struct net_device dev,
const unsigned char addr 
)

dev_uc_add - Add a secondary unicast address : device : address to add

Add a secondary unicast address to the device or increase the reference count if it already exists.

Definition at line 427 of file dev_addr_lists.c.

int dev_uc_add_excl ( struct net_device dev,
const unsigned char addr 
)

dev_uc_add_excl - Add a global secondary unicast address : device : address to add

Definition at line 396 of file dev_addr_lists.c.

int dev_uc_del ( struct net_device dev,
const unsigned char addr 
)

dev_uc_del - Release secondary unicast address. : device : address to delete

Release reference to a secondary unicast address and remove it from the device if the reference count drops to zero.

Definition at line 449 of file dev_addr_lists.c.

void dev_uc_flush ( struct net_device dev)

dev_uc_flush - Flush unicast addresses : device

Flush unicast addresses.

Definition at line 520 of file dev_addr_lists.c.

void dev_uc_init ( struct net_device dev)

dev_uc_flush - Init unicast address list : device

Init unicast address list.

Definition at line 534 of file dev_addr_lists.c.

int dev_uc_sync ( struct net_device to,
struct net_device from 
)

dev_uc_sync - Synchronize device's unicast list to another device : destination device : source device

Add newly added addresses to the destination device and release addresses that have no users left. The source device must be locked by netif_addr_lock_bh.

This function is intended to be called from the dev->set_rx_mode function of layered software devices.

Definition at line 475 of file dev_addr_lists.c.

void dev_uc_unsync ( struct net_device to,
struct net_device from 
)

dev_uc_unsync - Remove synchronized addresses from the destination device : destination device : source device

Remove all addresses that were added to the destination device by dev_uc_sync(). This function is intended to be called from the dev->stop function of layered software devices.

Definition at line 500 of file dev_addr_lists.c.

bool dev_valid_name ( const char name)

Definition at line 849 of file dev.c.

void ether_setup ( struct net_device dev)

ether_setup - setup Ethernet network device : network device

Fill in the fields of the device structure with Ethernet-generic values.

Definition at line 339 of file eth.c.

void free_netdev ( struct net_device dev)

free_netdev - free network device : device

This function does the last stage of destroying an allocated device interface. The reference to the device object is released. If this is the last reference then it will be freed.

Definition at line 6131 of file dev.c.

int init_dummy_netdev ( struct net_device dev)

init_dummy_netdev - init a dummy network device for NAPI : device to init

This takes a network device structure and initialize the minimum amount of fields so it can be used to schedule NAPI polls without registering a full blown interface. This is to be used by drivers that need to tie several hardware interfaces to a single NAPI poll scheduler due to HW limitations.

Definition at line 5744 of file dev.c.

void linkwatch_fire_event ( struct net_device dev)

Definition at line 239 of file link_watch.c.

void linkwatch_forget_dev ( struct net_device dev)

Definition at line 208 of file link_watch.c.

void linkwatch_init_dev ( struct net_device dev)

Definition at line 79 of file link_watch.c.

void linkwatch_run_queue ( void  )

Definition at line 225 of file link_watch.c.

void napi_complete ( struct napi_struct n)

Definition at line 3892 of file dev.c.

gro_result_t napi_frags_finish ( struct napi_struct napi,
struct sk_buff skb,
gro_result_t  ret 
)

Definition at line 3706 of file dev.c.

struct sk_buff* napi_get_frags ( struct napi_struct napi)
read

Definition at line 3693 of file dev.c.

void napi_gro_flush ( struct napi_struct napi,
bool  flush_old 
)

Definition at line 3485 of file dev.c.

gro_result_t napi_gro_frags ( struct napi_struct napi)

Definition at line 3769 of file dev.c.

gro_result_t napi_gro_receive ( struct napi_struct napi,
struct sk_buff skb 
)

Definition at line 3673 of file dev.c.

gro_result_t napi_skb_finish ( gro_result_t  ret,
struct sk_buff skb 
)

Definition at line 3628 of file dev.c.

void net_disable_timestamp ( void  )

Definition at line 1511 of file dev.c.

void net_enable_timestamp ( void  )

Definition at line 1495 of file dev.c.

unsigned long netdev_boot_base ( const char prefix,
int  unit 
)

netdev_boot_base - get address from boot time settings : prefix for network device : id for network device

Check boot time settings for the base address of device. The found settings are set for the device to be used later in the device probing. Returns 0 if no settings found.

Definition at line 548 of file dev.c.

Definition at line 572 of file dev.c.

int netdev_boot_setup_check ( struct net_device dev)

netdev_boot_setup_check - check boot time settings : the netdevice

Check boot time settings for the device. The found settings are set for the device to be used later in the device probing. Returns 0 if no settings found, 1 if they are.

Definition at line 518 of file dev.c.

void netdev_change_features ( struct net_device dev)

netdev_change_features - recalculate device features : the device to check

Recalculate dev->features set and send notifications even if they have not changed. Should be called instead of netdev_update_features() if also dev->vlan_features might have changed to allow the changes to be propagated to stacked VLAN devices.

Definition at line 5515 of file dev.c.

int netdev_class_create_file ( struct class_attribute class_attr)

Definition at line 1447 of file net-sysfs.c.

void netdev_class_remove_file ( struct class_attribute class_attr)

Definition at line 1453 of file net-sysfs.c.

const char* netdev_drivername ( const struct net_device dev)

netdev_drivername - network driver for the device : network device

Determine network driver for device.

Definition at line 6484 of file dev.c.

void netdev_features_change ( struct net_device dev)

netdev_features_change - device changes features : device to cause notification

Called to indicate a device has changed features.

Definition at line 1101 of file dev.c.

netdev_features_t netdev_increment_features ( netdev_features_t  all,
netdev_features_t  one,
netdev_features_t  mask 
)

netdev_increment_features - increment feature set by one : current feature set : new feature set : mask feature set

Computes a new feature set after adding a device with feature set to the master device with current feature set . Will not enable anything that is off in . Returns the new feature set.

Definition at line 6425 of file dev.c.

void netdev_notify_peers ( struct net_device dev)
netdev_notify_peers - notify network peers about existence of @dev
@dev: network device

Generate traffic such that interested network peers are aware of , such as by generating a gratuitous ARP. This may be used when a device wants to inform the rest of the network about some sort of reconfiguration such as a failover event or virtual machine migration.

Definition at line 1134 of file dev.c.

struct netdev_queue* netdev_pick_tx ( struct net_device dev,
struct sk_buff skb 
)
read

Definition at line 2400 of file dev.c.

int netdev_refcnt_read ( const struct net_device dev)

Definition at line 5799 of file dev.c.

void netdev_resync_ops ( struct net_device dev)
void netdev_run_todo ( void  )

Definition at line 5895 of file dev.c.

int netdev_rx_handler_register ( struct net_device dev,
rx_handler_func_t rx_handler,
void rx_handler_data 
)

netdev_rx_handler_register - register receive handler : device to register a handler for : receive handler to register : data pointer that is used by rx handler

Register a receive hander for a device. This handler will then be called from __netif_receive_skb. A negative errno code is returned on a failure.

The caller must hold the rtnl_mutex.

For a general description of rx_handler, see enum rx_handler_result.

Definition at line 3173 of file dev.c.

void netdev_rx_handler_unregister ( struct net_device dev)

netdev_rx_handler_unregister - unregister receive handler : device to unregister a handler from

Unregister a receive hander from a device.

The caller must hold the rtnl_mutex.

Definition at line 3197 of file dev.c.

int netdev_set_bond_master ( struct net_device slave,
struct net_device master 
)

netdev_set_bond_master - set up bonding master/slave pair : slave device : new master device

Changes the master device of the slave. Pass NULL to break the bonding. The caller must hold the RTNL semaphore. On a failure a negative errno code is returned. On success RTM_NEWLINK is sent to the routing socket and the function returns zero.

Definition at line 4543 of file dev.c.

int netdev_set_master ( struct net_device slave,
struct net_device master 
)

netdev_set_master - set up master pointer : slave device : new master device

Changes the master device of the slave. Pass NULL to break the bonding. The caller must hold the RTNL semaphore. On a failure a negative errno code is returned. On success the reference counts are adjusted and the function returns zero.

Definition at line 4513 of file dev.c.

void netdev_state_change ( struct net_device dev)

netdev_state_change - device changes state : device to cause notification

Called to indicate a device has changed state. This function calls the notifier chains for netdev_chain and sends a NEWLINK message to the routing socket.

Definition at line 1115 of file dev.c.

void netdev_stats_to_stats64 ( struct rtnl_link_stats64 stats64,
const struct net_device_stats netdev_stats 
)

Definition at line 5948 of file dev.c.

void netdev_update_features ( struct net_device dev)

netdev_update_features - recalculate device features : the device to check

Recalculate dev->features set and send notifications if it has changed. Should be called after driver or hardware dependent conditions might have changed that influence the features.

Definition at line 5498 of file dev.c.

void netif_carrier_off ( struct net_device dev)

netif_carrier_off - clear carrier : network device

Device has detected loss of carrier.

Definition at line 317 of file sch_generic.c.

void netif_carrier_on ( struct net_device dev)

netif_carrier_on - set carrier : network device

Device has detected that carrier.

Definition at line 299 of file sch_generic.c.

void netif_device_attach ( struct net_device dev)

netif_device_attach - mark device as attached : network device

Mark device as attached from system and restart if needed.

Definition at line 1917 of file dev.c.

void netif_device_detach ( struct net_device dev)

netif_device_detach - mark device as removed : network device

Mark device as removed from system and therefore no longer available.

Definition at line 1902 of file dev.c.

int netif_get_num_default_rss_queues ( void  )

netif_get_num_default_rss_queues - default number of RSS queues

This routine should set an upper limit on the number of RSS queues used by default by multiqueue devices.

Definition at line 1843 of file dev.c.

void netif_napi_add ( struct net_device dev,
struct napi_struct napi,
int(*)(struct napi_struct *, int poll,
int  weight 
)

netif_napi_add - initialize a napi context : network device : napi context : polling function : default weight

netif_napi_add() must be used to initialize a napi context prior to calling any of the other napi related functions.

Definition at line 3910 of file dev.c.

void netif_napi_del ( struct napi_struct napi)

netif_napi_del - remove a napi context : napi context

netif_napi_del() removes a napi context from the network device napi list

Definition at line 3929 of file dev.c.

int netif_receive_skb ( struct sk_buff skb)

netif_receive_skb - process receive buffer from network : buffer to process

netif_receive_skb() is the main receive data processing function. It always succeeds. The buffer may be dropped during processing for congestion control or by the protocol layers.

This function may only be called from softirq context and interrupts should be enabled.

Return values (usually ignored): NET_RX_SUCCESS: no congestion NET_RX_DROP: packet was dropped

Definition at line 3391 of file dev.c.

int netif_rx ( struct sk_buff skb)

netif_rx - post buffer to the network code : buffer to post

This function receives a packet from a device driver and queues it for the upper (protocol) levels to process. It always succeeds. The buffer may be dropped during processing for congestion control or by the protocol layers.

return values: NET_RX_SUCCESS (no congestion) NET_RX_DROP (packet was dropped)

Definition at line 2978 of file dev.c.

int netif_rx_ni ( struct sk_buff skb)

Definition at line 3016 of file dev.c.

int netif_set_real_num_tx_queues ( struct net_device dev,
unsigned int  txq 
)

Definition at line 1776 of file dev.c.

netdev_features_t netif_skb_features ( struct sk_buff skb)

Definition at line 2170 of file dev.c.

void netif_stacked_transfer_operstate ( const struct net_device rootdev,
struct net_device dev 
)

netif_stacked_transfer_operstate - transfer operstate : the root or lower level device to transfer state from : the device to transfer operstate to

Transfer operational state from root to device. This is normally called when a stacking relationship exists between the root device and the device(a leaf device).

Definition at line 5531 of file dev.c.

int register_gifconf ( unsigned int  family,
gifconf_func_t gifconf 
)

register_gifconf - register a SIOCGIF handler : Address family : Function handler

Register protocol dependent address dumping routines. The handler that is passed must not be freed or reused until it has been replaced by another handler.

Definition at line 4053 of file dev.c.

int register_netdev ( struct net_device dev)

register_netdev - register a network device : device to register

Take a completed network device structure and add it to the kernel interfaces. A NETDEV_REGISTER message is sent to the netdev notifier chain. 0 is returned on success. A negative errno code is returned on a failure to set up the device, or if the name is a duplicate.

This is a wrapper around register_netdevice that takes the rtnl semaphore and expands the device name if you passed a format string to alloc_netdev.

Definition at line 5788 of file dev.c.

int register_netdevice ( struct net_device dev)

register_netdevice - register a network device : device to register

Take a completed network device structure and add it to the kernel interfaces. A NETDEV_REGISTER message is sent to the netdev notifier chain. 0 is returned on success. A negative errno code is returned on a failure to set up the device, or if the name is a duplicate.

Callers must hold the rtnl semaphore. You may want register_netdev() instead of this.

BUGS: The locking appears insufficient to guarantee two parallel registers will not get the same name.

Definition at line 5621 of file dev.c.

int register_netdevice_notifier ( struct notifier_block nb)

register_netdevice_notifier - register a network notifier block : notifier

Register a notifier to be called when network device events occur. The notifier passed is linked into the kernel structures and must not be reused until it has been unregistered. A negative errno code is returned on a failure.

When registered all registration and up events are replayed to the new notifier to allow device to have a race free view of the network device list.

Definition at line 1378 of file dev.c.

int skb_checksum_help ( struct sk_buff skb)

Definition at line 1948 of file dev.c.

int skb_gro_receive ( struct sk_buff **  head,
struct sk_buff skb 
)

Definition at line 2904 of file skbuff.c.

struct sk_buff* skb_gso_segment ( struct sk_buff skb,
netdev_features_t  features 
)
read

skb_gso_segment - Perform segmentation on skb. : buffer to segment : features for the output path (see dev->features)

This function segments the given skb and returns a list of segments.

It may return NULL if the skb requires no segmentation. This is only possible when GSO is used for verifying header integrity.

Definition at line 1993 of file dev.c.

void synchronize_net ( void  )

synchronize_net - Synchronize with packet receive processing

Wait for packets currently being received to be done. Does not block later packets from starting.

Definition at line 6173 of file dev.c.

void unregister_netdev ( struct net_device dev)

unregister_netdev - remove device from the kernel : device

This function shuts down a device interface and removes it from the kernel tables.

This is just a wrapper for unregister_netdevice that takes the rtnl semaphore. In general you want to use this and not unregister_netdevice.

Definition at line 6237 of file dev.c.

void unregister_netdevice_many ( struct list_head head)

unregister_netdevice_many - unregister many devices : list of devices

Definition at line 6214 of file dev.c.

int unregister_netdevice_notifier ( struct notifier_block nb)

unregister_netdevice_notifier - unregister a network notifier block : notifier

Unregister a notifier previously registered by register_netdevice_notifier(). The notifier is unlinked into the kernel structures and may then be reused. A negative errno code is returned on a failure.

After unregistering unregister and down device events are synthesized for all devices on the device list to the removed notifier to remove the need for special case cleanup code.

Definition at line 1444 of file dev.c.

void unregister_netdevice_queue ( struct net_device dev,
struct list_head head 
)

unregister_netdevice_queue - remove device from the kernel : device : list

This function shuts down a device interface and removes it from the kernel tables. If head not NULL, device is queued to be unregistered later.

Callers must hold the rtnl semaphore. You may want unregister_netdev() instead of this.

Definition at line 6196 of file dev.c.

Variable Documentation

struct netdev_queue ____cacheline_aligned_in_smp
int bpf_jit_enable

Definition at line 2704 of file netdevice.h.

rwlock_t dev_base_lock

Definition at line 2704 of file netdevice.h.

Definition at line 214 of file loopback.c.

struct kobj_ns_type_operations net_ns_type_operations

Definition at line 1325 of file net-sysfs.c.

int netdev_budget
int netdev_max_backlog
int netdev_tstamp_prequeue
int weight_p