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 392DCA0524; Tue, 13 Apr 2021 07:19:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBB03160B3C; Tue, 13 Apr 2021 07:18:52 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130048.outbound.protection.outlook.com [40.107.13.48]) by mails.dpdk.org (Postfix) with ESMTP id 60C84160B37 for ; Tue, 13 Apr 2021 07:18:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jTg98gWePPyESnPBtoO8wPwyn3NUR7Rm7LI52Pm0E26svnH+gScswcHiKBVHt8J4rd/wzRf3P0oQ06VCYqRiFyn2icBFCtWQ2z2Y5LDAzvIhz+KyGV2TLdM5LC1SNfEkAxPvX/pTtnJZyMRPjlkUu6Qgt2khpSOfDS0453nbFq9b5i8nCtZ3g/OqdLKGQkHzS2We3/kmIXzCZ0/rjBoNprFsBHZjVzqx4cS2wxxRv6cEFvRoHD67Z3T9qqSoyrTGh6LsHkAT6XvC8eTNY+EMnxR0jckHgOV2ZSrLqADZt3GyvDy8JE5HCW2LRq93nYgiy4la6NxXoIuj0UIj86V1QA== 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=8PsOm6qyX0mhQDqlWsJtLQw4CJf9wv0P85wIqkJyXwo=; b=QJ4gMW4IWVprUa0vlC7SR8PyYpl+Pj8Am828dFMUys00+1rwGE/txxi7/6DrP6gU4VNZ/Jb+dueG48qr4zCLArJEgGwOnpu04KimeBMeWOkuMcIuoNMukQXvchOH5SE9viKQV9j83zgrF/8rWg/IeL5H0bWckBEllQWImrnrxjSXy24ssSVLaw/XA6qWcxYoWpOBVbOjqhUSArNuHNb8dwDjtTajqCqFuSU/hVQe77ZMatwqNF3KLr5+Ai/g0uDrkKHon8uWlXvGR2WW6ILQMhnZZciSY+JZgECaCO1eEDuhNDr92Qcc8pRvFDZbfXPE0O90WzbrUdR501kTI0DNlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8PsOm6qyX0mhQDqlWsJtLQw4CJf9wv0P85wIqkJyXwo=; b=Rd3zddvzMzopnh0zzd1nc4rgzHantyPLvUgJceayHygcypmguT1kSFTXp+yjtT2+6QRYGROnrKKEew8j5w67uZgeALL7/kY5IbpuLDhA7bw8sw31rSyrqbofB4rJ+UsrHBCgBawJLAdagMAFa/dFt/9+Pu9eaczE9uAPdAddhig= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM5PR04MB3250.eurprd04.prod.outlook.com (2603:10a6:206:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 05:18:50 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%7]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 05:18:50 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, Nipun Gupta Date: Tue, 13 Apr 2021 10:47:14 +0530 Message-Id: <20210413051715.26430-8-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210413051715.26430-1-hemant.agrawal@nxp.com> References: <20210410170252.4587-1-hemant.agrawal@nxp.com> <20210413051715.26430-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by HK2PR03CA0059.apcprd03.prod.outlook.com (2603:1096:202:17::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.6 via Frontend Transport; Tue, 13 Apr 2021 05:18:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 85e6f1e5-a2af-4651-0c32-08d8fe3b9f4a X-MS-TrafficTypeDiagnostic: AM5PR04MB3250: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O2fG/yCFc8F6VJTlN7YYeOYYv7RCgCZ3WzMzS0ZG7kXd1ws8yK8lTGuqA5sIgv8BXQN4GZCGaZhaa26yfcGpbCNbLVNO0T5iJ0sII9CCsbGKrlsZnESQcM0w83Siro4kWAKb+LQ/yut7+yeHlLCEIw2/0gv9n/Ys5uKRkHU4d+5C+Q1nd1MkCNWdkDU+of7tOFiX3ecOEsUvvyfTTWfCtabOtSmKzuW7WPM4+ZMFzbY7y/HzCOiclszKz417utw1+0W+r+bbBha0VKLqC/IfoRky7buCBFO6cPS2/bo7VmMMTnPOM9k9+Yp/CfplLIYbi2xI6CXU+KfUSL8wYEc/lfsHnEl1BLZbFyiGN4SxczKnpB9HMAfcXt0wg+9eVeLAUZAZBIPJAZ+A6/BSCyrTiEas285QQcW89luYtTynvkiYdiMXHD7JtdQP4PuVFpsAGiSKa0oTdHrSBt8Ni8XRUcnvIL35Rge+uag9GcAfqR43qi1JLJMI0Sr/63ZWdBSAIAKU5WlPYJv8bDTQwMwI/mGzdJ6Wqgf+aCA+zKf3PJgdLxoBu6cJHFe5YjtUCjnxu9tWqUTrbP3EcEvMCLcyhh4c+APKznIlDF+6LQsDD5SvBtfA/JCJ39jS71j9F0IT4xv0RH6SeP4Rn/Dsmw+CNdx1WSA+O502dWVnUsR58AY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(366004)(136003)(376002)(83380400001)(16526019)(186003)(26005)(38350700002)(38100700002)(316002)(66556008)(66946007)(66476007)(6512007)(2616005)(956004)(478600001)(4326008)(44832011)(36756003)(6486002)(6506007)(5660300002)(2906002)(52116002)(1076003)(86362001)(8936002)(6666004)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?NW3YBM20lvsKFbUmoY1QYPzmMKsWeq5QEg4+VbiDoTiASid3mHXT/d886Y+C?= =?us-ascii?Q?us7lPJXyikYCTP3LFbvpwuy2cQylsqjoTU1cseYhSRmcwfD731CY6sIBwwzk?= =?us-ascii?Q?DGwOJ5eeJ26sEAbcJVvv5QeaEiivHjYUzhc9JyIhdQ/ljPd6+nRFwFP37cR3?= =?us-ascii?Q?B2pDeJ+HxTRu0Sa3M7fWL2gPht+167QWTmvHMs0pzS26/R++oJ9jq/u0KujS?= =?us-ascii?Q?eU4w00rQQJqHqA0aoOwDUvR5+xvX6WDxG3T7z1+HW98DrC3iU/5NKAL+KiQM?= =?us-ascii?Q?c9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M?= =?us-ascii?Q?tcq7UWPpPINWDk+d+YIVhsoRmzgyY1iLEdPmTovw3t7JS6Z32+DY0VpW8zDK?= =?us-ascii?Q?oAJ8YNua10UKXQPD4gQMU8fgFxxYe4w/7tJ/VrQoTVAHRhwUv5mR7qvfqZa0?= =?us-ascii?Q?2Qqlgdo1mJHeIB5SzR2om/U/?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85e6f1e5-a2af-4651-0c32-08d8fe3b9f4a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2021 05:18:50.4339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: x8HD+9ZWlVGQzOmvnG/r9+07HMnfuBEJy224oIWFoNM4G5rz5IG9Esq1dJgBWPeHq+f2qwjxyMCmXSfvEISbJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR04MB3250 Subject: [dpdk-dev] [PATCH v3 7/8] app/bbdev: add parameter to take input in network order 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" From: Nipun Gupta Test bbdev application is reading the input and output from the test vector files in the same endianness which is of the system. This patch adds an option to provide data in the network order i.e. big endian format Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_vector.c | 18 ++++++++++++++++-- app/test-bbdev/test_bbdev_vector.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c index 50d1da00f7..fe04bd6b95 100644 --- a/app/test-bbdev/test_bbdev_vector.c +++ b/app/test-bbdev/test_bbdev_vector.c @@ -53,7 +53,8 @@ starts_with(const char *str, const char *pre) /* tokenization test values separated by a comma */ static int -parse_values(char *tokens, uint32_t **data, uint32_t *data_length) +parse_values(char *tokens, uint32_t **data, uint32_t *data_length, + int network_order) { uint32_t n_tokens = 0; uint32_t data_size = 32; @@ -94,6 +95,14 @@ parse_values(char *tokens, uint32_t **data, uint32_t *data_length) } *data_length = *data_length + (strlen(tok) - strlen("0x"))/2; + if (network_order) { + if ((strlen(tok) - strlen("0x"))/2 == 4) + values[n_tokens] = + rte_cpu_to_be_32(values[n_tokens]); + else if ((strlen(tok) - strlen("0x"))/2 == 2) + values[n_tokens] = + rte_cpu_to_be_16(values[n_tokens]); + } tok = strtok(NULL, VALUE_DELIMITER); if (tok == NULL) @@ -416,7 +425,8 @@ parse_data_entry(const char *key_token, char *token, /* Clear new op data struct */ memset(op_data + *nb_ops, 0, sizeof(struct op_data_buf)); - ret = parse_values(token, &data, &data_length); + ret = parse_values(token, &data, &data_length, + vector->network_order); if (!ret) { op_data[*nb_ops].addr = data; op_data[*nb_ops].length = data_length; @@ -728,6 +738,10 @@ parse_ldpc_encoder_params(const char *key_token, char *token, ret = parse_expected_status(token, &status, vector->op_type); if (!ret) vector->expected_status = status; + } else if (!strcmp(key_token, "network_order")) { + vector->mask |= TEST_BBDEV_VF_NETWORK_ORDER; + vector->network_order = (uint8_t) strtoul(token, &err, 0); + ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; } else { printf("Not valid ldpc enc key: '%s'\n", key_token); return -1; diff --git a/app/test-bbdev/test_bbdev_vector.h b/app/test-bbdev/test_bbdev_vector.h index 4e5dbf5d50..aa53f0bb0d 100644 --- a/app/test-bbdev/test_bbdev_vector.h +++ b/app/test-bbdev/test_bbdev_vector.h @@ -35,6 +35,7 @@ enum { TEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL << 23), TEST_BBDEV_VF_OP_FLAGS = (1ULL << 24), TEST_BBDEV_VF_EXPECTED_STATUS = (1ULL << 25), + TEST_BBDEV_VF_NETWORK_ORDER = (1ULL << 26), }; enum op_data_type { @@ -60,6 +61,7 @@ struct test_bbdev_vector { enum rte_bbdev_op_type op_type; int expected_status; int mask; + int network_order; union { struct rte_bbdev_op_turbo_dec turbo_dec; struct rte_bbdev_op_turbo_enc turbo_enc; -- 2.17.1