From patchwork Mon Jul 4 20:44:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Buslov X-Patchwork-Id: 12905825 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3839C433EF for ; Mon, 4 Jul 2022 20:45:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232318AbiGDUpq (ORCPT ); Mon, 4 Jul 2022 16:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiGDUpo (ORCPT ); Mon, 4 Jul 2022 16:45:44 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3399B2630 for ; Mon, 4 Jul 2022 13:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ixOdQmAp73/ujWpTKmwLtswkojT5jT+I0ToUwEmqZk8Fv79HbGshwHHNw5AX+TgL31QF3ePZzbkYYN/bcC05xrXlbKfH0bHnpVaB+U/wk4tAXmXZAIVuq7PbheJRMaLJdleOnLKyzDetFix4z+mQudEGS8c97TztZCdJeurbs2hQRKpC34rPCH3ulo47eSVO/4exhrGVEiAJ6lM90NosU2N3lY2HfJXDT/SNJrkAcZtWzLK8UKEtorBoLyOfxANyis98RuKvlkPbnn4AMJjXxfY+DAbNqh3jyKq6ArspxH/GCX72EB8WR4F79eYYwLExdwNUkyCGc4GT5FWI78BD8g== 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=29Y/mdOUer6RehseOtWrvi+EtRNA+M8mGwcrpK2WeY4=; b=K+fhtks0Su3+iKNicxIRPR7kAO6Pw2iJXkB2aogWPsq3+yhQYb8+xaWWOOPaxOILz4yufkG4JqnJKwuAQmYv6BUYizvEmglofq4Fpp5N/Ldc4pwLChd8RSwyPfErHeDr4XvHWgJOUXJIIKSTwYwlAnx0tf2lphZlIc1oLGCWV6xRJd7ORTv1Q5PtcpT1nd4+UtdEhp+xjqIVwVFUZ4SfesuhDTM8ubod28M5+z44CBTFREbOFprRrG7V6qRck/1VB6KUsOS3UcniHoH/bE8VykCgIud8TFs/r4no6hEUYZgfUKEA+FuzFIPIuY3+28Ful4Ac5CRTX2DYPYNcX1c88Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=mojatatu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=29Y/mdOUer6RehseOtWrvi+EtRNA+M8mGwcrpK2WeY4=; b=NQexOPUnPnvNwy1s3t7tmWTEAPTRkuy49a+7GHCK0VSeDd10a1I4tKVsBJGcaZp6IKn0Om+LCmRvRHTGbSylOqaPF5uehNRwZIpgGEyaQAx00wo5g45uD1KTpEMOcOWYD2xutIVsAezZFTGfr+DHPApo1x1SzgUjTHKW98vfkDsijLqBKuEwNQ3+0uQapXVHOFjTVBBOjVLMBgvHmP62GkEKbzkJShfTkEiS4ye0pCIZF8SXerhMKDrMrwB7qklaZOkf84vKYtPG+fxygbWr1xLmUT1ly7WMu7Kvyvk5cR2Fblia6Ti3L0VgfbThkHzBCqsLZEcWvq7hKzfKQY2uMw== Received: from MW4PR03CA0130.namprd03.prod.outlook.com (2603:10b6:303:8c::15) by DM6PR12MB4420.namprd12.prod.outlook.com (2603:10b6:5:2a7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Mon, 4 Jul 2022 20:45:41 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8c:cafe::f4) by MW4PR03CA0130.outlook.office365.com (2603:10b6:303:8c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Mon, 4 Jul 2022 20:45:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Mon, 4 Jul 2022 20:45:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 4 Jul 2022 20:45:40 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 4 Jul 2022 13:45:40 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Mon, 4 Jul 2022 13:45:37 -0700 From: Vlad Buslov To: , , CC: , , , , , , , Vlad Buslov Subject: [PATCH net 1/2] net/sched: act_police: allow 'continue' action offload Date: Mon, 4 Jul 2022 22:44:04 +0200 Message-ID: <20220704204405.2563457-2-vladbu@nvidia.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220704204405.2563457-1-vladbu@nvidia.com> References: <20220704204405.2563457-1-vladbu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52784aa3-d11f-45db-7820-08da5dfe28c3 X-MS-TrafficTypeDiagnostic: DM6PR12MB4420:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DU9wB9+nWhV4xRD1ZSot4iezUd34KYFH/sUppEHIG6Qa0cTgOuatdPL8oSeBZQf4Bg9lLHUHKMW38BwvUpqw76zQGGJ0ZEhw/PXozJNEEnxqZIQuRorKdvEH8RyobdUf68Gu5GLZWLqSuJMQpnVw2piAeqwEwaVE0NT2hj8f/CkhoDyNqt7RdXvN5pHJpwd3V86yTDyi6VZ7mxO9kh2xn1YW81VMFVFZu6G9V9li2AcO2dfal1Zj0elgz5X+2lkYQ1/8i0I4CUJ0IpRGJJgt2GtCFghp364aVB/ZvY2Ae5VKDFgawxiqfyNOjgYGlwwUGjYGWSuXkte7TjySCG+NUtExpHkljnF2qJ6DPlgyldI5EDxS886zD/PtIGUsNNnecBogmghqP+L1DgB2Xm8dvtvAZ4XnOkCBmPE+m0TpzOxeZJ62eqICit3WQVk6fnh+Yc+pzDcW76mrl3svNSE9fMt1fql25il7+7Du3y7AhlABftBffRQafW9iL1XLKmXXkpclpgD0y31to4tQObVrYnWcBNCw3JW8rYNOW4EoeO6bC4VdCVQvOgKsCiZi5cIii0qPFI/L9FeRxMiHMhixEZ1XsHqSLfMIegnquTvVj4rivdoEi/gaHrnM9mCdUJHhZJJ0D1cXr/HTK28uOUhuIJBBJmbZ9Qn+oVIR9qitiVCZ7cw3beW28iCUZFlEBuzSamd10fhMY8nruxPSCSpuzPKV17SmkrqiYPzSwRRIub+/OOsVSBvBiAidALAQegT2vJX5VprHouRPRYCGntdcBL0LLnuuGEsDYsOCN+BXNvmpwHJiWO6qC0Xd7SVjb7RUcIiQnJU9q13lLacL4M6UoHGNRFRLaeWbp6+lpraPe88= X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230016)(4636009)(376002)(396003)(136003)(346002)(39860400002)(40470700004)(36840700001)(46966006)(5660300002)(36860700001)(86362001)(81166007)(107886003)(336012)(426003)(186003)(47076005)(83380400001)(356005)(36756003)(2616005)(1076003)(82740400003)(8936002)(478600001)(26005)(7696005)(110136005)(54906003)(6636002)(41300700001)(316002)(70586007)(70206006)(2906002)(40480700001)(8676002)(6666004)(4326008)(40460700003)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2022 20:45:41.2071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52784aa3-d11f-45db-7820-08da5dfe28c3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4420 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Offloading police with action TC_ACT_UNSPEC was erroneously disabled even though it was supported by mlx5 matchall offload implementation, which didn't verify the action type but instead assumed that any single police action attached to matchall classifier is a 'continue' action. Lack of action type check made it non-obvious what mlx5 matchall implementation actually supports and caused implementers and reviewers of referenced commits to disallow it as a part of improved validation code. Fixes: b8cd5831c61c ("net: flow_offload: add tc police action parameters") Fixes: b50e462bc22d ("net/sched: act_police: Add extack messages for offload failure") Signed-off-by: Vlad Buslov Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel --- include/net/flow_offload.h | 1 + net/sched/act_police.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 6484095a8c01..7ac313858037 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -152,6 +152,7 @@ enum flow_action_id { FLOW_ACTION_PIPE, FLOW_ACTION_VLAN_PUSH_ETH, FLOW_ACTION_VLAN_POP_ETH, + FLOW_ACTION_CONTINUE, NUM_FLOW_ACTIONS, }; diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 79c8901f66ab..b759628a47c2 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c @@ -442,7 +442,7 @@ static int tcf_police_act_to_flow_act(int tc_act, u32 *extval, act_id = FLOW_ACTION_JUMP; *extval = tc_act & TC_ACT_EXT_VAL_MASK; } else if (tc_act == TC_ACT_UNSPEC) { - NL_SET_ERR_MSG_MOD(extack, "Offload not supported when conform/exceed action is \"continue\""); + act_id = FLOW_ACTION_CONTINUE; } else { NL_SET_ERR_MSG_MOD(extack, "Unsupported conform/exceed action offload"); } From patchwork Mon Jul 4 20:44:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Buslov X-Patchwork-Id: 12905826 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44744C43334 for ; Mon, 4 Jul 2022 20:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiGDUpx (ORCPT ); Mon, 4 Jul 2022 16:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbiGDUpt (ORCPT ); Mon, 4 Jul 2022 16:45:49 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23D95DF80 for ; Mon, 4 Jul 2022 13:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a50v+XikkdQeO+5NJSyCO5mzKPDMf9M44pqQ40RhuiRaJISQxZVu0LMdSKKwVxbtOy6MdtTQ4fWxXHAQciYT5chRFr8fXfuVQgNLTy8Z1hmfcxdEHi5OwRYpD73qdRjiwqfQkv5Re0VwWMZVcdEe1V4UpYL5Ui+JZfsubRkUtPajeoGWUJ5C4nLRDaFxZbVwiQsUgTm0oy8ctpfMaB5l7ebRjEPfrx+vZxaMHfxn5dRBIpV1Q+qyIJ9Q+XROS3M2H4wfSy5/Kollj30H0prhl/RSZIBWIMa37bSZp52RnZxGq4UIIlVEUq/QorNQ/MWuAoh3oYhbm9+xxxcyxbjtTA== 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=uKIzGVmm2iNOk/pR8iWCM0u7SkRPzV6n+vY43b43CB4=; b=oBw0Evmng7P72MXqWDgAlClw5XrUVFv2eahKtdtvpG63hbaj4pjZhg8O9BXxlQevHCKD2O21ysnAM7iwSEEtsQ2Vp1qaJRi/jB2TGpQHLo6Q3ArzfGI3GEWRJV2304tl5uNULequX15gfyfcFI0krH2dQqsNoTrIEi0HE55AfoBmnh0UGJNpndFHoJOvYLn5HsOBWCJf5S3o+U1OzCff0PKUxKiyGue+HNjq3lBAnPYHOKkl3Glj8T8x50mcgU1pOmfuOtugDrYwsgmXBKqa9h1b0lnwYuASP3N9wDCf+11TChnWGBRyzcdFBMJd6bnduaAB83VeUgRn65WPHahH6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=mojatatu.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uKIzGVmm2iNOk/pR8iWCM0u7SkRPzV6n+vY43b43CB4=; b=Wp5SVvXPVt8XgNEwRfrwqrDBr/e9Bq6PQJ6NJ5lXQcr9DiJ/FW/bw0a2d3TyNqLmUHArxZxclACjEN1t10zbZKKLI45QYae4oofPN4ixxwx9YaSeMwWDk2TjPy26dcFCY7SgnGHNiJi3Ubqj4tI+W9Bbl4P+2x6oMd3rlr8E7UJSITO0vg/c3lZ8MaNyUdmZ1vKGjzHVykbz44EDNZxorOXcB09/213IuBuLIz/nFPSprisRWEKU+jYqMHsr4eZYwqGYbhCamJaHdfGVmdwmxXYmz+aXovtRIhYgkjr/rlk/5NrLHiQFfD4IsPTbPu5cPzYBzFdI6gMGWwySeKGn4Q== Received: from BN0PR02CA0009.namprd02.prod.outlook.com (2603:10b6:408:e4::14) by BY5PR12MB3826.namprd12.prod.outlook.com (2603:10b6:a03:1a1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Mon, 4 Jul 2022 20:45:45 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::ea) by BN0PR02CA0009.outlook.office365.com (2603:10b6:408:e4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Mon, 4 Jul 2022 20:45:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Mon, 4 Jul 2022 20:45:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 4 Jul 2022 20:45:43 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 4 Jul 2022 13:45:43 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Mon, 4 Jul 2022 13:45:40 -0700 From: Vlad Buslov To: , , CC: , , , , , , , Vlad Buslov Subject: [PATCH net 2/2] net/mlx5e: Fix matchall police parameters validation Date: Mon, 4 Jul 2022 22:44:05 +0200 Message-ID: <20220704204405.2563457-3-vladbu@nvidia.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220704204405.2563457-1-vladbu@nvidia.com> References: <20220704204405.2563457-1-vladbu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ce92f47-9332-46b1-e20c-08da5dfe2ad0 X-MS-TrafficTypeDiagnostic: BY5PR12MB3826:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yMS1rzApU3a10QEZoxaSMYcjoyOInOQkWha2uClIUUJGb0tiEmf2WXxwzNGXMMno6XL/yCZqOAyVVC0MC1r/WM+K+vUj4qCPh/IEgy+Z4f+bDSE5iBaPCCQ4qPgeH6pDJbOGG1Ay4rxB3L8wew99Np8yNKm4qseDJd05zAyqmtTA/XiYtWSzTuE0Pg5uhIgWrhtBgQzE1NUPdBbdCcYtR/V327HCaPkzSukSuSAz/zv1fsT6n+dEQbY1adI+0Q4tIGIOyy4Oj9ELWPo6VcEiVoOjwu4jGm1mClGq9GR7izc5L1PUkeCM8qExmdtnXsk4czwaC2+g6SMncuJ0mlMNDdUzVrd+AXloe7ez9mwjgdvW2uDe0O37GlgqPYIA2JNX5DBcmT1xrwBdGbJviLOhH4ELhADNgOk2P5Ykq/PsK17YoHy8S0iLyWwsg3tppXJHGZ9a4y/4Jlfll7vExycp/SQ4pcLUOiWL88HkowSLb84ahgqqFjcTIF4CzCZT7wBdX8t9ZfCP4GjBaMUQgLgiq9lByVF6A0aocjbMGmm4fE2pZt9BrY2hRlX93oVEMyxnqlctLLQkOP1wcMm0zr62XPOuwOTY+hH00GJIIZit7jXK3ZSMk/xKDulUCXCj19mt2n4ydBTdGKPprXBErUWWw2lrpRQeW8nK0S8ogdzJIV6nvVc9XkDHHpPCeeUFJNmMyf5TlmmPQG/JOioxSLvUmcz1HdlSMFkL/iZ1aVuSRS3Zwr8R2d/CMsGPS6mGTMxfteM6oh21PRsBY/2lB2c3LBjmSPa/HvdgOOqfuBiziu3EW8nJHWbGPeUYZqiXFn1ziGsN7Yv9z2Si7duVWjxPonQ9HqbTx7ZRVWYL5PNCERg= X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230016)(4636009)(136003)(376002)(396003)(39860400002)(346002)(46966006)(40470700004)(36840700001)(70206006)(6666004)(41300700001)(8936002)(316002)(478600001)(6636002)(8676002)(4326008)(70586007)(82310400005)(40480700001)(110136005)(356005)(36860700001)(54906003)(83380400001)(47076005)(86362001)(426003)(81166007)(82740400003)(186003)(1076003)(26005)(7696005)(336012)(107886003)(2616005)(5660300002)(36756003)(2906002)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2022 20:45:44.6036 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ce92f47-9332-46b1-e20c-08da5dfe2ad0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3826 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Referenced commit prepared the code for upcoming extension that allows mlx5 to offload police action attached to flower classifier. However, with regard to existing matchall classifier offload validation should be reversed as FLOW_ACTION_CONTINUE is the only supported notexceed police action type. Fix the problem by allowing FLOW_ACTION_CONTINUE for police action and extend scan_tc_matchall_fdb_actions() to only allow such actions with matchall classifier. Fixes: d97b4b105ce7 ("flow_offload: reject offload for all drivers with invalid police parameters") Signed-off-by: Vlad Buslov Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 34bf11cdf90f..3a39a50146dd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -4529,13 +4529,6 @@ static int mlx5e_policer_validate(const struct flow_action *action, return -EOPNOTSUPP; } - if (act->police.notexceed.act_id != FLOW_ACTION_PIPE && - act->police.notexceed.act_id != FLOW_ACTION_ACCEPT) { - NL_SET_ERR_MSG_MOD(extack, - "Offload not supported when conform action is not pipe or ok"); - return -EOPNOTSUPP; - } - if (act->police.notexceed.act_id == FLOW_ACTION_ACCEPT && !flow_action_is_last_entry(action, act)) { NL_SET_ERR_MSG_MOD(extack, @@ -4586,6 +4579,12 @@ static int scan_tc_matchall_fdb_actions(struct mlx5e_priv *priv, flow_action_for_each(i, act, flow_action) { switch (act->id) { case FLOW_ACTION_POLICE: + if (act->police.notexceed.act_id != FLOW_ACTION_CONTINUE) { + NL_SET_ERR_MSG_MOD(extack, + "Offload not supported when conform action is not continue"); + return -EOPNOTSUPP; + } + err = mlx5e_policer_validate(flow_action, act, extack); if (err) return err;