Skip to content

Commit 234d1ef

Browse files
qsnklassert
authored andcommitted
xfrm: restore GSO for SW crypto
Commit 49431af incorrectly assumes that the GSO path is only used by HW offload, but it's also useful for SW crypto. This patch re-enables GSO for SW crypto. It's not an exact revert to preserve the other changes made to xfrm_dev_offload_ok afterwards, but it reverts all of its effects. Fixes: 49431af ("xfrm: rely on XFRM offload") Signed-off-by: Sabrina Dubroca <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Reviewed-by: Zhu Yanjun <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 42e4256 commit 234d1ef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

net/xfrm/xfrm_device.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,12 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
415415
struct net_device *dev = x->xso.dev;
416416
bool check_tunnel_size;
417417

418-
if (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED)
418+
if (!x->type_offload ||
419+
(x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap))
419420
return false;
420421

421-
if ((dev == xfrm_dst_path(dst)->dev) && !xdst->child->xfrm) {
422+
if ((!dev || dev == xfrm_dst_path(dst)->dev) &&
423+
!xdst->child->xfrm) {
422424
mtu = xfrm_state_mtu(x, xdst->child_mtu_cached);
423425
if (skb->len <= mtu)
424426
goto ok;
@@ -430,6 +432,9 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
430432
return false;
431433

432434
ok:
435+
if (!dev)
436+
return true;
437+
433438
check_tunnel_size = x->xso.type == XFRM_DEV_OFFLOAD_PACKET &&
434439
x->props.mode == XFRM_MODE_TUNNEL;
435440
switch (x->props.family) {

0 commit comments

Comments
 (0)