From patchwork Fri Sep 10 14:16:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 98658 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B5D2A0547; Fri, 10 Sep 2021 16:16:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D96D6410FE; Fri, 10 Sep 2021 16:16:33 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2056.outbound.protection.outlook.com [40.107.93.56]) by mails.dpdk.org (Postfix) with ESMTP id 2273F40DFD for ; Fri, 10 Sep 2021 16:16:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fxz9z3MFAT8ZFgjzZ52mhCpVgp3GZ0OkFnwKmx5iZ+PT5Cdia0qM2Mg/R9OI5AlK3uK4a7scQoK8pe6PjwMlj8vyW+DCYP+/DFLpZjQhB+rJch7nUCdts/Oo6NsMRQ7rprqACqt5ssObeJRtIk0QhhxW2SIP7CZT5lrShb10IJUWk1kj3k9vUBu7DdoPhBu343tVOpTwVUbnHLsi/9BHeYw/PwDChDBWhDBCx5O2EtPyKDrM/K1dWZBUpw+KApPHsam9ugn8PjeUeLwbkVW9XsSvk6zJAZykhvMxKxwi5FMb9NgsUKEYzaQxCqPPE352/QsfT2WZQqLqnN1/LKBDdw== 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; bh=F7Ys34kzTCglEiP8D7HCRld+xLj4RXrcW1kpXPM7YmU=; b=hWgd69Qq6KhD3XDH+XJcQGMI1abzrd/pTPdij2UpDvGXW9gWNXuJgDT/1H9AkcxyEDhaRogFhG3rNG/XAIh9LXHC1Hv4TmmVPbeYXkSz5/R5HVXkN7qOlBLa/Co6s/c6fPeyuIiD0sEB8DQz2a2k7CErQ5sdwG7wIhmnK9riU33QD6PRE4ZD2rgT6Ug/wlkJ0DIPYKQQUsr+HUkzfVSDDm/X21B2PIzczLc9PHwtzNu5f8HwA6ert6TffnguTG9aienq8DeQwpVVOzvLuwIVmmGhFRDoMqB77Cxz87Xkqp25yII18ttD78rKsTNm1IxyyylxysUx9BoN4rbKazxt5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=dpdk.org 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=F7Ys34kzTCglEiP8D7HCRld+xLj4RXrcW1kpXPM7YmU=; b=kcbzQhShaNSDr5cOVIiP0RE1EpojIykzr3nLMfuUa21huqKLZEeecBayq9m5KnhpiaFkjMe0AnjyLLFgonvjKYRCskjI9/E0FD8DrmF/ST8VtFcWThzI7WmF/SaRgie2xtWTQCI9AMRk+iy8LVgmJDQnN74Ask504wB3j6ZYpvuwoLhdBMpPtciuWZlt/ru9lVEps4MQrG/NXjxJEr+AQiokBLqPGoVYFh6ep4GHhgZBAw1PFpMoPRV9FrzDmMUd8PQ10Z9ok8AtdieqEd2XLNLnp4VkzutjEfBnMmNrPhsCMuqN/FmNw/7hvP1hF12VT3LTwilDi+OFkZr2qcBVaw== Received: from BN6PR11CA0058.namprd11.prod.outlook.com (2603:10b6:404:f7::20) by BN6PR1201MB2545.namprd12.prod.outlook.com (2603:10b6:404:b1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Fri, 10 Sep 2021 14:16:31 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f7:cafe::1a) by BN6PR11CA0058.outlook.office365.com (2603:10b6:404:f7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Fri, 10 Sep 2021 14:16:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4500.14 via Frontend Transport; Fri, 10 Sep 2021 14:16:31 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Sep 2021 07:16:30 -0700 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Sep 2021 14:16:29 +0000 From: Viacheslav Ovsiienko To: CC: Date: Fri, 10 Sep 2021 17:16:07 +0300 Message-ID: <20210910141609.8410-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d437fea-c175-49f6-e0eb-08d974659651 X-MS-TrafficTypeDiagnostic: BN6PR1201MB2545: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GRkSHHgLENvGfZqSHZjAlO8XhCH5A3zR5F49rfkRZanPHxTvlPd1Yk1o4k6bJ5mFwh8ZwOBjoyhlXKEEDyfpPoYAkNAweWDGBYnD0giBM9wgVMC3c6Q9WsVEn03B+XLIPvR+8H+WBJRRHNoSvIMdvlZ7fjfeEUbYPRa+CIv9fb7HslyNtsGLjvNmTUtf0jK/nO6/QIoao1O6lfV3kXQ8ozEtrYwL3lajOii/CVszx8Rn439CUwRmSnlRucJHir4SZTQIwz/THi3elJYG+8Dj+NlhJ8ZyUfMh6IUrpgriBzuSTtyb7tflojBY2Uzj8iUKaahbp2BrmVxym7bxnw5hiiq8C+Ll1KytDwiI4X0elwwKhQ8I4FqF9moMe9vL5r9RGCIJixeLaeJpvzjlC/XLuOxRIm7L2IS1yPd3PesjbWXgf+sXI1DSqAdzHfRJiiKnXoDwnY2UvF2UKOnyiknnsxdz9aDiobWKCxvL71H6rf6jGW6NYd7UPK71Qi4S2zGyaNV5aiNtvZqUeODxYNjCrtrvRPKuztkVy95GsFW9e1MNLyFl0o0FBoZ0JJaB/HUo2ftviMGl+/P63Fa3m3l7oC4XtHXgu59qy5S4ecAv1ppsdaVUKE/4wiCG5/c58Ha7JrgUNfAJfwP87A5xHxS93N453XxdK/rzKVcgUfwiHTRQEtSaI0uYvxBGIhdShYEue154BaFsi30ePdWmywjuOPZosOvvKcSNQuApslcmaqs= X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(82310400003)(1076003)(6916009)(4326008)(7696005)(2906002)(2616005)(6666004)(5660300002)(8676002)(70586007)(70206006)(508600001)(86362001)(26005)(316002)(7636003)(47076005)(36860700001)(8936002)(36756003)(426003)(186003)(6286002)(83380400001)(16526019)(55016002)(336012)(15650500001)(107886003)(356005)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 14:16:31.0364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d437fea-c175-49f6-e0eb-08d974659651 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.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2545 Subject: [dpdk-dev] [RFC 1/3] 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 lesser 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 MAC and 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 | 8 ++++++++ doc/guides/rel_notes/release_21_11.rst | 7 +++++++ lib/ethdev/rte_flow.h | 15 ++++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 2b42d5ec8c..a54760a7b4 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2835,6 +2835,14 @@ 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. The bitfield exatracted from the +memory being applied as second operation parameter is defined by width and +the destination field offset. If the field size is large than 16 bytes the +pattern can be provided as pointer only. .. _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 d707a554ef..fdeba27e14 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -84,6 +84,10 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* 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 uddated. + ABI Changes ----------- @@ -101,6 +105,9 @@ ABI Changes ======================================================= +* 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 70f455d47d..50e6f34579 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,16 @@ 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. */ - 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; }; };