From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgw.gov.kz (mgw.gov.kz [89.218.88.242]) by dpdk.org (Postfix) with ESMTP id 92B0D68AF for ; Mon, 17 Nov 2014 13:32:25 +0100 (CET) Received: from mgw.gov.kz (mx.ctsat.kz [178.89.4.95]) by mgw.gov.kz with ESMTP id sAHCgetc026446-sAHCgete026446 (version=TLSv1.0 cipher=AES128-SHA bits=128 verify=NO); Mon, 17 Nov 2014 18:42:41 +0600 Received: from EXCASHUB1.rgp.local (192.168.40.51) by EdgeForefront.rgp.local (192.168.40.59) with Microsoft SMTP Server (TLS) id 14.2.247.3; Mon, 17 Nov 2014 18:42:30 +0600 Received: from [192.168.35.15] (192.168.35.15) by excashub1.rgp.local (192.168.40.48) with Microsoft SMTP Server (TLS) id 14.2.247.3; Mon, 17 Nov 2014 18:42:36 +0600 Message-ID: <5469ED0F.5060709@sts.kz> Date: Mon, 17 Nov 2014 18:41:51 +0600 From: Yerden Zhumabekov User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "Ananyev, Konstantin" , "dev@dpdk.org" References: <1409724351-23786-1-git-send-email-e_zhumabekov@sts.kz> <1416160760-16087-4-git-send-email-e_zhumabekov@sts.kz> <2601191342CEEE43887BDE71AB977258213AE40F@IRSMSX105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258213AE40F@IRSMSX105.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.35.15] X-FEAS-SYSTEM-WL: e_zhumabekov@sts.kz Subject: Re: [dpdk-dev] [PATCH v2 3/4] hash: add fallback to software CRC32 implementation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 12:32:26 -0000 17.11.2014 18:34, Ananyev, Konstantin пишет: > Hi Yerden, > >> +static inline void >> +rte_hash_crc_set_alg(enum crc32_alg_t alg) >> +{ >> + int sse42_supp = rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2); >> + enum crc32_alg_t alg_supp = sse42_supp ? CRC32_SSE42 : CRC32_SW; >> + >> + if (alg == CRC32_SSE42) >> + crc32_alg = alg_supp; >> + else >> + crc32_alg = CRC32_SW; >> +} >> + > Wonder can we define that function with __attribute__((constructor))? > Then, I suppose we can remove CRC32_AUTODETECT, and remove: > if (unlikely(crc32_alg == CRC32_AUTODETECT)) > rte_hash_crc_set_alg(CRC32_SSE42); > from rte_hash_crc_*byte(). Nice feature I was unfamiliar with :) Since I'm going to revise the patch series anyway, I'll apply it and test. Thank you. -- Sincerely, Yerden Zhumabekov State Technical Service Astana, KZ