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 5AB60A0C43; Mon, 11 Oct 2021 01:46:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B175B410DB; Mon, 11 Oct 2021 01:46:19 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by mails.dpdk.org (Postfix) with ESMTP id BEB2B410E1 for ; Mon, 11 Oct 2021 01:46:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7aN0miUbUxSq4NQ5oxE4vbD0ymmrmn9aDAXqeVUhd4Xt0lAXb0qfIWfs/WqmZQInNoscLIt8V0x/R+Y0reKO9nnNOD2swNQ2Nj/096uaC8E4IpUE9aedm1n9+yVBxqk5jid/NUt70AqeIxOtF9r+w0gLBaD8Q+/VLbfDVLQfsKjdpi2NE00hL251ieWyeAT36hW5CaD4Rb52GTlCIAXx2s10tYJpOIDbVKheDaUFx4lQxOnB0rl5byl3677/L6dkghrkf0dTt/44xASHjiopeXR8qnO0GTvRV2xax9Me3GitC1xEg4toXk+TFPV2czDIInu0GyoX9IMspm+sTg/nw== 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=mVgcKM46PBf1QhjDtP2+ff05th2L95XFuUybWbSvKnc=; b=dqGErZ+eVblqVOQ4H66mIXWIVH/AYEQ5AlpIkvA4lFa5wRvoxQNQuQp1SRRPl9cfZMYLlpIQd4E8ZFkSQweyDlZyR/ZfinDSnekycceLdTzyHRJKkX1VhXkvTh2xL4gQzLtjWDHkkBOITOzpzAM0842icbbvemuhcUb8IovItFhCpXvgq2ToClQgHIMSdFrZQgWlVXvPtSM9lvPSsa6EQ4oFp4MfLArkMq6MbDR0mamFbkRghHyrvteMcEjhVoZKmFeJDqn6Zf38VrZaJDjExnONM6FCKH939xcxqaND8Ot+WnrS1l/ZO0jvxEQnFJcUO4+mPM5HtCfL0iMm3oJ5Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=mVgcKM46PBf1QhjDtP2+ff05th2L95XFuUybWbSvKnc=; b=e5Uv5AshNP0e+wXwKjMMLzi3xLxDGLEpm0Kgl2lWhQEMZCsOiQJr4otpyZ/c+1zHhLbuthdvhapZr8PqHuUXzy8yiAII64OemI05B7/R+QAFVZQCWzLrCY8jV4K6pKQ+mHq9pino+CmyhrsGs5VhFlWr0Wo+bLiit8gJKszopsrRSH2GzhvQb4JShlmkkNXj/vJ1UtfPw2MynzbAU5meWOxV0l4LHgqEwbc/4QrwkOSFoAM+2LRgP3LOtbHhLBf+uXYls42PQJCttHnzw7U4cElj7IaRTwoLKfBEchkihNb7osgpuvnwcL8gzallOGiQbJuQ50mZnc5iT4f1FWAdLQ== Received: from DM6PR11CA0031.namprd11.prod.outlook.com (2603:10b6:5:190::44) by MW3PR12MB4508.namprd12.prod.outlook.com (2603:10b6:303:5b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Sun, 10 Oct 2021 23:46:17 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::d4) by DM6PR11CA0031.outlook.office365.com (2603:10b6:5:190::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Sun, 10 Oct 2021 23:46:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Sun, 10 Oct 2021 23:46:16 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 10 Oct 2021 23:46:14 +0000 From: Viacheslav Ovsiienko To: CC: , , , , , Date: Mon, 11 Oct 2021 02:45:43 +0300 Message-ID: <20211010234547.1495-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20211010234547.1495-1-viacheslavo@nvidia.com> References: <20210910141609.8410-1-viacheslavo@nvidia.com> <20211010234547.1495-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b039c875-d02c-4543-5ca2-08d98c4826b4 X-MS-TrafficTypeDiagnostic: MW3PR12MB4508: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P+FLnUR8uvMa/69DO3JxQMjmhQzY88SlhX18sqqRQ+rTJ51iuS5N/YBLT+0zYR135oG4HOTdhYzCGvlmK4fxfuSTvQZVnssBZj5VRpwsuQ8c5QgfHpW6gqn/JoMO2tSmL1ns8qaB7Vf3Tl8wjt+E220hpd3jhcYz5wfLPDuEB8W0LKw8jJ0/KUwAF7K9iSANl298vxXBJvLvwSMs69j6wajojNAI1s7PGSpKA63joRgNhUJnSAo/be2KiwTxbSPJezjdNBJIc8I+7TWZsxCyZubF737pDj65gU5BtxReMkQQHnY7krScCvhwbys6gt+98csATlOzTOfTTBYxjMBI3kBqaoBo3H091H91wT/VMQhW3Q2vMWjhdG/CAINF7nan93tZ7q9z5ftbPS3UFf7aLa40iLPJgmf4mg4kqFBdUNsPsRcNAz6hot8ZTR4osHKRx3mkIcXfADMn3IrIqWtBiOJHc79TcCUCmGcSH5AcZysDZr4qYdeHdTc/7dfqhN6XWo3zZOkphbxGx5YGkPLGPcxdzC1eej9VNw8wUZYZcv/kDuNiEvXX2Q91HC2rsImzA8+qxAhcSzc1N54xuUjNiNUpgJ/X/ra4dMmSy3BmAoyLh1MeHeVrhGL1zgFQPmmi+oOrVARjiyKMEU/pH9o27ln99mwmnJ3UU9SVG+wQFUwsYsczQY2xjRwXsYU9Ln9eMSMHY6rg1COTCXR0qkLyiX+tVm8dkJHlGkzysBJVbEc= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(15650500001)(1076003)(36756003)(86362001)(8936002)(186003)(7696005)(16526019)(26005)(8676002)(508600001)(70586007)(70206006)(4326008)(7636003)(6666004)(6286002)(2616005)(2906002)(316002)(6916009)(55016002)(36860700001)(356005)(82310400003)(47076005)(5660300002)(426003)(54906003)(336012)(83380400001)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2021 23:46:16.3414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b039c875-d02c-4543-5ca2-08d98c4826b4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4508 Subject: [dpdk-dev] [PATCH v2 1/5] ethdev: update modify field flow action 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 Sender: "dev" The generic modify field flow action introduced in [1] has some issues related to the immediate source operand: - immediate source can be presented either as an unsigned 64-bit integer or pointer to data pattern in memory. There was no explicit pointer field defined in the union. - the byte ordering for 64-bit integer was not specified. Many fields have shorter lengths and byte ordering is crucial. - how the bit offset is applied to the immediate source field was not defined and documented. - 64-bit integer size is not enough to provide IPv6 addresses. In order to cover the issues and exclude any ambiguities the following is done: - introduce the explicit pointer field in rte_flow_action_modify_data structure - replace the 64-bit unsigned integer with 16-byte array - update the modify field flow action documentation [1] commit 73b68f4c54a0 ("ethdev: introduce generic modify flow action") Signed-off-by: Viacheslav Ovsiienko --- doc/guides/prog_guide/rte_flow.rst | 16 ++++++++++++++++ doc/guides/rel_notes/release_21_11.rst | 9 +++++++++ lib/ethdev/rte_flow.h | 17 ++++++++++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 2b42d5ec8c..1ceecb399f 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2835,6 +2835,22 @@ a packet to any other part of it. ``value`` sets an immediate value to be used as a source or points to a location of the value in memory. It is used instead of ``level`` and ``offset`` for ``RTE_FLOW_FIELD_VALUE`` and ``RTE_FLOW_FIELD_POINTER`` respectively. +The data in memory should be presented exactly in the same byte order and +length as in the relevant flow item, i.e. data for field with type +RTE_FLOW_FIELD_MAC_DST should follow the conventions of dst field +in rte_flow_item_eth structure, with type RTE_FLOW_FIELD_IPV6_SRC - +rte_flow_item_ipv6 conventions, and so on. If the field size is large than +16 bytes the pattern can be provided as pointer only. + +The bitfield extracted from the memory being applied as second operation +parameter is defined by action width and by the destination field offset. +Application should provide the data in immediate value memory (either as +buffer or by pointer) exactly as item field without any applied explicit offset, +and destination packet field (with specified width and bit offset) will be +replaced by immediate source bits from the same bit offset. For example, +to replace the third byte of MAC address with value 0x85, application should +specify destination width as 8, destination width as 16, and provide immediate +value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, xxx}. .. _table_rte_flow_action_modify_field: diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index dfc2cbdeed..41a087d7c1 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -187,6 +187,13 @@ API Changes the crypto/security operation. This field will be used to communicate events such as soft expiry with IPsec in lookaside mode. +* ethdev: ``rte_flow_action_modify_data`` structure udpdated, immediate data + array is extended, data pointer field is explicitly added to union, the + action behavior is defined in more strict fashion and documentation updated. + The immediate value behavior has been changed, the entire immediate field + should be provided, and offset for immediate source bitfield is assigned + from destination one. + ABI Changes ----------- @@ -222,6 +229,8 @@ ABI Changes ``rte_security_ipsec_xform`` to allow applications to configure SA soft and hard expiry limits. Limits can be either in number of packets or bytes. +* ethdev: ``rte_flow_action_modify_data`` structure udpdated. + Known Issues ------------ diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 7b1ed7f110..953924d42b 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3204,6 +3204,9 @@ enum rte_flow_field_id { }; /** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * * Field description for MODIFY_FIELD action. */ struct rte_flow_action_modify_data { @@ -3217,10 +3220,18 @@ struct rte_flow_action_modify_data { uint32_t offset; }; /** - * Immediate value for RTE_FLOW_FIELD_VALUE or - * memory address for RTE_FLOW_FIELD_POINTER. + * Immediate value for RTE_FLOW_FIELD_VALUE, presented in the + * same byte order and length as in relevant rte_flow_item_xxx. + * The immediate source bitfield offset is inherited from + * the destination's one. */ - uint64_t value; + uint8_t value[16]; + /* + * Memory address for RTE_FLOW_FIELD_POINTER, memory layout + * should be the same as for relevant field in the + * rte_flow_item_xxx structure. + */ + void *pvalue; }; }; -- 2.18.1