* [PATCH net-next] xfrm: gso partial offload support
@ 2019-03-21 14:41 Boris Pismenny
2019-03-26 7:32 ` Steffen Klassert
0 siblings, 1 reply; 2+ messages in thread
From: Boris Pismenny @ 2019-03-21 14:41 UTC (permalink / raw)
To: steffen.klassert, herbert, davem, netdev; +Cc: raeds
This patch introduces support for gso partial ESP offload.
Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Raed Salem <raeds@mellanox.com>
---
net/ipv4/esp4_offload.c | 10 +++++++---
net/xfrm/xfrm_device.c | 3 +++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 8756e0e..c6c84f2 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -138,9 +138,11 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb,
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);
- 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;
xo->flags |= XFRM_GSO_SEGMENT;
@@ -181,7 +183,9 @@ static int esp_xmit(struct xfrm_state *x, struct sk_buff *skb, netdev_features_
if (!xo)
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;
hw_offload = false;
}
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 2db1626..e437b60 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -78,6 +78,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
}
if (!skb->next) {
+ esp_features |= skb->dev->gso_partial_features;
x->outer_mode->xmit(x, skb);
xo->flags |= XFRM_DEV_RESUME;
@@ -101,6 +102,8 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
do {
struct sk_buff *nskb = skb2->next;
+
+ esp_features |= skb->dev->gso_partial_features;
skb_mark_not_on_list(skb2);
xo = xfrm_offload(skb2);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] xfrm: gso partial offload support
2019-03-21 14:41 [PATCH net-next] xfrm: gso partial offload support Boris Pismenny
@ 2019-03-26 7:32 ` Steffen Klassert
0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2019-03-26 7:32 UTC (permalink / raw)
To: Boris Pismenny; +Cc: herbert, davem, netdev, raeds
On Thu, Mar 21, 2019 at 04:41:37PM +0200, Boris Pismenny wrote:
> This patch introduces support for gso partial ESP offload.
>
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> Signed-off-by: Raed Salem <raeds@mellanox.com>
Appied, thanks Boris and Raed!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-26 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 14:41 [PATCH net-next] xfrm: gso partial offload support Boris Pismenny
2019-03-26 7:32 ` Steffen Klassert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.