Commit 65fd2c2a authored by Boris Pismenny's avatar Boris Pismenny Committed by Steffen Klassert

xfrm: gso partial offload support

This patch introduces support for gso partial ESP offload.
Signed-off-by: default avatarBoris Pismenny <borisp@mellanox.com>
Signed-off-by: default avatarRaed Salem <raeds@mellanox.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent e6d14070
...@@ -138,9 +138,11 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb, ...@@ -138,9 +138,11 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb,
skb->encap_hdr_csum = 1; skb->encap_hdr_csum = 1;
if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) if ((!(skb->dev->gso_partial_features & NETIF_F_HW_ESP) &&
!(features & NETIF_F_HW_ESP)) || x->xso.dev != skb->dev)
esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK); esp_features = features & ~(NETIF_F_SG | NETIF_F_CSUM_MASK);
else if (!(features & NETIF_F_HW_ESP_TX_CSUM)) else if (!(features & NETIF_F_HW_ESP_TX_CSUM) &&
!(skb->dev->gso_partial_features & NETIF_F_HW_ESP_TX_CSUM))
esp_features = features & ~NETIF_F_CSUM_MASK; esp_features = features & ~NETIF_F_CSUM_MASK;
xo->flags |= XFRM_GSO_SEGMENT; xo->flags |= XFRM_GSO_SEGMENT;
...@@ -181,7 +183,9 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_ ...@@ -181,7 +183,9 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
if (!xo) if (!xo)
return -EINVAL; return -EINVAL;
if (!(features & NETIF_F_HW_ESP) || x->xso.dev != skb->dev) { if ((!(features & NETIF_F_HW_ESP) &&
!(skb->dev->gso_partial_features & NETIF_F_HW_ESP)) ||
x->xso.dev != skb->dev) {
xo->flags |= CRYPTO_FALLBACK; xo->flags |= CRYPTO_FALLBACK;
hw_offload = false; hw_offload = false;
} }
......
...@@ -78,6 +78,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur ...@@ -78,6 +78,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
} }
if (!skb->next) { if (!skb->next) {
esp_features |= skb->dev->gso_partial_features;
x->outer_mode->xmit(x, skb); x->outer_mode->xmit(x, skb);
xo->flags |= XFRM_DEV_RESUME; xo->flags |= XFRM_DEV_RESUME;
...@@ -101,6 +102,8 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur ...@@ -101,6 +102,8 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
do { do {
struct sk_buff *nskb = skb2->next; struct sk_buff *nskb = skb2->next;
esp_features |= skb->dev->gso_partial_features;
skb_mark_not_on_list(skb2); skb_mark_not_on_list(skb2);
xo = xfrm_offload(skb2); xo = xfrm_offload(skb2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment