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 0567BA0A0F; Wed, 30 Jun 2021 09:05:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E95B41247; Wed, 30 Jun 2021 09:05:22 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2076.outbound.protection.outlook.com [40.107.96.76]) by mails.dpdk.org (Postfix) with ESMTP id 4A76541243 for ; Wed, 30 Jun 2021 09:05:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C41iPKR9ju+TlmH8cTLCJPO4hh8vKNeTmwP78TSBUFsm3nUu8pGXUIbPwt5HoUAaoe5HToFfneGIBVw+rQA62vEvp5a1G9yJqEbviIOEgqGMoAiP86xBZbGAqGTOumTxCl4rMOGqpAoygv41O81Tc7trcNHg3hRMJIVmWH1MfvIqrvKOdF2lnMmyQBNmXwLT6ImHLaTEAx9uGKAxI0sPQkUxcbCi10gXjSyiWwG0f81sLmG7thE/C9qKD/l6mJbz/voBKbNu1PXMaOrxXdcvNCb2eEFpXPwMYXmTi+xaCsxBszWjXwWqEeuY/9lcNQgMQF1rD6qIltz8bRWKeWgBAQ== 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-SenderADCheck; bh=yERNgjPBMoLH9C3G+UtDwXxICYiuQRHIsq/Z0P1prps=; b=bbAsGvE7/pKXkVXyrRhWgNAtD1KW4Bk997k9FsUR4MlXhppCDwkGdN/fM+R+/SczazGA7uluCidxIfdCxaZRS4uyRCUtrTahCFEFNqI9EZPWb87skawHbZVG7zF5HoNvLFvkAKGdXSUwQu1P30SKFiuW/cUNVvD0QsKvActBzaGw+UZm3jiEGAs/tpfN03lB4l9ivOMlCV2j9dxTiv0xh64uX03joFH76mR6wL7s6u4G/sjeJv6eT1R/+nmrDuBbyEMccr5lVJN75LqMHvoRgU4u+RMxpGB7EFTnSUcmVjKkSMpXjZrPtkyAbkrF37nUWQ5aKluLAFlfAbtJOJQsiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none 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=yERNgjPBMoLH9C3G+UtDwXxICYiuQRHIsq/Z0P1prps=; b=ehzZO+S7vs3KPsTpkoE/lzL2OVwIxfz5Wu0rfvfTKYkNB7NBFP0ohJUdrSU+Yec1ujs3Fif9tD8063G06ho8PesJJ+Ixq/2xNszCj1NT0RlE/eJ8yDfbs3FVIFgdV4PaY8EQh+78dLNI16FjrEIDd5wid5XF9dUOWHSmZLO/79VdmWL4IxzkhqjfeSQAsYHLQSET9gpr4KSlAhW9WcFdFK5tH/O+pvVng+p7F9Ejzifdp0wdnGxBMrhR3x32jl7vNrW5xtYCXQ9DVZuZfk982ANNcggsfuw9LOCiLlu1CnSjj+TdrEfYBShKpGO8NlS+wQ+qmsquuLN+4g3V8Uf6Rg== Received: from DM6PR02CA0098.namprd02.prod.outlook.com (2603:10b6:5:1f4::39) by BYAPR12MB2693.namprd12.prod.outlook.com (2603:10b6:a03:6a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Wed, 30 Jun 2021 07:05:19 +0000 Received: from DM6NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::c6) by DM6PR02CA0098.outlook.office365.com (2603:10b6:5:1f4::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Wed, 30 Jun 2021 07:05:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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 DM6NAM11FT040.mail.protection.outlook.com (10.13.173.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Wed, 30 Jun 2021 07:05:19 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Jun 2021 07:05:16 +0000 From: Gregory Etelson To: CC: , , , Ori Kam , Xiaoyun Li Date: Wed, 30 Jun 2021 10:04:52 +0300 Message-ID: <20210630070452.14055-4-getelson@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210630070452.14055-1-getelson@nvidia.com> References: <20210630070452.14055-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e3e7fc5-b790-4960-ace2-08d93b956bc6 X-MS-TrafficTypeDiagnostic: BYAPR12MB2693: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ag1HGr1lQWQ1GKevN9q7F7tvR0IAyt80aYixmktFbsDk+DCSbtSiWyKfQdgwFPVOhy7zHi4DuMZrHqwle2HHDf+meuNNOiypSoIDxVtBREvc3bBwVMm5xZV0Ap6qN9Cgz2zv3gqLJ8MaHGF3iLkRdUEkhQ726Rh5335wHqG1TVqjIOs9L6PD/SH/TPBcH7Clq27gBQmbltAYP3mhs3mE/F9UVi6YqSHpyLk+KVu+oIETYUr3UKAbX68jdSmJ2WUgUNbOAwoERq/GvWXyNKTABgG1P9zRrb/30usFbZQ72fWPBs0FlWCegQ7sbuP8E9/7Jm7HCYZigSvSwXSyBvwc+5PdFGiZJawUNQUIWxU0p4AiOBINfspZSkD9Lu1vjWLhzVUZii8jjekr+JdTEEgSD0BVmwSf7DEmjqLLBEPtwDvtRvKhW+eW5iSD2Ct0U64BNi0ZN+dssy29aaFv/42QTqOuF+dzhOihuOYZtMAVKTfgFrqwPU/Jzm/ox30uqPhuenAqaEPrLO7Zah/WPofuj64CPL/ivU8Cy4pOBvKGQqBgE6WhS3ZWQlrB/Q8Ay8nAcBNPAL0Pkd5ZARg6FR8uvuDRCRDOsp28+duNwv5RQtvF35IA6IhU/g+etzigqybkv/jzAT+EwQ9BnzzQqhClG5TAEJ00aY60byjr9vEA4jsRXBZFriePAFcZRXm/xJ7Q50Bw//VvM0dsAklRCs/hOQ== 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)(136003)(396003)(376002)(39860400002)(346002)(36840700001)(46966006)(16526019)(186003)(7696005)(336012)(54906003)(70206006)(82310400003)(316002)(4326008)(36860700001)(86362001)(47076005)(5660300002)(36906005)(1076003)(6286002)(36756003)(70586007)(55016002)(2616005)(356005)(8936002)(83380400001)(478600001)(6916009)(8676002)(426003)(26005)(2906002)(6666004)(82740400003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2021 07:05:19.2754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e3e7fc5-b790-4960-ace2-08d93b956bc6 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: DM6NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2693 Subject: [dpdk-dev] [PATCH 3/3] app/testpmd: add flow item to match on IPv4 version_ihl field 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 new flow item allows PMD to offload IPv4 IHL field for matching, if hardware supports that operation. Signed-off-by: Gregory Etelson --- app/test-pmd/cmdline_flow.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 1c587bb7b8..c1c7b9a9f9 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -173,6 +173,7 @@ enum index { ITEM_VLAN_INNER_TYPE, ITEM_VLAN_HAS_MORE_VLAN, ITEM_IPV4, + ITEM_IPV4_VER_IHL, ITEM_IPV4_TOS, ITEM_IPV4_ID, ITEM_IPV4_FRAGMENT_OFFSET, @@ -1071,6 +1072,7 @@ static const enum index item_vlan[] = { }; static const enum index item_ipv4[] = { + ITEM_IPV4_VER_IHL, ITEM_IPV4_TOS, ITEM_IPV4_ID, ITEM_IPV4_FRAGMENT_OFFSET, @@ -2567,6 +2569,13 @@ static const struct token token_list[] = { .next = NEXT(item_ipv4), .call = parse_vc, }, + [ITEM_IPV4_VER_IHL] = { + .name = "version_ihl", + .help = "match header length", + .next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_ipv4, + hdr.version_ihl)), + }, [ITEM_IPV4_TOS] = { .name = "tos", .help = "type of service", @@ -8123,7 +8132,8 @@ update_fields(uint8_t *buf, struct rte_flow_item *item, uint16_t next_proto) break; case RTE_FLOW_ITEM_TYPE_IPV4: ipv4 = (struct rte_ipv4_hdr *)buf; - ipv4->version_ihl = 0x45; + if (!ipv4->version_ihl) + ipv4->version_ihl = RTE_IPV4_VHL_DEF; if (next_proto && ipv4->next_proto_id == 0) ipv4->next_proto_id = (uint8_t)next_proto; break; -- 2.31.1