Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp185561pxb; Thu, 31 Mar 2022 02:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPhcgAGillnVrCk6iNieQ+LnrZK3nN07tpYSFP9NF4ukuNGjRAejLxzmir94iJ7+F0hP3t X-Received: by 2002:a63:d218:0:b0:380:64e0:c4e8 with SMTP id a24-20020a63d218000000b0038064e0c4e8mr10222748pgg.320.1648720624992; Thu, 31 Mar 2022 02:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648720624; cv=none; d=google.com; s=arc-20160816; b=CuAw3zY2ofrUeaTpSX8kVTrtKrDqDR7VqHalhDeX18wJcDTagySpa00ZR2T5YeVp1G m+1N8cgbvhdxL4rrpTQPw5km1KV3r0rnTibBUhV0rbsw6mKtDIybAvZxQ3Z3JJbRFSSR 6ndQEdaeU00In8AQtFWzOlWQrXsPqhpAsN2EvLQIdKvlmfnA+BCLlSG9lyTn0eXhgT7b bHrecvwagPA7zs/J68LXJnyBmZ1aW0WB3exI9m0ulBxlzbuVAbo4iimBNYf3ElS3q7/b LnDRtm2Wna4OC19ii2WABimGHkp1xyKEvR0OElNavd7pxPGQZFDfvf6UVMNj0wc2Yzfn /YSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=34tjwucDDc6VCrQoiZ+xMYZAw/UA0l3U9rgk7IKKoaU=; b=T/uLe++7OvWutSLqbO59I4CrsOBBKbLnXWNQGL9CaY5aGt0WC4y7cZKGRFlYlLFrvN VviEIy6+7QFjVUwv0QZzVUmzRgQaT2l40xlQYZlCkfxIj6lJFU4B4aoBXDLoFlTnNq0E e9VKlIb0F1CachUpvCgKKG/PLANlBfUCim5f9tffAWRw8n+8jzIx/K2jLCaGfY0ga7Iw CZuPu5kIdol7INIpmfvrLE/6NlFwKVlwhhSyu3j8fX/2/7zxEp85YAZ8CrstzT2XbEwe ojDos+mloBglS5uANub9TagANMwJjF9ejq8Hq8jLRfET1SXo8iFt4p4+wYC1ZQ1er9o5 5HQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XlEjsUNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a17090a480100b001bf1cbbcb9fsi2607527pjh.131.2022.03.31.02.56.51; Thu, 31 Mar 2022 02:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XlEjsUNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232642AbiCaIW0 (ORCPT + 99 others); Thu, 31 Mar 2022 04:22:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232632AbiCaIWZ (ORCPT ); Thu, 31 Mar 2022 04:22:25 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED2F1B84FD; Thu, 31 Mar 2022 01:20:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id ECBBACE20FC; Thu, 31 Mar 2022 08:20:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F29CC340EE; Thu, 31 Mar 2022 08:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648714833; bh=iXTgKFinWeARny9umBHpFewtGh3ktJILaqMuf1C2Ki4=; h=From:To:Cc:Subject:Date:From; b=XlEjsUNMuFyGV1AFKM5uUXqTaQXIUNDx9OczEpSBAIwsFuh1k6rhL56wSNaAu2bMa XoIE9l96UgLY1rmvK4neZhttSkSh4gr26W3YlTn5KAWhoKCcibnRhEg9tWQNt+QbSG dV/VN4EZKtmcW5mAmIT0x4Pc0RV2uOVKrKX+TZiktpWWt74chiCass+fl6swsajFhP Az+NXH5p4qK34OR11g/xQZBxbadK7l+g79ZoM42BdAVyOpuxUPCNdLcHUnK0P+lUjQ rK9O8c1TogyMqZc7Y1wgfT7wpLeZoz407BRG6HK9OClSxlHngAul0DrTd2FWs6WQNe ctEOHb06wMD1w== From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski Cc: Leon Romanovsky , intel-wired-lan@lists.osuosl.org, Jeff Kirsher , Jesse Brandeburg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Paolo Abeni , Raed Salem , Shannon Nelson , Tony Nguyen , Shannon Nelson , Steffen Klassert Subject: [PATCH net v1] ixgbe: ensure IPsec VF<->PF compatibility Date: Thu, 31 Mar 2022 11:20:23 +0300 Message-Id: <737616899df2a482e4ec35aa4056c9ac608d2f50.1648714609.git.leonro@nvidia.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky The VF driver can forward any IPsec flags and such makes the function is not extendable and prone to backward/forward incompatibility. If new software runs on VF, it won't know that PF configured something completely different as it "knows" only XFRM_OFFLOAD_INBOUND flag. Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky a --- Chaagelog: v1: * Replaced bits arithmetic with more simple expression v0: https://lore.kernel.org/all/3702fad8a016170947da5f3c521a9251cf0f4a22.1648637865.git.leonro@nvidia.com --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c index e596e1a9fc75..69d11ff7677d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c @@ -903,7 +903,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) /* Tx IPsec offload doesn't seem to work on this * device, so block these requests for now. */ - if (!(sam->flags & XFRM_OFFLOAD_INBOUND)) { + sam->flags = sam->flags & ~XFRM_OFFLOAD_IPV6; + if (sam->flags != XFRM_OFFLOAD_INBOUND) { err = -EOPNOTSUPP; goto err_out; } -- 2.35.1