From patchwork Fri Dec 3 12:24:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12655035 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 01619C433F5 for ; Fri, 3 Dec 2021 12:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244220AbhLCM2a (ORCPT ); Fri, 3 Dec 2021 07:28:30 -0500 Received: from mail-co1nam11on2130.outbound.protection.outlook.com ([40.107.220.130]:65377 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233378AbhLCM2a (ORCPT ); Fri, 3 Dec 2021 07:28:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3C1NDmlLFgwdDfClgb1k6bTjfk4khFs7XAgPSJmh/yJE5i/CLcztGq4uoIzmCDytq2YJFDgKN3H64iwdKBELISYRNCxWmZIDMLm1LWCDlDnJMzZrK+MWj8R3JY6hn5rqJ0e1pm+GHGt8p3gaZSRExSdYpYqhUyX7szYOXeVTmh7xjzhK3up7FJd7rkRj+2kcTOph0IS1sMaMT8pPxptxQ7puJv+6MW+6c6nbyn2fuNAWidl6NQn68kCFeZcAAdm0QnU9B7SZz66b2LA3RXYpnr/sCM6EheWzGq/1Pw11ucDZAZuw7FInU6U7VkQpbGdnUt3NU9+u3RgWia7SPsq4w== 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=p8LLQp3zHRSWSnacjGf5qSBjctEdinbafUimocvkGnM=; b=KWikxh+zCvYfbFi/lsPFmMEfzFau1jYc212yjoB0vLz+X5lN+eRCmJ8XPi9MbRUfQfTKfP4VVwzMjX5j5xKP/sLeSqq4YnVj0MQqWSiroerWagjLbAFMiG2UWRWn7qDLVBYOEiv8JQt55mtM1QJBumma+Gu5mErEkQM7yGQD7+34x76nh46aI/AQTeW2GuaTXgG0N5CwfG1ngLAgwiPGNhQjORd6/ZULT7P9ntE6w2G7LtAex1ajd61Kg84y6OoivayImadk2IkEogS5oHfKQyOSh9/TTLeiCNQgY2PbNCJb5X4CXdgpeuVoalJXRPNLVS95kF9yQl69j3hWfdugpg== 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=p8LLQp3zHRSWSnacjGf5qSBjctEdinbafUimocvkGnM=; b=rwKVj+RiFgrRxCwt7FF217sRrr5EEIRrtGl9ZwQcu5fOESOqL3njpRgSuSM0o2OB0Ilu5Xjq4O4hgojjj007YSvj1Hvx+R6HQ9EiLOu9jpnii1ifVOYPgRI0u6+dkY2CjzJ2f4TYla3AqjcMzIvlmPhi+bxC+63Kr1ESqkZlxx8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH0PR13MB5283.namprd13.prod.outlook.com (2603:10b6:510:f4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Fri, 3 Dec 2021 12:25:04 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a01a:4940:c69a:e04c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a01a:4940:c69a:e04c%9]) with mapi id 15.20.4755.015; Fri, 3 Dec 2021 12:25:04 +0000 From: Simon Horman To: netdev@vger.kernel.org Cc: Cong Wang , Ido Schimmel , Jamal Hadi Salim , Jiri Pirko , Oz Shlomo , Roi Dayan , Vlad Buslov , Baowen Zheng , Louis Peens , oss-drivers@corigine.com, Simon Horman Subject: [PATCH v5 net-next 02/12] flow_offload: reject to offload tc actions in offload drivers Date: Fri, 3 Dec 2021 13:24:34 +0100 Message-Id: <20211203122444.11756-3-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211203122444.11756-1-simon.horman@corigine.com> References: <20211203122444.11756-1-simon.horman@corigine.com> X-ClientProxiedBy: AM3PR03CA0059.eurprd03.prod.outlook.com (2603:10a6:207:5::17) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 Received: from madeliefje.horms.nl (2001:982:7ed1:403:201:8eff:fe22:8fea) by AM3PR03CA0059.eurprd03.prod.outlook.com (2603:10a6:207:5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Fri, 3 Dec 2021 12:25:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 657effab-3a54-4886-4292-08d9b657ef7e X-MS-TrafficTypeDiagnostic: PH0PR13MB5283:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7dxzrIE8MOTt7TO+bIBvN7rYmo4Gs/R6wBfbE0mODNlus/g4AG76Rr2/mR9pinK4Fyi5ZL7quY2WFYt/oNp3efbZfaCdL15KpryMNpfwB1pgGDp80yfXzRsgrlln66OiqoXN9vCKOTXdKafYby4Cq2r+iH40lBVlCcXT32lsrjsj2zIRielwpwfN1Y+LYRFiIkjXqH/oUSfwJ9+dgtn4LeORlZhe3WW4xqwyzdNXteaXag41BrLIRJRMeKZTpQvYObcP+LpGgsejwVl4LA43pVmWc/S0UwMzb+97+d3LMMzJiwQYzrdljB6v/19q6F99rDFHFxEIXHtXfLgURW6VCx+zU77dqGxfIRTb+VYa2OJUjXa3oareZxmWB2DPFMwFDWO9o0FvZFE0r3U7SeUvtmhUdr+K1S+3zRG6ilrlNMJ27k+H1EP4fAHbFrt/89ivjKzTf5rhNJfh5UulSBwC/QcUW0motWAeMX9ssjYvFE1QeR4tVVXLzREW3JLPU0gtVK4LkgATq1YmxFGp60kEFm6qkXQrCFEfzspqXXEM12NnAVgpbHzQo1QNPzlgMDK6n3IzQR95HsmtlHRtl6VeQfqeoPEywLzgXRCQlZ43BqkWLVLrcqmlsUkwOZvCwcl2DLydGXzPfaDwSSfUmyA0mQ== 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:(366004)(39830400003)(346002)(376002)(136003)(396003)(86362001)(52116002)(36756003)(44832011)(508600001)(186003)(83380400001)(6666004)(6486002)(66946007)(6916009)(5660300002)(316002)(2616005)(66476007)(8676002)(6506007)(8936002)(107886003)(2906002)(6512007)(54906003)(38100700002)(1076003)(4326008)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RRqFQ9swKtOpDz1EzjqqGHYlHJYrgZNoSjpLjigJyrF9+idlquaMcg/2WlH+SrCZ7u4nk0Msih8r+5TlGFt3kPlNnVbLMRVw6lkvUQWEr+EeLBpMX6Zw6rVI2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HE4/IVq3gORvSDpso8bAQ0zXXUPzVJKPq3+xkhT4BJ/xwj3IVEdl0wBIpVgmJkLjHUXcr71Fe2WWdN8ZXaUEoQRiE4o+S8nhVYP6XuKzMPfgm+dHOoPsR2TRgthFIZCFiJXDSX93zYo+nc2QdgGwupawnsdxEU4UMedohx6/9Q5LXcg4UU+KI3Fwj7T2GHdudEBWcDyWJD/aDHXlVP6kc0vqEyIP7qOMuZ5/I+7sDhGI44qVDt5YqFUBXr1t6n3De642ERuMGcrYWZDxQ6TBVykKRdx+eiibKHgOXiOGPxoMKDUGhBlZe21LIxJUZFIAbbh4g0FseMDyUe6eTHcxNOV8liytxbwF5YASEIgzvRTEVUU6fz32OS7wIiMEUiDa4t1a32znTQ9tY4pNN4kIdSnO2b5LRrDYyUB+v9pNqkt2PbAgln+Q3QG/AOxJBD0PuWlE8Clf7eywcATZAx5AhfazvrcvNMhY+z6Zd+MQb764nGoZoayFGpzsZ3Ugf+30sgX4ws+Evmfq0QJ5bQ8ABmDHsO3uLQ90ZQzWaYw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 657effab-3a54-4886-4292-08d9b657ef7e X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 12:25:04.7249 (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: xuOl6amvHDUpWb3ncyXlTMva7zk7M/zblkLmcDNKxG5UkAlqfyVoXPcdPyvRzKhHeZ/bXNES9yQLBlAVYAizEyBhEKEbwq8EhMqPJMZo6sQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5283 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Baowen Zheng A follow-up patch will allow users to offload tc actions independent of classifier in the software datapath. In preparation for this, teach all drivers that support offload of the flow tables to reject such configuration as currently none of them support it. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 3 +++ drivers/net/ethernet/netronome/nfp/flower/offload.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c index 1471b6130a2b..d8afcf8d6b30 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c @@ -1962,7 +1962,7 @@ static int bnxt_tc_setup_indr_cb(struct net_device *netdev, struct Qdisc *sch, v void *data, void (*cleanup)(struct flow_block_cb *block_cb)) { - if (!bnxt_is_netdev_indr_offload(netdev)) + if (!netdev || !bnxt_is_netdev_indr_offload(netdev)) return -EOPNOTSUPP; switch (type) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c index fcb0892c08a9..0991345c4ae5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c @@ -517,6 +517,9 @@ int mlx5e_rep_indr_setup_cb(struct net_device *netdev, struct Qdisc *sch, void * void *data, void (*cleanup)(struct flow_block_cb *block_cb)) { + if (!netdev) + return -EOPNOTSUPP; + switch (type) { case TC_SETUP_BLOCK: return mlx5e_rep_indr_setup_block(netdev, sch, cb_priv, type_data, diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 224089d04d98..f97eff5afd12 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -1867,6 +1867,9 @@ nfp_flower_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch, void * void *data, void (*cleanup)(struct flow_block_cb *block_cb)) { + if (!netdev) + return -EOPNOTSUPP; + if (!nfp_fl_is_netdev_to_offload(netdev)) return -EOPNOTSUPP;