summaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_input.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2017-02-15 09:40:00 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2017-02-15 11:04:11 +0100
commit7785bba299a8dc8fe8390a0183dad3cafb3f1d80 (patch)
tree33c29b31f0e66433b340998aa822bebe322aa116 /net/ipv6/xfrm6_input.c
parent54ef207ac8f7a17d677082157a29f4df8499dc81 (diff)
downloadblackbird-op-linux-7785bba299a8dc8fe8390a0183dad3cafb3f1d80.tar.gz
blackbird-op-linux-7785bba299a8dc8fe8390a0183dad3cafb3f1d80.zip
esp: Add a software GRO codepath
This patch adds GRO ifrastructure and callbacks for ESP on ipv4 and ipv6. In case the GRO layer detects an ESP packet, the esp{4,6}_gro_receive() function does a xfrm state lookup and calls the xfrm input layer if it finds a matching state. The packet will be decapsulated and reinjected it into layer 2. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/xfrm6_input.c')
-rw-r--r--net/ipv6/xfrm6_input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index 662fb2c3e765..08a807b29298 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -33,6 +33,8 @@ EXPORT_SYMBOL(xfrm6_rcv_spi);
int xfrm6_transport_finish(struct sk_buff *skb, int async)
{
+ struct xfrm_offload *xo = xfrm_offload(skb);
+
skb_network_header(skb)[IP6CB(skb)->nhoff] =
XFRM_MODE_SKB_CB(skb)->protocol;
@@ -44,6 +46,11 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async)
ipv6_hdr(skb)->payload_len = htons(skb->len);
__skb_push(skb, skb->data - skb_network_header(skb));
+ if (xo && (xo->flags & XFRM_GRO)) {
+ skb_mac_header_rebuild(skb);
+ return -1;
+ }
+
NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING,
dev_net(skb->dev), NULL, skb, skb->dev, NULL,
ip6_rcv_finish);
OpenPOWER on IntegriCloud