The TOFFEE Project
The TOFFEE Project

Videos :: Linux Kernel dst_entry data-structure

Written by: Kiran Kankipati - Published: 04-May-2017

Watch Video: 214 Introduction and code-walk - Linux Kernel struct dst_entry datastructure - ep1

* Click the image above to watch this video on Youtube ↗

For more details refer Linux Source:
skb_dst() -
skb_dst_set() -

And here is the copy paste of struct dst_entry data-structure (/include/net/dst.h) from the Kernel-source version 4.13 for quick reference:

struct dst_entry {
	struct net_device       *dev;
	struct rcu_head		rcu_head;
	struct dst_entry	*child;
	struct  dst_ops	        *ops;
	unsigned long		_metrics;
	unsigned long           expires;
	struct dst_entry	*path;
	struct dst_entry	*from;
	struct xfrm_state	*xfrm;
	void			*__pad1;
	int			(*input)(struct sk_buff *);
	int			(*output)(struct net *net, struct sock *sk, struct sk_buff *skb);

	unsigned short		flags;
#define DST_HOST		0x0001
#define DST_NOXFRM		0x0002
#define DST_NOPOLICY		0x0004
#define DST_NOCOUNT		0x0008
#define DST_FAKE_RTABLE		0x0010
#define DST_XFRM_TUNNEL		0x0020
#define DST_XFRM_QUEUE		0x0040
#define DST_METADATA		0x0080

	short			error;

	/* A non-zero value of dst->obsolete forces by-hand validation
	 * of the route entry.  Positive values are set by the generic
	 * dst layer to indicate that the entry has been forcefully
	 * destroyed.
	 * Negative values are used by the implementation layer code to
	 * force invocation of the dst_ops->check() method.
	short			obsolete;
	unsigned short		header_len;	/* more space at head required */
	unsigned short		trailer_len;	/* space to reserve at tail */
	unsigned short		__pad3;

	__u32			tclassid;
	__u32			__pad2;

#ifdef CONFIG_64BIT
	 * Align __refcnt to a 64 bytes alignment
	 * (L1_CACHE_SIZE would be too much)
	long			__pad_to_align_refcnt[2];
	 * __refcnt wants to be on a different cache line from
	 * input/output/ops or performance tanks badly
	atomic_t		__refcnt;	/* client references	*/
	int			__use;
	unsigned long		lastuse;
	struct lwtunnel_state   *lwtstate;
	union {
		struct dst_entry	*next;
		struct rtable __rcu	*rt_next;
		struct rt6_info		*rt6_next;
		struct dn_route __rcu	*dn_next;

And here is the copy paste of API skb_dst() which returns the dst_entry linked to the corresponding skbuff instance (include/linux/skbuff.h) from the Kernel-source version 4.13 for quick reference:

 * skb_dst - returns skb dst_entry
 * @skb: buffer
 * Returns skb dst_entry, regardless of reference taken or not.
static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
	/* If refdst was not refcounted, check we still are in a 
	 * rcu_read_lock section
	WARN_ON((skb->_skb_refdst & SKB_DST_NOREF) &&
		!rcu_read_lock_held() &&
	return (struct dst_entry *)(skb->_skb_refdst & SKB_DST_PTRMASK);

Here is the Network data/API flow through kernel for quick reference:
Network data/API flow through kernel for quick reference

Suggested Topics:

Linux Kernel programming
 Linux Kernel TCP Congestion Control Algorithms ↗

 Linux Kernel struct socket and struct sock data-structure ↗

 Linux Kernel /proc Interface ↗

 Linux ioctl() API interface ↗

 Linux Kernel Network Programming ↗

 Linux Kernel Programming ↗

 Linux Kernel sk_buff data-structure - Episode-11 to Episode-18 ↗

 Linux Kernel sk_buff data-structure - Episode-1 to Episode-10 ↗

 Linux Kernel net_device data-structure ↗

 Linux Kernel dst_entry data-structure ↗

 Linux Kernel struct ethhdr data-structure ↗

 Linux Kernel struct iphdr data-structure ↗

 Linux Kernel struct tcphdr data-structure ↗

 Linux Kernel struct udphdr data-structure ↗

 Linux Kernel Networking Sub-system ↗

 Linux Kernel Compilation ↗

 Linux Kernel Architecture - Generic ↗


Recommended Topics:

Featured Educational Video:
Watch Video: Linux Kernel skbuff data-structure - part13 - Parsing skb ip-packet

* Click the image above to watch this video on Youtube ↗

Skype VOIP Data - WAN Acceleration:
  > reduce/eliminate Jitter
  > no more call drops
  > accelerate any VOIP (including long-distance Skype calls)

Research :: Optimization of network data (WAN Optimization) at various levels:
Network File level network data WAN Optimization

Learn Linux Systems Software and Kernel Programming:
Linux, Kernel, Networking and Systems-Software online classes

Hardware Compression and Decompression Accelerator Cards:
TOFFEE Architecture with Compression and Decompression Accelerator Card [CDN]

TOFFEE-DataCenter on a Dell Server - Intel Xeon E5645 CPU:
TOFFEE-DataCenter screenshots on a Dual CPU - Intel(R) Xeon(R) CPU E5645 @ 2.40GHz - Dell Server

The TOFFEE Project - v9.20 :: Updated: 07-Jul-2018 :: © 2018 :: Author: Kiran Kankipati
Your IP: :: Browser: CCBot/2.0 (