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