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 85C8D438F1; Thu, 18 Jan 2024 10:34:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C005402B0; Thu, 18 Jan 2024 10:34:30 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 40486400D7 for ; Thu, 18 Jan 2024 10:34:29 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TFyFT5m49z6K62n; Thu, 18 Jan 2024 17:32:13 +0800 (CST) Received: from frapeml100006.china.huawei.com (unknown [7.182.85.201]) by mail.maildlp.com (Postfix) with ESMTPS id DFD0C140C98; Thu, 18 Jan 2024 17:34:28 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml100006.china.huawei.com (7.182.85.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 18 Jan 2024 10:34:28 +0100 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.035; Thu, 18 Jan 2024 10:34:28 +0100 From: Konstantin Ananyev To: Stephen Hemminger , "dev@dpdk.org" CC: Yuying Zhang , Beilei Xing , Bruce Richardson , Konstantin Ananyev Subject: RE: [PATCH v4 4/6] net/i40e: avoid using const variable in assertion Thread-Topic: [PATCH v4 4/6] net/i40e: avoid using const variable in assertion Thread-Index: AQHaSXK2SZ+wS5Fmn068WWEKXpiylbDfUBIA Date: Thu, 18 Jan 2024 09:34:28 +0000 Message-ID: References: <20231111172153.57461-1-stephen@networkplumber.org> <20240117182541.211125-1-stephen@networkplumber.org> <20240117182541.211125-5-stephen@networkplumber.org> In-Reply-To: <20240117182541.211125-5-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > Clang does not allow const variable in a static_assert > expression. >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/net/i40e/i40e_ethdev.h | 1 + > drivers/net/i40e/i40e_rxtx_vec_sse.c | 10 ++++------ > 2 files changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethde= v.h > index 1bbe7ad37600..445e1c0b381f 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -278,6 +278,7 @@ enum i40e_flxpld_layer_idx { > #define I40E_DEFAULT_DCB_APP_PRIO 3 >=20 > #define I40E_FDIR_PRG_PKT_CNT 128 > +#define I40E_FDIR_ID_BIT_SHIFT 13 >=20 > /* > * Struct to store flow created. > diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e= _rxtx_vec_sse.c > index 9200a23ff662..2d4480a7651b 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c > +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c > @@ -143,10 +143,9 @@ descs_to_fdir_32b(volatile union i40e_rx_desc *rxdp,= struct rte_mbuf **rx_pkt) > /* convert fdir_id_mask into a single bit, then shift as required for > * correct location in the mbuf->olflags > */ > - const uint32_t FDIR_ID_BIT_SHIFT =3D 13; > - RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID !=3D (1 << FDIR_ID_BIT_SHIFT)); > + RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID !=3D (1 << I40E_FDIR_ID_BIT_SHIF= T)); > v_fd_id_mask =3D _mm_srli_epi32(v_fd_id_mask, 31); > - v_fd_id_mask =3D _mm_slli_epi32(v_fd_id_mask, FDIR_ID_BIT_SHIFT); > + v_fd_id_mask =3D _mm_slli_epi32(v_fd_id_mask, I40E_FDIR_ID_BIT_SHIFT); >=20 > /* The returned value must be combined into each mbuf. This is already > * being done for RSS and VLAN mbuf olflags, so return bits to OR in. > @@ -205,10 +204,9 @@ descs_to_fdir_16b(__m128i fltstat, __m128i descs[4],= struct rte_mbuf **rx_pkt) > descs[0] =3D _mm_blendv_epi8(descs[0], _mm_setzero_si128(), v_desc0_mas= k); >=20 > /* Shift to 1 or 0 bit per u32 lane, then to RTE_MBUF_F_RX_FDIR_ID offs= et */ > - const uint32_t FDIR_ID_BIT_SHIFT =3D 13; > - RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID !=3D (1 << FDIR_ID_BIT_SHIFT)); > + RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID !=3D (1 << I40E_FDIR_ID_BIT_SHIF= T)); > __m128i v_mask_one_bit =3D _mm_srli_epi32(v_fdir_id_mask, 31); > - return _mm_slli_epi32(v_mask_one_bit, FDIR_ID_BIT_SHIFT); > + return _mm_slli_epi32(v_mask_one_bit, I40E_FDIR_ID_BIT_SHIFT); > } > #endif >=20 > -- Acked-by: Konstantin Ananyev =20 > 2.43.0