Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dev.c File Reference
#include <asm/uaccess.h>
#include <linux/bitops.h>
#include <linux/capability.h>
#include <linux/cpu.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/hash.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/if_ether.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/notifier.h>
#include <linux/skbuff.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/stat.h>
#include <net/dst.h>
#include <net/pkt_sched.h>
#include <net/checksum.h>
#include <net/xfrm.h>
#include <linux/highmem.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/module.h>
#include <linux/netpoll.h>
#include <linux/rcupdate.h>
#include <linux/delay.h>
#include <net/wext.h>
#include <net/iw_handler.h>
#include <asm/current.h>
#include <linux/audit.h>
#include <linux/dmaengine.h>
#include <linux/err.h>
#include <linux/ctype.h>
#include <linux/if_arp.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <net/ip.h>
#include <linux/ipv6.h>
#include <linux/in.h>
#include <linux/jhash.h>
#include <linux/random.h>
#include <trace/events/napi.h>
#include <trace/events/net.h>
#include <trace/events/skb.h>
#include <linux/pci.h>
#include <linux/inetdevice.h>
#include <linux/cpu_rmap.h>
#include <linux/net_tstamp.h>
#include <linux/static_key.h>
#include <net/flow_keys.h>
#include "net-sysfs.h"

Go to the source code of this file.

Data Structures

struct  dev_gso_cb
 

Macros

#define MAX_GRO_SKBS   8
 
#define GRO_MAX_HEAD   (MAX_HEADER + 128)
 
#define PTYPE_HASH_SIZE   (16)
 
#define PTYPE_HASH_MASK   (PTYPE_HASH_SIZE - 1)
 

Functions

 DEFINE_RWLOCK (dev_base_lock)
 
 EXPORT_SYMBOL (dev_base_lock)
 
 DEFINE_PER_CPU_ALIGNED (struct softnet_data, softnet_data)
 
 EXPORT_PER_CPU_SYMBOL (softnet_data)
 
void dev_add_pack (struct packet_type *pt)
 
 EXPORT_SYMBOL (dev_add_pack)
 
void __dev_remove_pack (struct packet_type *pt)
 
 EXPORT_SYMBOL (__dev_remove_pack)
 
void dev_remove_pack (struct packet_type *pt)
 
 EXPORT_SYMBOL (dev_remove_pack)
 
: name of the device

netdev_boot_setup_add - add new setup entry

: configured settings for the device

Adds new setup entry to the dev_boot_setup list. The function returns 0 on error and 1 on success. This is a generic routine to all netdevices.

int netdev_boot_setup_check (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_boot_setup_check)
 
unsigned long netdev_boot_base (const char *prefix, int unit)
 
int __init netdev_boot_setup (char *str)
 
 __setup ("netdev=", netdev_boot_setup)
 
: name to find

dev_get_by_name - find a device by its name : the applicable net namespace

Find an interface by name. This can be called from any context and does its own locking. The returned handle has the usage count incremented and the caller must use dev_put() to release it when it is no longer needed. NULL is returned if no matching device is found.

struct net_device__dev_get_by_name (struct net *net, const char *name)
 
 EXPORT_SYMBOL (__dev_get_by_name)
 
struct net_devicedev_get_by_name_rcu (struct net *net, const char *name)
 
 EXPORT_SYMBOL (dev_get_by_name_rcu)
 
struct net_devicedev_get_by_name (struct net *net, const char *name)
 
 EXPORT_SYMBOL (dev_get_by_name)
 
struct net_device__dev_get_by_index (struct net *net, int ifindex)
 
 EXPORT_SYMBOL (__dev_get_by_index)
 
struct net_devicedev_get_by_index_rcu (struct net *net, int ifindex)
 
 EXPORT_SYMBOL (dev_get_by_index_rcu)
 
struct net_devicedev_get_by_index (struct net *net, int ifindex)
 
 EXPORT_SYMBOL (dev_get_by_index)
 
struct net_devicedev_getbyhwaddr_rcu (struct net *net, unsigned short type, const char *ha)
 
 EXPORT_SYMBOL (dev_getbyhwaddr_rcu)
 
struct net_device__dev_getfirstbyhwtype (struct net *net, unsigned short type)
 
 EXPORT_SYMBOL (__dev_getfirstbyhwtype)
 
struct net_devicedev_getfirstbyhwtype (struct net *net, unsigned short type)
 
 EXPORT_SYMBOL (dev_getfirstbyhwtype)
 
struct net_devicedev_get_by_flags_rcu (struct net *net, unsigned short if_flags, unsigned short mask)
 
 EXPORT_SYMBOL (dev_get_by_flags_rcu)
 
: name string

dev_valid_name - check if name is okay for network device

Network device names need to be valid file names to to allow sysfs to work. We also disallow any kind of whitespace.

bool dev_valid_name (const char *name)
 
 EXPORT_SYMBOL (dev_valid_name)
 
: name format string

dev_alloc_name - allocate a name for a device : device

Passed a format string - eg "lt%d" it will try and find a suitable id. It scans list of devices to build up a free map, then chooses the first empty slot. The caller must hold the dev_base or rtnl lock while allocating the name and adding the device in order to avoid duplicates. Limited to bits_per_byte * page size devices (ie 32K on most platforms). Returns the number of the unit assigned or a negative errno code.

int dev_alloc_name (struct net_device *dev, const char *name)
 
 EXPORT_SYMBOL (dev_alloc_name)
 
int dev_change_name (struct net_device *dev, const char *newname)
 
int dev_set_alias (struct net_device *dev, const char *alias, size_t len)
 
void netdev_features_change (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_features_change)
 
void netdev_state_change (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_state_change)
 
void netdev_notify_peers (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_notify_peers)
 

: name of interface

dev_load - load a network module : the applicable net namespace

If a network interface is not present and the process has suitable privileges this function loads the module. If module loading is not available in this kernel then it becomes a nop.

#define net_timestamp_check(COND, SKB)
 
#define DEV_GSO_CB(skb)   ((struct dev_gso_cb *)(skb)->cb)
 
#define skb_update_prio(skb)
 
#define RECURSION_LIMIT   10
 
#define dev_proc_init()   0
 
void dev_load (struct net *net, const char *name)
 
 EXPORT_SYMBOL (dev_load)
 
int dev_open (struct net_device *dev)
 
 EXPORT_SYMBOL (dev_open)
 
int dev_close (struct net_device *dev)
 
 EXPORT_SYMBOL (dev_close)
 
void dev_disable_lro (struct net_device *dev)
 
 EXPORT_SYMBOL (dev_disable_lro)
 
int register_netdevice_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL (register_netdevice_notifier)
 
int unregister_netdevice_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL (unregister_netdevice_notifier)
 
int call_netdevice_notifiers (unsigned long val, struct net_device *dev)
 
 EXPORT_SYMBOL (call_netdevice_notifiers)
 
void net_enable_timestamp (void)
 
 EXPORT_SYMBOL (net_enable_timestamp)
 
void net_disable_timestamp (void)
 
 EXPORT_SYMBOL (net_disable_timestamp)
 
int dev_forward_skb (struct net_device *dev, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL (dev_forward_skb)
 
int netif_set_real_num_tx_queues (struct net_device *dev, unsigned int txq)
 
 EXPORT_SYMBOL (netif_set_real_num_tx_queues)
 
int netif_get_num_default_rss_queues (void)
 
 EXPORT_SYMBOL (netif_get_num_default_rss_queues)
 
void __netif_schedule (struct Qdisc *q)
 
 EXPORT_SYMBOL (__netif_schedule)
 
void dev_kfree_skb_irq (struct sk_buff *skb)
 
 EXPORT_SYMBOL (dev_kfree_skb_irq)
 
void dev_kfree_skb_any (struct sk_buff *skb)
 
 EXPORT_SYMBOL (dev_kfree_skb_any)
 
void netif_device_detach (struct net_device *dev)
 
 EXPORT_SYMBOL (netif_device_detach)
 
void netif_device_attach (struct net_device *dev)
 
 EXPORT_SYMBOL (netif_device_attach)
 
int skb_checksum_help (struct sk_buff *skb)
 
 EXPORT_SYMBOL (skb_checksum_help)
 
struct sk_buffskb_gso_segment (struct sk_buff *skb, netdev_features_t features)
 
 EXPORT_SYMBOL (skb_gso_segment)
 
netdev_features_t netif_skb_features (struct sk_buff *skb)
 
 EXPORT_SYMBOL (netif_skb_features)
 
int dev_hard_start_xmit (struct sk_buff *skb, struct net_device *dev, struct netdev_queue *txq)
 
u16 __skb_tx_hash (const struct net_device *dev, const struct sk_buff *skb, unsigned int num_tx_queues)
 
 EXPORT_SYMBOL (__skb_tx_hash)
 
struct netdev_queuenetdev_pick_tx (struct net_device *dev, struct sk_buff *skb)
 
int dev_loopback_xmit (struct sk_buff *skb)
 
 EXPORT_SYMBOL (dev_loopback_xmit)
 
int dev_queue_xmit (struct sk_buff *skb)
 
 EXPORT_SYMBOL (dev_queue_xmit)
 
 EXPORT_SYMBOL (netdev_max_backlog)
 
void __skb_get_rxhash (struct sk_buff *skb)
 
 EXPORT_SYMBOL (__skb_get_rxhash)
 
int netif_rx (struct sk_buff *skb)
 
 EXPORT_SYMBOL (netif_rx)
 
int netif_rx_ni (struct sk_buff *skb)
 
 EXPORT_SYMBOL (netif_rx_ni)
 
int netdev_rx_handler_register (struct net_device *dev, rx_handler_func_t *rx_handler, void *rx_handler_data)
 
 EXPORT_SYMBOL_GPL (netdev_rx_handler_register)
 
void netdev_rx_handler_unregister (struct net_device *dev)
 
 EXPORT_SYMBOL_GPL (netdev_rx_handler_unregister)
 
int netif_receive_skb (struct sk_buff *skb)
 
 EXPORT_SYMBOL (netif_receive_skb)
 
void napi_gro_flush (struct napi_struct *napi, bool flush_old)
 
 EXPORT_SYMBOL (napi_gro_flush)
 
enum gro_result dev_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 
 EXPORT_SYMBOL (dev_gro_receive)
 
gro_result_t napi_skb_finish (gro_result_t ret, struct sk_buff *skb)
 
 EXPORT_SYMBOL (napi_skb_finish)
 
gro_result_t napi_gro_receive (struct napi_struct *napi, struct sk_buff *skb)
 
 EXPORT_SYMBOL (napi_gro_receive)
 
struct sk_buffnapi_get_frags (struct napi_struct *napi)
 
 EXPORT_SYMBOL (napi_get_frags)
 
gro_result_t napi_frags_finish (struct napi_struct *napi, struct sk_buff *skb, gro_result_t ret)
 
 EXPORT_SYMBOL (napi_frags_finish)
 
gro_result_t napi_gro_frags (struct napi_struct *napi)
 
 EXPORT_SYMBOL (napi_gro_frags)
 
void __napi_schedule (struct napi_struct *n)
 
 EXPORT_SYMBOL (__napi_schedule)
 
void __napi_complete (struct napi_struct *n)
 
 EXPORT_SYMBOL (__napi_complete)
 
void napi_complete (struct napi_struct *n)
 
 EXPORT_SYMBOL (napi_complete)
 
void netif_napi_add (struct net_device *dev, struct napi_struct *napi, int(*poll)(struct napi_struct *, int), int weight)
 
 EXPORT_SYMBOL (netif_napi_add)
 
void netif_napi_del (struct napi_struct *napi)
 
 EXPORT_SYMBOL (netif_napi_del)
 
int register_gifconf (unsigned int family, gifconf_func_t *gifconf)
 
 EXPORT_SYMBOL (register_gifconf)
 
int netdev_set_master (struct net_device *slave, struct net_device *master)
 
 EXPORT_SYMBOL (netdev_set_master)
 
int netdev_set_bond_master (struct net_device *slave, struct net_device *master)
 
 EXPORT_SYMBOL (netdev_set_bond_master)
 
int dev_set_promiscuity (struct net_device *dev, int inc)
 
 EXPORT_SYMBOL (dev_set_promiscuity)
 
int dev_set_allmulti (struct net_device *dev, int inc)
 
 EXPORT_SYMBOL (dev_set_allmulti)
 
void __dev_set_rx_mode (struct net_device *dev)
 
void dev_set_rx_mode (struct net_device *dev)
 
unsigned int dev_get_flags (const struct net_device *dev)
 
 EXPORT_SYMBOL (dev_get_flags)
 
int __dev_change_flags (struct net_device *dev, unsigned int flags)
 
void __dev_notify_flags (struct net_device *dev, unsigned int old_flags)
 
int dev_change_flags (struct net_device *dev, unsigned int flags)
 
 EXPORT_SYMBOL (dev_change_flags)
 
int dev_set_mtu (struct net_device *dev, int new_mtu)
 
 EXPORT_SYMBOL (dev_set_mtu)
 
void dev_set_group (struct net_device *dev, int new_group)
 
 EXPORT_SYMBOL (dev_set_group)
 
int dev_set_mac_address (struct net_device *dev, struct sockaddr *sa)
 
 EXPORT_SYMBOL (dev_set_mac_address)
 
int dev_ioctl (struct net *net, unsigned int cmd, void __user *arg)
 
int __netdev_update_features (struct net_device *dev)
 
void netdev_update_features (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_update_features)
 
void netdev_change_features (struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_change_features)
 
void netif_stacked_transfer_operstate (const struct net_device *rootdev, struct net_device *dev)
 
 EXPORT_SYMBOL (netif_stacked_transfer_operstate)
 
int register_netdevice (struct net_device *dev)
 
 EXPORT_SYMBOL (register_netdevice)
 
int init_dummy_netdev (struct net_device *dev)
 
 EXPORT_SYMBOL_GPL (init_dummy_netdev)
 
int register_netdev (struct net_device *dev)
 
 EXPORT_SYMBOL (register_netdev)
 
int netdev_refcnt_read (const struct net_device *dev)
 
 EXPORT_SYMBOL (netdev_refcnt_read)
 
void netdev_run_todo (void)
 
void netdev_stats_to_stats64 (struct rtnl_link_stats64 *stats64, const struct net_device_stats *netdev_stats)
 
 EXPORT_SYMBOL (netdev_stats_to_stats64)
 
struct rtnl_link_stats64dev_get_stats (struct net_device *dev, struct rtnl_link_stats64 *storage)
 
 EXPORT_SYMBOL (dev_get_stats)
 
struct netdev_queuedev_ingress_queue_create (struct net_device *dev)
 

: device name format string

alloc_netdev_mqs - allocate network device : size of private data to allocate space for

: callback to initialize device : the number of TX subqueues to allocate : the number of RX subqueues to allocate

Allocates a struct net_device with private data area for driver use and performs basic initialization. Also allocates subquue structs for each queue on the device.

#define define_netdev_printk_level(func, level)
 
struct net_devicealloc_netdev_mqs (int sizeof_priv, const char *name, void(*setup)(struct net_device *), unsigned int txqs, unsigned int rxqs)
 
 EXPORT_SYMBOL (alloc_netdev_mqs)
 
void free_netdev (struct net_device *dev)
 
 EXPORT_SYMBOL (free_netdev)
 
void synchronize_net (void)
 
 EXPORT_SYMBOL (synchronize_net)
 
void unregister_netdevice_queue (struct net_device *dev, struct list_head *head)
 
 EXPORT_SYMBOL (unregister_netdevice_queue)
 
void unregister_netdevice_many (struct list_head *head)
 
 EXPORT_SYMBOL (unregister_netdevice_many)
 
void unregister_netdev (struct net_device *dev)
 
 EXPORT_SYMBOL (unregister_netdev)
 
int dev_change_net_namespace (struct net_device *dev, struct net *net, const char *pat)
 
 EXPORT_SYMBOL_GPL (dev_change_net_namespace)
 
netdev_features_t netdev_increment_features (netdev_features_t all, netdev_features_t one, netdev_features_t mask)
 
 EXPORT_SYMBOL (netdev_increment_features)
 
const charnetdev_drivername (const struct net_device *dev)
 
int netdev_printk (const char *level, const struct net_device *dev, const char *format,...)
 
 EXPORT_SYMBOL (netdev_printk)
 
 define_netdev_printk_level (netdev_emerg, KERN_EMERG)
 
 define_netdev_printk_level (netdev_alert, KERN_ALERT)
 
 define_netdev_printk_level (netdev_crit, KERN_CRIT)
 
 define_netdev_printk_level (netdev_err, KERN_ERR)
 
 define_netdev_printk_level (netdev_warn, KERN_WARNING)
 
 define_netdev_printk_level (netdev_notice, KERN_NOTICE)
 
 define_netdev_printk_level (netdev_info, KERN_INFO)
 
 subsys_initcall (net_dev_init)
 
 late_initcall_sync (initialize_hashrnd)
 

Macro Definition Documentation

#define define_netdev_printk_level (   func,
  level 
)
Value:
int func(const struct net_device *dev, const char *fmt, ...) \
{ \
int r; \
va_start(args, fmt); \
\
vaf.fmt = fmt; \
vaf.va = &args; \
\
r = __netdev_printk(level, dev, &vaf); \
va_end(args); \
\
return r; \
} \
EXPORT_SYMBOL(func);

Definition at line 6541 of file dev.c.

#define DEV_GSO_CB (   skb)    ((struct dev_gso_cb *)(skb)->cb)

Definition at line 2098 of file dev.c.

#define dev_proc_init ( )    0

Definition at line 4499 of file dev.c.

#define GRO_MAX_HEAD   (MAX_HEADER + 128)

Definition at line 145 of file dev.c.

#define MAX_GRO_SKBS   8

Definition at line 142 of file dev.c.

#define net_timestamp_check (   COND,
  SKB 
)
Value:
if (static_key_false(&netstamp_needed)) { \
if ((COND) && !(SKB)->tstamp.tv64) \
__net_timestamp(SKB); \
} \

Definition at line 1530 of file dev.c.

#define PTYPE_HASH_MASK   (PTYPE_HASH_SIZE - 1)

Definition at line 176 of file dev.c.

#define PTYPE_HASH_SIZE   (16)

Definition at line 175 of file dev.c.

#define RECURSION_LIMIT   10

Definition at line 2517 of file dev.c.

#define skb_update_prio (   skb)

Definition at line 2513 of file dev.c.

Function Documentation

int __dev_change_flags ( struct net_device dev,
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 dev,
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.

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 __netif_schedule ( struct Qdisc q)

Definition at line 1863 of file dev.c.

__setup ( )
void __skb_get_rxhash ( struct sk_buff skb)

Definition at line 2668 of file dev.c.

u16 __skb_tx_hash ( const struct net_device dev,
const struct sk_buff skb,
unsigned int  num_tx_queues 
)

Definition at line 2321 of file dev.c.

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.

define_netdev_printk_level ( netdev_emerg  ,
KERN_EMERG   
)
define_netdev_printk_level ( netdev_alert  ,
KERN_ALERT   
)
define_netdev_printk_level ( netdev_crit  ,
KERN_CRIT   
)
define_netdev_printk_level ( netdev_err  ,
KERN_ERR   
)
define_netdev_printk_level ( netdev_warn  ,
KERN_WARNING   
)
define_netdev_printk_level ( netdev_notice  ,
KERN_NOTICE   
)
define_netdev_printk_level ( netdev_info  ,
KERN_INFO   
)
DEFINE_PER_CPU_ALIGNED ( struct softnet_data  ,
softnet_data   
)
DEFINE_RWLOCK ( dev_base_lock  )
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_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_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.

enum gro_result 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.

struct netdev_queue* dev_ingress_queue_create ( struct net_device dev)
read

Definition at line 5995 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_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_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.

bool dev_valid_name ( const char name)

Definition at line 849 of file dev.c.

EXPORT_PER_CPU_SYMBOL ( softnet_data  )
EXPORT_SYMBOL ( dev_base_lock  )
EXPORT_SYMBOL ( dev_add_pack  )
EXPORT_SYMBOL ( __dev_remove_pack  )
EXPORT_SYMBOL ( dev_remove_pack  )
EXPORT_SYMBOL ( netdev_boot_setup_check  )
EXPORT_SYMBOL ( __dev_get_by_name  )
EXPORT_SYMBOL ( dev_get_by_name_rcu  )
EXPORT_SYMBOL ( dev_get_by_name  )
EXPORT_SYMBOL ( __dev_get_by_index  )
EXPORT_SYMBOL ( dev_get_by_index_rcu  )
EXPORT_SYMBOL ( dev_get_by_index  )
EXPORT_SYMBOL ( dev_getbyhwaddr_rcu  )
EXPORT_SYMBOL ( __dev_getfirstbyhwtype  )
EXPORT_SYMBOL ( dev_getfirstbyhwtype  )
EXPORT_SYMBOL ( dev_get_by_flags_rcu  )
EXPORT_SYMBOL ( dev_valid_name  )
EXPORT_SYMBOL ( dev_alloc_name  )
EXPORT_SYMBOL ( netdev_features_change  )
EXPORT_SYMBOL ( netdev_state_change  )
EXPORT_SYMBOL ( netdev_notify_peers  )
EXPORT_SYMBOL ( dev_load  )
EXPORT_SYMBOL ( dev_open  )
EXPORT_SYMBOL ( dev_close  )
EXPORT_SYMBOL ( dev_disable_lro  )
EXPORT_SYMBOL ( register_netdevice_notifier  )
EXPORT_SYMBOL ( unregister_netdevice_notifier  )
EXPORT_SYMBOL ( call_netdevice_notifiers  )
EXPORT_SYMBOL ( net_enable_timestamp  )
EXPORT_SYMBOL ( net_disable_timestamp  )
EXPORT_SYMBOL ( netif_set_real_num_tx_queues  )
EXPORT_SYMBOL ( netif_get_num_default_rss_queues  )
EXPORT_SYMBOL ( __netif_schedule  )
EXPORT_SYMBOL ( dev_kfree_skb_irq  )
EXPORT_SYMBOL ( dev_kfree_skb_any  )
EXPORT_SYMBOL ( netif_device_detach  )
EXPORT_SYMBOL ( netif_device_attach  )
EXPORT_SYMBOL ( skb_checksum_help  )
EXPORT_SYMBOL ( skb_gso_segment  )
EXPORT_SYMBOL ( netif_skb_features  )
EXPORT_SYMBOL ( __skb_tx_hash  )
EXPORT_SYMBOL ( dev_loopback_xmit  )
EXPORT_SYMBOL ( dev_queue_xmit  )
EXPORT_SYMBOL ( netdev_max_backlog  )
EXPORT_SYMBOL ( __skb_get_rxhash  )
EXPORT_SYMBOL ( netif_rx  )
EXPORT_SYMBOL ( netif_rx_ni  )
EXPORT_SYMBOL ( netif_receive_skb  )
EXPORT_SYMBOL ( napi_gro_flush  )
EXPORT_SYMBOL ( dev_gro_receive  )
EXPORT_SYMBOL ( napi_skb_finish  )
EXPORT_SYMBOL ( napi_gro_receive  )
EXPORT_SYMBOL ( napi_get_frags  )
EXPORT_SYMBOL ( napi_frags_finish  )
EXPORT_SYMBOL ( napi_gro_frags  )
EXPORT_SYMBOL ( __napi_schedule  )
EXPORT_SYMBOL ( __napi_complete  )
EXPORT_SYMBOL ( napi_complete  )
EXPORT_SYMBOL ( netif_napi_add  )
EXPORT_SYMBOL ( netif_napi_del  )
EXPORT_SYMBOL ( register_gifconf  )
EXPORT_SYMBOL ( netdev_set_master  )
EXPORT_SYMBOL ( netdev_set_bond_master  )
EXPORT_SYMBOL ( dev_set_promiscuity  )
EXPORT_SYMBOL ( dev_set_allmulti  )
EXPORT_SYMBOL ( dev_get_flags  )
EXPORT_SYMBOL ( dev_change_flags  )
EXPORT_SYMBOL ( dev_set_mtu  )
EXPORT_SYMBOL ( dev_set_group  )
EXPORT_SYMBOL ( dev_set_mac_address  )
EXPORT_SYMBOL ( netdev_update_features  )
EXPORT_SYMBOL ( netdev_change_features  )
EXPORT_SYMBOL ( netif_stacked_transfer_operstate  )
EXPORT_SYMBOL ( register_netdevice  )
EXPORT_SYMBOL ( register_netdev  )
EXPORT_SYMBOL ( netdev_refcnt_read  )
EXPORT_SYMBOL ( netdev_stats_to_stats64  )
EXPORT_SYMBOL ( dev_get_stats  )
EXPORT_SYMBOL ( alloc_netdev_mqs  )
EXPORT_SYMBOL ( free_netdev  )
EXPORT_SYMBOL ( synchronize_net  )
EXPORT_SYMBOL ( unregister_netdevice_queue  )
EXPORT_SYMBOL ( unregister_netdevice_many  )
EXPORT_SYMBOL ( unregister_netdev  )
EXPORT_SYMBOL ( netdev_increment_features  )
EXPORT_SYMBOL ( netdev_printk  )
EXPORT_SYMBOL_GPL ( dev_forward_skb  )
EXPORT_SYMBOL_GPL ( netdev_rx_handler_register  )
EXPORT_SYMBOL_GPL ( netdev_rx_handler_unregister  )
EXPORT_SYMBOL_GPL ( init_dummy_netdev  )
EXPORT_SYMBOL_GPL ( dev_change_net_namespace  )
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.

late_initcall_sync ( initialize_hashrnd  )
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.

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_printk ( const char level,
const struct net_device dev,
const char format,
  ... 
)

Definition at line 6521 of file dev.c.

int netdev_refcnt_read ( const struct net_device dev)

Definition at line 5799 of file dev.c.

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_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.

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.

subsys_initcall ( net_dev_init  )
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.