From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2333AC49ED6 for ; Wed, 11 Sep 2019 14:50:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 002F320644 for ; Wed, 11 Sep 2019 14:50:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728237AbfIKOuU (ORCPT ); Wed, 11 Sep 2019 10:50:20 -0400 Received: from 2098.x.rootbsd.net ([208.79.82.66]:38824 "EHLO pilot.trilug.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727627AbfIKOuT (ORCPT ); Wed, 11 Sep 2019 10:50:19 -0400 Received: by pilot.trilug.org (Postfix, from userid 8) id D6DAF169753; Wed, 11 Sep 2019 10:50:18 -0400 (EDT) Received: from michaelmarley.com (cpe-2606-A000-BFC0-90-509-B1D3-C76D-19C7.dyn6.twc.com [IPv6:2606:a000:bfc0:90:509:b1d3:c76d:19c7]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pilot.trilug.org (Postfix) with ESMTPSA id 5FE9A169748; Wed, 11 Sep 2019 10:50:17 -0400 (EDT) Received: from michaelmarley.com (localhost [127.0.0.1]) by michaelmarley.com (Postfix) with ESMTP id 63BF218160F; Wed, 11 Sep 2019 10:50:16 -0400 (EDT) Received: from michaelmarley.com ([::1]) by michaelmarley.com with ESMTPA id wR4xGKgJeV3IggEAnAHMIA (envelope-from ); Wed, 11 Sep 2019 10:50:16 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 11 Sep 2019 10:50:16 -0400 From: Michael Marley To: Steffen Klassert Cc: Shannon Nelson , netdev@vger.kernel.org, Jeff Kirsher Subject: Re: ixgbe: driver drops packets routed from an IPSec interface with a "bad sa_idx" error In-Reply-To: <20190911061547.GR2879@gauss3.secunet.de> References: <10ba81d178d4ade76741c1a6e1672056@michaelmarley.com> <4caa4fb7-9963-99ab-318f-d8ada4f19205@pensando.io> <90dd9f8c-57fa-14c7-5d09-207b84ec3292@pensando.io> <6ab15854-154a-2c7c-b429-7ba6dfe785ae@michaelmarley.com> <20190911061547.GR2879@gauss3.secunet.de> User-Agent: Roundcube Webmail/1.4-rc1 Message-ID: <12d6d2313eeb61a51731a2ba9b1fa9bf@michaelmarley.com> X-Sender: michael@michaelmarley.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019-09-11 02:15, Steffen Klassert wrote: > On Tue, Sep 10, 2019 at 06:53:30PM -0400, Michael Marley wrote: >> >> StrongSwan has hardware offload disabled by default, and I didn't >> enable >> it explicitly.  I also already tried turning off all those switches >> with >> ethtool and it has no effect.  This doesn't surprise me though, >> because >> as I said, I don't actually have the IPSec connection running over the >> ixgbe device.  The IPSec connection runs over another network adapter >> that doesn't support IPSec offload at all.  The problem comes when >> traffic received over the IPSec interface is then routed back out >> (unencrypted) through the ixgbe device into the local network. > > > Seems like the ixgbe driver tries to use the sec_path > from RX to setup an offload at the TX side. > > Can you please try this (completely untested) patch? > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > index 9bcae44e9883..ae31bd57127c 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > @@ -36,6 +36,7 @@ > #include > #include > #include > +#include > > #include "ixgbe.h" > #include "ixgbe_common.h" > @@ -8696,7 +8697,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff > *skb, > #endif /* IXGBE_FCOE */ > > #ifdef CONFIG_IXGBE_IPSEC > - if (secpath_exists(skb) && > + if (xfrm_offload(skb) && > !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) > goto out_drop; > #endif With the patch, the problem is gone. Thanks! Michael