From patchwork Fri Oct 29 15:04:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12592933 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EF2AC433F5 for ; Fri, 29 Oct 2021 15:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54E7861166 for ; Fri, 29 Oct 2021 15:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbhJ2PHW (ORCPT ); Fri, 29 Oct 2021 11:07:22 -0400 Received: from mail-bn8nam12on2119.outbound.protection.outlook.com ([40.107.237.119]:28512 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229542AbhJ2PHW (ORCPT ); Fri, 29 Oct 2021 11:07:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ne5+MFz0THuAhrCXKNgugucAbuNxlMd6iMjdY+oezLbZ6PtZLk3sn90I55SxLjZ/QM1DsaQDq7Ll9XuUBwYoB4ttu7QLAimvRFP+VyEcQSJQ3iyLEPkXm+2BLZ5j+gybxebZ9NTUgJBEz1P/hHLcMVR1OSB81iSVAIyCBzbkozR5huhbKn+8pbL/vII27A2D4M0pPf38faWOwz3ZSpJsMX0xhgLj+gjsl/IydEUcdd25tg+mMh3nYnCfi3axwB9g3lCdtHu4g2BtgL/IhdMSrSXEVtWddnR8ij70Vcs2DffFLmV/PBqupV3qIfYMVFvH3Oww34zGpby3CYRhrYJJQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Jiwnx1IxTNCRKfKlVlVSn9yKlaWjSp3ypJUPoydXEOQ=; b=VYh9l0BsagkU/bHAD1ekhf7qp4OUY9kWHRxjRlC3FV6NinQDIc88sWxgQH6m2i9NKYzsV+JoryrVwt5moBwy6gt8R+pXpgXC6f+scYbNUbyfRTt47uYJynj8y00FCrj5fImZcBG5fUtGzqz+yinezEzYWsfZsZnBSxGfJM2aR0S0vG+HKe3eL8aCAsGJCABJhlNzM1+3DYQ8VkExXlALayGq7DMobQmDkQmj5eQ/CZ+2ei0IRbP3+XE/PHGuBO3JK53bF3F3aLYKbtooYdCl19RyVjt9yVdQQ3hdGfEpcOLNuINjfdAmvw1U8a6BnwVx3g7gdgfabwfec1XYpk/psQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jiwnx1IxTNCRKfKlVlVSn9yKlaWjSp3ypJUPoydXEOQ=; b=sczbaKSm1WpVtFPYnpcSXyXYkR6hpg8v5TSoix/s738HwCQaqiZN4aepehOb30gPjYAoKeOGuQumwMR2G39WWcsatg2HeMjC7qSD0SE+QBmkLARumbtbvchjGzXx1PCOX249+yItoL9c25aMizMePMvoKyPuCPpg/C1GdwfZdY4= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH0PR13MB5681.namprd13.prod.outlook.com (2603:10b6:510:110::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13; Fri, 29 Oct 2021 15:04:51 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::e1d9:64d0:cb4f:3e90%9]) with mapi id 15.20.4669.005; Fri, 29 Oct 2021 15:04:51 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Yu Xiao , Louis Peens , Simon Horman Subject: [PATCH net-next] nfp: flower: Allow ipv6gretap interface for offloading Date: Fri, 29 Oct 2021 17:04:29 +0200 Message-Id: <20211029150429.23905-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: AM0PR01CA0155.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::24) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 Received: from momiji.horms.nl (2001:982:756:703:d63d:7eff:fe99:ac9d) by AM0PR01CA0155.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Fri, 29 Oct 2021 15:04:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b77760a-ffb3-4717-ce43-08d99aed750e X-MS-TrafficTypeDiagnostic: PH0PR13MB5681: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vRPnPNl6i53YrjWIn26cqQmd7QmRrpjVCa9sINTdV3qlJ22th+Ri3uwADw1/U2IC0IGvA97zALWOIXa2WHKL+BQCPjte2xdiw1w4z1a/+b3IcbkbPZLsMwOFwJX6/h5m+VPJYgurwX8i5zGySRBHNz1SsApY6G/VsqGJfnP7Y+TdM9sdNxmlya13flWaT8kefxdoFJie0kRpK8iTFOxPPfzlFr94Gbx1zF2vI1NIeMLeUkEcCzWhlWIikGdSu8bvst9sHUFzREqp10Cb16WAvEoZylCLpWmOttaW6VnGC2AxgUn0ORkTfDLOqgkLm5i86NhX6InTObHudhw+6/S7uAvHBY3AmxmL3XpkpTZIyqun1ASJSAvkXL6hlMErWmQsEPNBVE7tdCACbf5WNjKVwV+s2a3accfAD6BoEEWPxMBfsOA5u3Fm+1h9eYYlIrhmzI9EkoSKMWEbgv7NuMCFODE5VVZXPV+feQAejn/I0V2KRoQcUwkXK0jeztdRlZlMqjLQsRnbsfaP+wGWijzqP4xVWiptltEHMIM5NjawdQDR6lABo1YDy29N3bSLJluusQtgvetvqyj1qhrvUIk8dMGGZqpRfXPCjDGt3VbYOmCcoeFJNb4muXgxejhcuHdFwnGHpyO6OsMnjVq81Ful2DOUXba7JlCiL3va8278lF/ET4M2CUxqnvzw6IMsn7LnSJtNG0I1om7OS8gOcHFOZw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(39840400004)(376002)(136003)(366004)(396003)(316002)(1076003)(38100700002)(8676002)(8936002)(6512007)(66556008)(86362001)(66476007)(107886003)(52116002)(4326008)(2616005)(6486002)(6666004)(6506007)(508600001)(44832011)(83380400001)(2906002)(36756003)(110136005)(54906003)(66946007)(186003)(5660300002)(32563001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0wqefC41cK0OaUiwPQ2CNLUwjRCVjxhv2p+atCiWeQE5aOs+J7YQh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U7tfFwEimm3sbu0w8PzQqI42j+qXohnRCURnu2ViUup/ZJJIPaGRJB7KCdafomXvJrTYFHxZ+TzJcuyX4oicivlPmCxFRYIkGXxcIAWvzWpMwUV0XfqyMdcY0Nt6tMfibUsYP6aGoBwV8mL7kIVtJ4EUciscXZ5zlx1SXY6apBCkkgT91oeQcOjNCkM5EuydL9TO5pzct8Hmm1+nKGXffrvfGCCykpUQDvp0yFZrNK91EKftuqUucSaRZo8FYG6CLIVyBzMWzO1hmCS1wsq/ojor8czk1sQsG6AnmVRR7KPHyaw7LqEgyT0lo5ak9tTN2vfp2jtlYCg7LrwMe9ZahKtvhgqd2UAwhqGsfF8gcRGs81jHY4/wjQ+KBzV0UMTOuF99ZYb9jozr3jh8CzGWLeZOHl/4qENaD7GPZc2O7YNzYENxoiQpd5Lu/XDjD+k2Ft3gLSgFi6BW2pluWoSar4jUvUIjv2OalA3aIuhkMzkL8FS/7qGEWaVmCe0jWufoa16k10f2bn7sAtL+wvDUEv8nCnRu9+R1XqOZcx0WDmW6agPvITVM4A+b1qpiWSlJssIpnafo7xxTmDJhroHstSTQL4itOswxzkOm3l1KxNlgMBf5e112dZFRZp4VZw8g8= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b77760a-ffb3-4717-ce43-08d99aed750e X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2021 15:04:51.3488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 185lWb0X9UXjoYr1JeHpXl5MRCekV+HWc/6gNE99H4EdT7KARQHM2NZzpUZcaldBGr1XipfkLtUKefOexHjawoyMCFrRl61CwMRkRRkZsGI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5681 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yu Xiao The tunnel_type check only allows for "netif_is_gretap", but for OVS the port is actually "netif_is_ip6gretap" when setting up GRE for ipv6, which means offloading request was rejected before. Therefore, adding "netif_is_ip6gretap" allow ipv6gretap interface for offloading. Signed-off-by: Yu Xiao Signed-off-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/flower/action.c | 3 ++- drivers/net/ethernet/netronome/nfp/flower/cmsg.h | 2 +- drivers/net/ethernet/netronome/nfp/flower/offload.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c index 2a432de11858..a3242b36e216 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/action.c +++ b/drivers/net/ethernet/netronome/nfp/flower/action.c @@ -272,7 +272,8 @@ nfp_flower_tun_is_gre(struct flow_rule *rule, int start_idx) for (act_idx = start_idx + 1; act_idx < num_act; act_idx++) if (act[act_idx].id == FLOW_ACTION_REDIRECT || act[act_idx].id == FLOW_ACTION_MIRRED) - return netif_is_gretap(act[act_idx].dev); + return netif_is_gretap(act[act_idx].dev) || + netif_is_ip6gretap(act[act_idx].dev); return false; } diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h index a2926b1b3cff..784292b16290 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h +++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h @@ -703,7 +703,7 @@ nfp_fl_netdev_is_tunnel_type(struct net_device *netdev, { if (netif_is_vxlan(netdev)) return tun_type == NFP_FL_TUNNEL_VXLAN; - if (netif_is_gretap(netdev)) + if (netif_is_gretap(netdev) || netif_is_ip6gretap(netdev)) return tun_type == NFP_FL_TUNNEL_GRE; if (netif_is_geneve(netdev)) return tun_type == NFP_FL_TUNNEL_GENEVE; diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 64c0ef57ad42..224089d04d98 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -360,7 +360,7 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_PORTS)) { /* check if GRE, which has no enc_ports */ - if (!netif_is_gretap(netdev)) { + if (!netif_is_gretap(netdev) && !netif_is_ip6gretap(netdev)) { NL_SET_ERR_MSG_MOD(extack, "unsupported offload: an exact match on L4 destination port is required for non-GRE tunnels"); return -EOPNOTSUPP; }