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 F0EE0426BB; Thu, 5 Oct 2023 04:41:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE25C40A76; Thu, 5 Oct 2023 04:40:50 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id 7ED044069F for ; Thu, 5 Oct 2023 04:40:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ez98mPGl2nMEowvECXbDVG+x4+L7lS6nsTvuOGBNb4nLOOY48wLoqSlojF0hxmr/RiZYkrtZQcDBOOXTg3xZllleZxW3cUqkqPvVl3//tEL5KPtfWMSt6gLNKIapyRBHgoNC52h51EHH8twkUgfavevsAAjpaO8a2pOrS4VoXBp+2Kcz+n95EbsczC2EF3tC+DAiyLsCP/p6DBOl7kSyQIuGFjztVm6aZvwby8SMbnZnOYnqfzRVm26Od76wk9Kks9Y+IOmCBU8VEV5X4mnFKdt9h62k031NjreBz14LqMuHxRm0jVPC3woDUtk1MTUjI8P6qaG2AXwGn9eZFrwVoQ== 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=oUHWaxPPv4xuODUtUsdOF28+ohpNtXodYWyHao/i1gI=; b=dxXJ4a/Zo8X7+oaaBlNEjilQoe28RNeJ3uK/Yhl6glkKOc/u52qf1Spp5ENz7uIGcitOEVS1dnbflxjgvm1Mjp64w297LAOJ/PiEbKro8MbxSP6DEcHMBpXsoPhODPI17NdPpvwHiLFR42YFUtIsgYf5ehcZFpTWnPtxZFtc6tye9ntZr+j1j7pknh7VlI/WSXPq9Ro2KdY9p//wGPzzKm4saCsHNiN4jUBVSyArrE/XmJjojwFCg+mBq9ZsYRYCKrU3eC9pMi8puo6gZUvhO9aibGE7Edx9xIiDYpOErpyweeVLOut0kaNkxEiYLcrlf89TYvF52sAgUPC9iru77Q== 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=oUHWaxPPv4xuODUtUsdOF28+ohpNtXodYWyHao/i1gI=; b=jrPKo6qvhz1xcWKyPmNQcXzuoNVTK5RFz2qMcG1AIeLjwariwqK0KTMFmpmgQDj+gaENt0d8mxa27+5xO4e4QttDd1S/HvpRARMJ7R3kMqy5XQXLHQjQQSnZjX4sDd56/ZmqgoaMnzgB1rDVSOC0tYzl2MFMvc1oIkWXBlAVTu0= 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 PH0PR13MB4780.namprd13.prod.outlook.com (2603:10b6:510:79::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.28; Thu, 5 Oct 2023 02:40:46 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Thu, 5 Oct 2023 02:40:46 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH 6/8] net/bonding: create new rte flow header file Date: Thu, 5 Oct 2023 10:40:10 +0800 Message-Id: <20231005024012.1279810-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231005024012.1279810-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH0PR07CA0064.namprd07.prod.outlook.com (2603:10b6:510:f::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB4780:EE_ X-MS-Office365-Filtering-Correlation-Id: b4c9099e-d9d3-4e83-c4d9-08dbc54c7a5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s93u0kptLTUQLBa0zJ00ZaNFSYIvvsUpJHQhI3YTsAUMbmuBzKOn4YoKmVXpYOQV0cU9EmXdylO3DNmdZgMtT0BdT4DRV9zFulEf4opWmaQQOHd4Mj4Acp8qi0/gJgttmvGgr49pEpVSCfLmj3EG6LuMpZqPXN5oHSOTDrHnQEuVOHqrABd3zSQ6d2ZTzuquk0uD2HBCNo50K5gwDiH2/DQWCexJ1NLMP0w1NdEpPG3bY2yxHVMXfEq2hlsf07kOTj+seZRLiSFxHMTWEUsIxiQUhK/iOh8LyS6TK/wDfK2DUYUZiRlIBa1doXIBb0/5AQ3ku6OAZ6uN+2JoSC4WIiMtcxGPTKprLkMfW3qo+sJhve4Xh56VGCMHVvU12GxH9L1m8wxauLvL6GnmnfBcaPQawN106GeLfAcdR81HXDpnuWFY9b7/VH0GAQhizqPqlmXgbVFq221Za5BY09e905Aibb0XMOVtkVikFVVlxetU6X76yqsf2d8mpLKGiwI8i2SrUvD6w41r+TJc4n4wjmeF8A6P2NEG2xHaT3cTXoxr6pBkWS6Xxeq98eFZmVD18kulOgujwiA+OD3kvJ5z9q73N9hKmYmVOSEvVqBof5xYAJ7wL4x3ykLY2iNbBIryrP//IZoCrmTIjvOwM+Nw5yJBt65hxhTLVWfInZCEcnM= 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)(366004)(376002)(346002)(136003)(39830400003)(396003)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(8676002)(107886003)(2616005)(66476007)(4326008)(38100700002)(54906003)(316002)(478600001)(8936002)(66556008)(66946007)(38350700002)(2906002)(6916009)(86362001)(41300700001)(6486002)(6506007)(5660300002)(52116002)(83380400001)(6512007)(1076003)(6666004)(26005)(44832011)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xKCM7GwG1tE9sgRLGahtUlATKedCElo5ZLAlxV1U9Rti7O25wfGGNMbFeqR0?= =?us-ascii?Q?qYyGklz/aIi2HpnebeTwHN36WYACsdNxGlXNNrEjpsuFlY2vBmx2GM6s8JxH?= =?us-ascii?Q?4tGOH7ld01SofLwxU/OPnYexaBbdKNTpHlatNM6LFUh0R9LLHdFkoDnrnBU6?= =?us-ascii?Q?HGCy+CkSXzOTsaKJNcmyA96q2Z+NJqBwiTfI1Se4Ean/A5GBnLDsr4Q91/l7?= =?us-ascii?Q?tWVYTCYms6wlL+pM2FlJNwpN+kw35MwSYQGZpuR3aV5Oo1nODgVkJ5ayS4bC?= =?us-ascii?Q?mfp3Ia5mCJjOtVDM2wjzNfHgjfUgJ3ofvkkOjopC1gjXXHolliINwGz8UeRP?= =?us-ascii?Q?8SVWjtCE6+bencB1+W8FSMupx9nI0wu8VnTNTuUZDhAM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5ii/TbqIJWeyUXvM2lDZjcrR61Tvvjy/aLumNa4sAvFldG?= =?us-ascii?Q?yZRrlSPPFHMes3hRow7wk7ReU0oyApoYq/3onS/eGHsppTRzkUSyG56jGAf4?= =?us-ascii?Q?ELj8jBACUn0NlFX3RZJObXC86lx5cIMb0uFvlXsgsoi+6lsH5+EKz99MYAH+?= =?us-ascii?Q?+mYRk77TNPl0WucD9YMpFnA4U8WRcckI/ah+741AFrS8803rvEjdBwpAADKQ?= =?us-ascii?Q?ro/m7UecKxCGbJVfYRsvt/hxwNv+5gI38zCW/nP0fsas80mYXbrLQi/FyY1J?= =?us-ascii?Q?MIlKf6HQD61veUIc3AeY2UrJ8H5axp0MLKUIFfjN6N1dHo2qBCGTLo6w9PM/?= =?us-ascii?Q?Lg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4c9099e-d9d3-4e83-c4d9-08dbc54c7a5e X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 02:40:46.7139 (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: JBE1acNgMIn4Kkoyu6FHqy8ktPGgIVXbb4rrw1XAx/OrnOaELv6piLcclL8sU47g57n5pMH5S5+qLYh23xwBY+C7XOZ/aZRtkIwl9ciQRoc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4780 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 Move the flow code to a new head file to make flow related code more clean and make the code architecture more reasonable in the future. There is no functional change, just moving verbatim code around. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He --- drivers/net/bonding/eth_bond_private.h | 13 ------------- drivers/net/bonding/rte_eth_bond_api.c | 1 + drivers/net/bonding/rte_eth_bond_flow.c | 1 + drivers/net/bonding/rte_eth_bond_flow.h | 22 ++++++++++++++++++++++ drivers/net/bonding/rte_eth_bond_pmd.c | 1 + 5 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 drivers/net/bonding/rte_eth_bond_flow.h diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index b217d98c31..aaab521eb9 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -9,10 +9,8 @@ #include #include -#include #include #include -#include #include "rte_eth_bond.h" #include "eth_bond_8023ad_private.h" @@ -47,8 +45,6 @@ extern const char *pmd_bond_init_valid_arguments[]; extern struct rte_vdev_driver pmd_bond_drv; -extern const struct rte_flow_ops bond_flow_ops; - /** Port Queue Mapping Structure */ struct bond_rx_queue { uint16_t queue_id; @@ -94,15 +90,6 @@ struct bond_member_details { uint16_t reta_size; }; -struct rte_flow { - TAILQ_ENTRY(rte_flow) next; - /* Members flows */ - struct rte_flow *flows[RTE_MAX_ETHPORTS]; - /* Flow description for synchronization */ - struct rte_flow_conv_rule rule; - uint8_t rule_data[]; -}; - typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts, uint16_t member_count, uint16_t *members); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index a042f05a4c..0113dfdc16 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -12,6 +12,7 @@ #include #include "rte_eth_bond.h" +#include "rte_eth_bond_flow.h" #include "eth_bond_private.h" #include "eth_bond_8023ad_private.h" diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c index 71a91675f7..e6c7ce5362 100644 --- a/drivers/net/bonding/rte_eth_bond_flow.c +++ b/drivers/net/bonding/rte_eth_bond_flow.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright 2018 Mellanox Technologies, Ltd */ +#include "rte_eth_bond_flow.h" #include #include diff --git a/drivers/net/bonding/rte_eth_bond_flow.h b/drivers/net/bonding/rte_eth_bond_flow.h new file mode 100644 index 0000000000..7394e0e2e1 --- /dev/null +++ b/drivers/net/bonding/rte_eth_bond_flow.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Corigine, Inc. + */ + +#ifndef _RTE_ETH_BOND_FLOW_H_ +#define _RTE_ETH_BOND_FLOW_H_ + +#include +#include + +extern const struct rte_flow_ops bond_flow_ops; + +struct rte_flow { + TAILQ_ENTRY(rte_flow) next; + struct rte_flow *flows[RTE_MAX_ETHPORTS]; + /**< Member ports flows */ + struct rte_flow_conv_rule rule; + /**< Flow description for synchronization */ + uint8_t rule_data[]; +}; + +#endif /* _RTE_ETH_BOND_FLOW_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 1ebeb270c8..630afc3740 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -21,6 +21,7 @@ #include #include "rte_eth_bond.h" +#include "rte_eth_bond_flow.h" #include "eth_bond_private.h" #include "eth_bond_8023ad_private.h" -- 2.39.1