From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 465B343AE5; Sat, 10 Feb 2024 11:42:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1478D4067D; Sat, 10 Feb 2024 11:42:42 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2132.outbound.protection.outlook.com [40.107.223.132]) by mails.dpdk.org (Postfix) with ESMTP id 669A4402CF for ; Sat, 10 Feb 2024 11:42:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=matUP0pCZtCrMb0R49XklZ2+BDMnDclPKE5H4kJgLeZZ7PXTdFj3g0rP3yRafIOSFE9sNyQHou/Vsq/htDkze/49/qrKx2rSk/duj5wVKR3roc8Gowqi+oUHzkdEmSDkxTbqmdNlZ6fpIpy5nLZjzIP1VUe4EbHYBffw0uXYdEi0VqheOYksYUQyCt5eaMBCA9APRO7rKUOzF6c0J9Gp1gueW37XovgciQRhVD/ofPLGjx0Aorhsq7Ll3wFUqThtB/5R3fCJ/OWexOZmPreB7/lA8GHiWgrkNWiKShTi5YvMLc4ezg0/VFXvwnnlZHwgOpV2sM75SKPQLuXe85Ze/g== 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=CQeGHIcrbP2ieQIO6bdSRZGeh6ARucnAv+H4ZaI04Bs=; b=Ctdp1OT8hh5Jo/jzLKaDeGs+1mNL/J++HdY7YRuWuuk/3X8+0XhczYzoNChrRONr9iK/BzhI23Y8Jql7k4H/8HpPH0loRZRjhK08ivdvs9A2iMxyAWsqpK1UfoycnOTsiozxgEeNBQhwSOuvXVAc5182V/VJxGUpi1KznZFP8KojTOZ0eQdV5ujFf80+RxCDrRp4u6l9jow9xsVRrspLydfB+gOaKQEqfjNUB5WvkrdF/M1k4cqp061nP7n/vQSYvT32TSnqhbp+yxaUsyEeJI3NAJXh/sNFJBFq9DWj3TzLZBIkheWGrmceVsXwb/DETn8h5+ZeXSeUqRc50y/SYQ== 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=CQeGHIcrbP2ieQIO6bdSRZGeh6ARucnAv+H4ZaI04Bs=; b=BuhN7GNbZIjS0BsSxZ4Ct9lqhpUI4xGinDXyAj76tXJjXmLh8rglygKbqX6O4daCMnGS+KdEg5ZG27Iq+8LJAogo6bVs+o8Y9RKTprOQ1O5SiLE42Qa6wGtlVKpUwHtqaWsWCryJUVCN8Nk1A/V+kgcr21kUIyGxaXKFjLA8B14= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH0PR13MB5421.namprd13.prod.outlook.com (2603:10b6:510:142::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.24; Sat, 10 Feb 2024 10:42:37 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::8e02:f738:570a:f8aa%7]) with mapi id 15.20.7270.031; Sat, 10 Feb 2024 10:42:37 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , Peng Zhang Subject: [PATCH 1/4] net/nfp: support MARK flow action Date: Sat, 10 Feb 2024 18:42:10 +0800 Message-Id: <20240210104214.1248772-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240210104214.1248772-1-chaoyong.he@corigine.com> References: <20240210104214.1248772-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:4:188::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB5421:EE_ X-MS-Office365-Filtering-Correlation-Id: 63aaecc9-3c47-4ead-026b-08dc2a24ff87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PLtMcS7VX4xQ2EGzymIwJ14krDZp5PQGeFtOYtclyig294sqd6ZE1gWo9libAknud/LnmHgzUaft8ND8mOrrCpmDsVYc+yI63TAomfudMS3uqYAT8zL8k9B5OaxxAl4XWQtLzgPjktnw+VoOdO3o4+mv6aJzbzwr9CrU54iLT3f68LekKagrGQcfVZ5KIB/uyoqjVyfA/Oo4df0hXPV/BE6m/fei4EX2FQLljAbk5dNxKmy1Xs7NqA55TK1LPk/j6ECGIdyJ/AMmFKawiU/PvF+Ekt9l8u9Ty99zOzDXo9FqjAuIAZxjgoa2KCua+MxQS/msX4snowqInb5RXuV5r5XePrYqnbhCURjbEofI3cRtXVvqT7Z0UX/y1E17uGORHDBZBfM3FVRxVVe8fhhx0UqmdrJ4C7/iM6EoAVJsb1FdEel4XroeE6dr7JXK8FwxY61walV/QyesrJ1OWBHFu5VNm2LeOsuOwHrf61Qd+ekQInU0jpZsfCcCTEf+39JoejbFi1p75C/r1Zhh6V049kH2nq3tk5eA9hPNz9I9efkBN+TlAW2t9oa2z1/gGur57kV1e4W+5kgmeftnrh8iA75xPGJ4vjCtxOrGIOsCVjl1TSVT1kOElYRalMM2hdae X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(39830400003)(396003)(136003)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(38100700002)(66556008)(6666004)(52116002)(478600001)(316002)(86362001)(6512007)(6486002)(5660300002)(6506007)(4326008)(66946007)(44832011)(66476007)(2906002)(6916009)(2616005)(8676002)(1076003)(107886003)(83380400001)(26005)(41300700001)(54906003)(8936002)(36756003)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zAPA/B94SQJIERDdE09z3Vx7iVJiFWNGGZiHpPl4ct4DuMRoCqAxhonjELA7?= =?us-ascii?Q?XTZ4i+zK6ysRbQZ7tv0ySkeV/RIjWnUQJsOeTTPuVyra29DChRTH0sdK94X2?= =?us-ascii?Q?eH8/SE/ePoNch5s1lo40dBue11FrZ6uhtg/w9HnLFVCHS7REU325VFcavypU?= =?us-ascii?Q?1nDh5ZjLU9OHbMNt31pPj6cmqrP6xp4WET4tfXiM1ZKDcrj2kkzUJWrZtF8y?= =?us-ascii?Q?MI4PMl9NnfyDXQIOJuLa7up0B/dsf+vWXeJcrQ+nEaRbIJqUsIVOmHsbGBDZ?= =?us-ascii?Q?iMyvs1SQhwW2WMt0os0GbbuMZPd0yjs5v+DUwxGT5qM1JeIazDDG++7MHBdX?= =?us-ascii?Q?YkBQifI2LGFHPA6L5tbjnTmS6oJN7amneGM1HIGVUuiu1Ylh0HGSbVb75zjm?= =?us-ascii?Q?YLet/cV8p+YX4QfOJstfsCQ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P5u11+GurolyNLyN5jyWyqWnRCs6CXt8A5t7/xUXheQTS56voGsORxP?= =?us-ascii?Q?U7hecnlj+v6Q6BlHgliekr63X4KPqBZpbbrqPdRKnnCbWL2OCjyKFfaPDezq?= =?us-ascii?Q?EVWwOPswsagH5axNQN7uxlaFnzRIC+O2qlXcrLUqWvn1ygKNFeVvbaZpK9mS?= =?us-ascii?Q?Y0KdjoOARAx8/HYoyuBL4/4n4KUu+fw+IGNHNOGpldxP6wgnFPEUGyd3hAxM?= =?us-ascii?Q?66m1HlzdjzBXdivNGcJoLevvQh4beyMFym95ISm1YB3c60N1QC4RNi56bdeH?= =?us-ascii?Q?pA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63aaecc9-3c47-4ead-026b-08dc2a24ff87 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2024 10:42:37.6703 (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: NQ0Or9OdFPQeHJx/ymDe3hENrW3Q5pJdtgLhYKI0+bsRM4KMerOxcgcHgI31EXbMwpb839NKfgJNDvZ3XxgoOIFA6qDr+BkCAzCiZGeDvqw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5421 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu Add the corresponding logics to support the offload of MARK action. Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 16 ++++++++++++++ drivers/net/nfp/flower/nfp_flower_flow.c | 27 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 8fb55f44a2..c94ea706bb 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -959,6 +959,22 @@ struct nfp_fl_act_meter { rte_be32_t profile_id; }; +/* + * Mark + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | res | opcode | res | len_lw| reserved | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Mark | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_fl_act_mark { + struct nfp_fl_act_head head; + rte_be16_t reserved; + rte_be32_t mark; +}; + int nfp_flower_cmsg_mac_repr(struct nfp_app_fw_flower *app_fw_flower); int nfp_flower_cmsg_repr_reify(struct nfp_app_fw_flower *app_fw_flower, struct nfp_flower_representor *repr); diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index e26be30d18..8667f8e901 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -83,6 +83,7 @@ #define NFP_FL_ACTION_OPCODE_METER 24 #define NFP_FL_ACTION_OPCODE_CT_NAT_EXT 25 #define NFP_FL_ACTION_OPCODE_PUSH_GENEVE 26 +#define NFP_FL_ACTION_OPCODE_SET_MARK 27 #define NFP_FL_ACTION_OPCODE_NUM 32 #define NFP_FL_OUT_FLAGS_LAST RTE_BIT32(15) @@ -1138,6 +1139,10 @@ nfp_flow_key_layers_calculate_actions(const struct rte_flow_action actions[], case RTE_FLOW_ACTION_TYPE_CONNTRACK: PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_CONNTRACK detected"); break; + case RTE_FLOW_ACTION_TYPE_MARK: + key_ls->act_size += sizeof(struct nfp_fl_act_mark); + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_MARK detected"); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -3487,6 +3492,23 @@ nfp_flow_action_meter(struct nfp_flower_representor *representor, return 0; } +static void +nfp_flow_action_mark(char *act_data, + const struct rte_flow_action *action) +{ + struct nfp_fl_act_mark *fl_mark; + const struct rte_flow_action_mark *mark; + size_t act_size = sizeof(struct nfp_fl_act_mark); + + mark = action->conf; + + fl_mark = (struct nfp_fl_act_mark *)act_data; + fl_mark->head.jump_id = NFP_FL_ACTION_OPCODE_SET_MARK; + fl_mark->head.len_lw = act_size >> NFP_FL_LW_SIZ; + fl_mark->reserved = 0; + fl_mark->mark = rte_cpu_to_be_32(mark->id); +} + static uint32_t nfp_flow_count_output(const struct rte_flow_action actions[]) { @@ -3734,6 +3756,11 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor, case RTE_FLOW_ACTION_TYPE_CONNTRACK: PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_CONNTRACK"); break; + case RTE_FLOW_ACTION_TYPE_MARK: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_MARK"); + nfp_flow_action_mark(position, action); + position += sizeof(struct nfp_fl_act_mark); + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 2.39.1