diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-02-14 09:02:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-15 15:17:11 -0500 |
commit | 68c331631143f5f039baac99a650e0b9e1ea02b6 (patch) | |
tree | c69d73c5599aab5e92a8c99bc5343c9fc9ffbbd8 /include/linux/skbuff.h | |
parent | 05e8ef4ab2d8087d360e814d14da20b9f7fb2283 (diff) |
v4 GRE: Add TCP segmentation offload for GRE
Following patch adds GRE protocol offload handler so that
skb_gso_segment() can segment GRE packets.
SKB GSO CB is added to keep track of total header length so that
skb_segment can push entire header. e.g. in case of GRE, skb_segment
need to push inner and outer headers to every segment.
New NETIF_F_GRE_GSO feature is added for devices which support HW
GRE TSO offload. Currently none of devices support it therefore GRE GSO
always fall backs to software GSO.
[ Compute pkt_len before ip_local_out() invocation. -DaveM ]
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ca6ee7d93edb..821c7f45d2a7 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -314,6 +314,8 @@ enum { | |||
314 | SKB_GSO_TCPV6 = 1 << 4, | 314 | SKB_GSO_TCPV6 = 1 << 4, |
315 | 315 | ||
316 | SKB_GSO_FCOE = 1 << 5, | 316 | SKB_GSO_FCOE = 1 << 5, |
317 | |||
318 | SKB_GSO_GRE = 1 << 6, | ||
317 | }; | 319 | }; |
318 | 320 | ||
319 | #if BITS_PER_LONG > 32 | 321 | #if BITS_PER_LONG > 32 |
@@ -2732,6 +2734,21 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
2732 | } | 2734 | } |
2733 | #endif | 2735 | #endif |
2734 | 2736 | ||
2737 | /* Keeps track of mac header offset relative to skb->head. | ||
2738 | * It is useful for TSO of Tunneling protocol. e.g. GRE. | ||
2739 | * For non-tunnel skb it points to skb_mac_header() and for | ||
2740 | * tunnel skb it points to outer mac header. */ | ||
2741 | struct skb_gso_cb { | ||
2742 | int mac_offset; | ||
2743 | }; | ||
2744 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | ||
2745 | |||
2746 | static inline int skb_tnl_header_len(const struct sk_buff *inner_skb) | ||
2747 | { | ||
2748 | return (skb_mac_header(inner_skb) - inner_skb->head) - | ||
2749 | SKB_GSO_CB(inner_skb)->mac_offset; | ||
2750 | } | ||
2751 | |||
2735 | static inline bool skb_is_gso(const struct sk_buff *skb) | 2752 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2736 | { | 2753 | { |
2737 | return skb_shinfo(skb)->gso_size; | 2754 | return skb_shinfo(skb)->gso_size; |