From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0084.outbound.protection.outlook.com [104.47.42.84]) by dpdk.org (Postfix) with ESMTP id 97FF81BE4E for ; Thu, 5 Jul 2018 10:14:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d6GlHZrYBxoZFd5o9HtJBGXtu2g7qjnKDzuXeqefU1g=; b=WIG532Q/sU6ws+dd2Y/rAfjcEjjexgNZ0SJuvUdwDBgVGxsxm2WvHghTjY6ZuozDxxNzojBvvt4XqQTGOZpmmUZ/sml2IOvME/RDgGVd9rsNk4NHr6RACf1K/Y8WlTQ9CVXOwKOhFnQs+O9QD3s0UkUlckW89433npHre35gHrk= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3811.namprd07.prod.outlook.com (52.132.102.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.24; Thu, 5 Jul 2018 08:14:23 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b%4]) with mapi id 15.20.0906.026; Thu, 5 Jul 2018 08:14:22 +0000 From: "Verma, Shally" To: Pablo de Lara , "Gupta, Ashish" , "fiona.trahe@intel.com" , "lee.daly@intel.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 4/4] compressdev: add huffman encoding flags Thread-Index: AQHUE+SnvDkY2J06U0C9tpgSk+g2kKR/6CcQ Date: Thu, 5 Jul 2018 08:14:22 +0000 Message-ID: References: <20180627055031.24394-1-pablo.de.lara.guarch@intel.com> <20180704141037.44021-1-pablo.de.lara.guarch@intel.com> <20180704141037.44021-4-pablo.de.lara.guarch@intel.com> In-Reply-To: <20180704141037.44021-4-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3811; 7:Tjv2zSGxqqigkRsljJHapEQ2ZR6T+l9AtlGdmf+lx91Rdf39ZZBtXCu1pJEz8CRT6hPS/QJyZkJPsUJzuf3rP2PTpGSYsydSb8Txvd6TPDkbF4+4XODcHi3v9TTA0pXzBLhqA2ofCFEgxCoHqCbnJIT6jc0NKCnjsBPjB54yLsajb+LGPdcDBtQNR8SfzM6CzYF41sRzyLcNs0vMqrXBNFjT+8shCR2TRoFU2xGFpG+77ZWXTKjW410AiTuCaDYN x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(376002)(396003)(39860400002)(346002)(136003)(366004)(13464003)(189003)(199004)(486006)(11346002)(316002)(476003)(5660300001)(446003)(53936002)(99286004)(110136005)(2900100001)(33656002)(6506007)(6116002)(3846002)(68736007)(66066001)(55236004)(97736004)(186003)(26005)(102836004)(72206003)(4326008)(76176011)(6246003)(7696005)(14454004)(25786009)(9686003)(86362001)(106356001)(575784001)(8936002)(2501003)(5250100002)(14444005)(74316002)(6436002)(229853002)(256004)(2906002)(7736002)(55016002)(81166006)(81156014)(8676002)(305945005)(2201001)(105586002)(478600001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3811; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: 7c80eceb-be44-4553-137e-08d5e24f509d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3811; x-ms-traffictypediagnostic: CY4PR0701MB3811: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3811; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3811; x-forefront-prvs: 0724FCD4CD received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 91cMDWAaTqjxJJAtmQOSIlRg7zfeSKWfNq0YI/yUnaq9vZhqSGvm8g348Cy7g+uNBu4Ns89Hhlw3hKw1ZheBX6+QnFSV/ubG7BPiNxlkaEctv9BEgVOzZ/+rv5viASRNfKwHkXIJ4bAeydaF6yKIMAbWleryogpNptqfCIUuj83Q+msZ+eqS2oHvrIgVaKKJfviTGWpDaVOD0kjGro5vGAK4iSIOOun+ZURTMMH1nDQzvUYzYF7VtRVu4d3I+JTHNGklyODzGPhPFEUr6gA3VHw21k7WG5V+xYUb5JAEqiTP1l6QK24SbTJBae1vVZgMWziMJYtxmdojuuMqgMh5iMwg3BBDwMQsKX19JobQbOg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c80eceb-be44-4553-137e-08d5e24f509d X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2018 08:14:22.4957 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3811 Subject: Re: [dpdk-dev] [PATCH v3 4/4] compressdev: add huffman encoding flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 08:14:25 -0000 >-----Original Message----- >From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com] >Sent: 04 July 2018 19:41 >To: Verma, Shally ; Gupta, Ashish ; fiona.trahe@intel.com; >lee.daly@intel.com >Cc: dev@dpdk.org; Pablo de Lara >Subject: [PATCH v3 4/4] compressdev: add huffman encoding flags > >External Email > >Added Huffman fixed and dynamic encoding feature flags, >so an application can query if a device supports >these two types, when performing DEFLATE compression. > >Signed-off-by: Pablo de Lara >Acked-by: Fiona Trahe >--- > >Changes in v3: > >- No change > >Changes in v2: > >- Fixed typo > > drivers/compress/isal/isal_compress_pmd_ops.c | 4 +++- > lib/librte_compressdev/rte_comp.c | 4 ++++ > lib/librte_compressdev/rte_comp.h | 4 ++++ > test/test/test_compressdev.c | 16 ++++++++++++++++ > 4 files changed, 27 insertions(+), 1 deletion(-) > //snip >diff --git a/lib/librte_compressdev/rte_comp.c b/lib/librte_compressdev/rt= e_comp.c >index f5bd3a6c0..5ed1d0daa 100644 >--- a/lib/librte_compressdev/rte_comp.c >+++ b/lib/librte_compressdev/rte_comp.c >@@ -36,6 +36,10 @@ rte_comp_get_feature_name(uint64_t flag) > return "SHA2_SHA256_HASH"; > case RTE_COMP_FF_SHAREABLE_PRIV_XFORM: > return "SHAREABLE_PRIV_XFORM"; >+ case RTE_COMP_FF_HUFFMAN_FIXED: >+ return "HUFFMAN_FIXED"; >+ case RTE_COMP_FF_HUFFMAN_DYNAMIC: >+ return "HUFFMAN_DYNAMIC"; > default: > return NULL; > } >diff --git a/lib/librte_compressdev/rte_comp.h b/lib/librte_compressdev/rt= e_comp.h >index 6660cee82..c9245cce1 100644 >--- a/lib/librte_compressdev/rte_comp.h >+++ b/lib/librte_compressdev/rte_comp.h >@@ -62,6 +62,10 @@ extern "C" { > * to create as many priv_xforms as it expects to have stateless > * operations in-flight. > */ >+#define RTE_COMP_FF_HUFFMAN_FIXED (1ULL << 13) >+/**< Fixed huffman encoding is supported */ >+#define RTE_COMP_FF_HUFFMAN_DYNAMIC (1ULL << 14) >+/**< Dynamic huffman encoding is supported */ > [Shally] As such okay to have this feature. But while looking at this, got = a question: rte_compressdev_info_get() returns feature flags of type RTE_COMPDEV_FF_xxx and, rte_compressdev_capability_get() returns PMD capability for specific a= lgo=20 using feature flags of type RTE_COMP_FF_xxx. So, =20 1. should rte_compressdev_capability_get() and "struct rte_compressdev_capa= bilities" be changed to rte_compressdev_comp_capability_get() or rte_compressdev_algo_capability_ge= t()? 2. where does RTE_COMPDEV_FF_HW_ACCELERATED be set? in dev_info->feature fl= ag or capability->feature_flag? What if PMD support hw acceleration of one algo but have sw support of anot= her. (say, deflate HW accelerated and LZS sw?) Thanks Shally > /** Status of comp operation */ > enum rte_comp_op_status { >diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c >index 640942bac..f960963a4 100644 >--- a/test/test/test_compressdev.c >+++ b/test/test/test_compressdev.c >@@ -846,6 +846,14 @@ test_compressdev_deflate_stateless_fixed(void) > const char *test_buffer; > uint16_t i; > int ret; >+ const struct rte_compressdev_capabilities *capab; >+ >+ capab =3D rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE)= ; >+ TEST_ASSERT(capab !=3D NULL, "Failed to retrieve device capabiliti= es"); >+ >+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) =3D=3D= 0) >+ return -ENOTSUP; >+ > struct rte_comp_xform *compress_xform =3D > rte_malloc(NULL, sizeof(struct rte_comp_xform), 0)= ; > >@@ -905,6 +913,14 @@ test_compressdev_deflate_stateless_dynamic(void) > struct rte_comp_xform *compress_xform =3D > rte_malloc(NULL, sizeof(struct rte_comp_xform), 0)= ; > >+ const struct rte_compressdev_capabilities *capab; >+ >+ capab =3D rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE)= ; >+ TEST_ASSERT(capab !=3D NULL, "Failed to retrieve device capabiliti= es"); >+ >+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_DYNAMIC) =3D= =3D 0) >+ return -ENOTSUP; >+ > if (compress_xform =3D=3D NULL) { > RTE_LOG(ERR, USER1, > "Compress xform could not be created\n"); >-- >2.14.4