#ifndef _NET_DST_CACHE_H #define _NET_DST_CACHE_H #include #include #if IS_ENABLED(CONFIG_IPV6) #include #endif struct dst_cache { struct dst_cache_pcpu __percpu *cache; unsigned long reset_ts; }; /** * dst_cache_get - perform cache lookup * @dst_cache: the cache * * The caller should use dst_cache_get_ip4() if it need to retrieve the * source address to be used when xmitting to the cached dst. * local BH must be disabled. */ struct dst_entry *dst_cache_get(struct dst_cache *dst_cache); /** * dst_cache_get_ip4 - perform cache lookup and fetch ipv4 source address * @dst_cache: the cache * @saddr: return value for the retrieved source address * * local BH must be disabled. */ struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr); /** * dst_cache_set_ip4 - store the ipv4 dst into the cache * @dst_cache: the cache * @dst: the entry to be cached * @saddr: the source address to be stored inside the cache * * local BH must be disabled. */ void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, __be32 saddr); #if IS_ENABLED(CONFIG_IPV6) /** * dst_cache_set_ip6 - store the ipv6 dst into the cache * @dst_cache: the cache * @dst: the entry to be cached * @saddr: the source address to be stored inside the cache * * local BH must be disabled. */ void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst, const struct in6_addr *addr); /** * dst_cache_get_ip6 - perform cache lookup and fetch ipv6 source address * @dst_cache: the cache * @saddr: return value for the retrieved source address * * local BH must be disabled. */ struct dst_entry *dst_cache_get_ip6(struct dst_cache *dst_cache, struct in6_addr *saddr); #endif /** * dst_cache_reset - invalidate the cache contents * @dst_cache: the cache * * This do not free the cached dst to avoid races and contentions. * the dst will be freed on later cache lookup. */ static inline void dst_cache_reset(struct dst_cache *dst_cache) { dst_cache->reset_ts = jiffies; } /** * dst_cache_init - initialize the cache, allocating the required storage * @dst_cache: the cache * @gfp: allocation flags */ int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp); /** * dst_cache_destroy - empty the cache and free the allocated storage * @dst_cache: the cache * * No synchronization is enforced: it must be called only when the cache * is unsed. */ void dst_cache_destroy(struct dst_cache *dst_cache); #endif input class='txt' type='search' size='10' name='q' value=''/>
path: root/net
AgeCommit message (Expand)AuthorFilesLines
2017-02-05net: remove __napi_complete()Eric Dumazet1-21/+3
2017-02-04net: ipv6: Use compressed IPv6 addresses showing route replace errorDavid Ahern1-1/+1
2017-02-04net: ipv6: Change notifications for multipath delete to RTA_MULTIPATHDavid Ahern2-1/+28
2017-02-04net: ipv6: Change notifications for multipath add to RTA_MULTIPATHDavid Ahern2-3/+53
2017-02-04net: ipv6: Add support to dump multipath routes via RTA_MULTIPATH attributeDavid Ahern2-17/+105
2017-02-04net: ipv6: Allow shorthand delete of all nexthops in multipath routeDavid Ahern1-2/+36
2017-02-03net: skb_needs_check() accepts CHECKSUM_NONE for txEric Dumazet1-3/+4
2017-02-03net: remove support for per driver ndo_busy_poll()Eric Dumazet2-16/+0
2017-02-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-nextDavid S. Miller53-640/+576
2017-02-03sched: cls_flower: expose priority to offloading netdeviceJiri Pirko1-0/+3
2017-02-03tcp: clear pfmemalloc on outgoing skbEric Dumazet1-0/+7
2017-02-03net: ipv6: Set protocol to kernel for local routesDavid Ahern1-0/+1
2017-02-03bridge: vlan dst_metadata hooks in ingress and egress pathsRoopa Prabhu6-2/+82
2017-02-03bridge: per vlan dst_metadata netlink supportRoopa Prabhu7-48/+641
2017-02-03net/sched: act_ife: Change to use ife moduleYotam Gigi2-78/+33
2017-02-03net: Introduce ife encapsulation moduleYotam Gigi5-0/+165
2017-02-03net/sched: act_ife: Unexport ife_tlv_meta_encodeYotam Gigi1-2/+2
2017-02-03tcp: add tcp_mss_clamp() helperEric Dumazet