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 ED452438E3; Tue, 16 Jan 2024 19:43:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C60D240DDA; Tue, 16 Jan 2024 19:43:17 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id A5D9E40A84 for ; Tue, 16 Jan 2024 19:43:14 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1d41bb4da91so56618915ad.0 for ; Tue, 16 Jan 2024 10:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705430594; x=1706035394; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qcapsTAS2FrBqtvBRyu1/qQWJzr7RLLy4mS98JGu2bE=; b=2hLyBA6DdX4T2UX7QnKZyjQ/KtV/RQRHVmkCjsqdcpdntdvz7ZY9cZTiNW44016Dcw 5t6qKCTVDW+r8M6lotilFi1HE3O8H+tgxtiJa244HjJyF7CAjuiAhBKU4/LtySxkA3mw 92+MUK61eHUDQCp+QyvCldBVlNgCosBU+h6SQm/uGWe9tCR16bYaQkX+b4EfWpWtMKbm D+CcpOqRm1m8yJeeqdf0j/g89Bud8YIuH6gdT0LWqUY1Jk1BFvD+gpMJ/Xl6wzM50Xl+ 00XfFtjUEQ0e152HTtIRt8zCgScJ/pfIIqFMf0nCW5rIe/mL2rM6dyvJUoEVbntQrVS5 TwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705430594; x=1706035394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qcapsTAS2FrBqtvBRyu1/qQWJzr7RLLy4mS98JGu2bE=; b=mO4f132xwP49/srElPZlrkLbvfncKe+dzDjcTxYrEn79Zu2VVgQD7XTv0pPKmmZ3Iu 2sOwVlJARz7pN/zSxaKuQgp81joGAf5BAclO/aldvCvyQYCWEM9JphuYvPfrultuAE7y W5LvFHrbO+Khn3jUfAibFpWgPlv/R7dichdaPLfh/G6qAR8fxaq255gxfXP3wdxwiXpX SSJtCVH6WNx6tkP438wkqIlUgHAIGevWUfK121BWhAbsYLyq1A7mXmOh4gBRDuZMzCvx lrqJUShhYDEAQmM7TeIlKWr+jclcQHOkIdChiEcr4D8gTkp+CaWOUimmG+WVT54vgpAc aNZA== X-Gm-Message-State: AOJu0Yw39QwVtuM3u2ORg3p3Ln4Ddup3p/wWI1+r4JPYGmqbUTIda0tZ qUPo40UzmnkfiV8/sa6uOv/3GaCseFQzIM9yi4Lijveulkso5g== X-Google-Smtp-Source: AGHT+IEubuCvfoCqyDWf22vaT8RKO/5FDfKrnOxl6jTXyAQSLquhB3XCucaZoeIuA1+ao81CQqimsQ== X-Received: by 2002:a17:903:41c3:b0:1d4:8d6:159 with SMTP id u3-20020a17090341c300b001d408d60159mr5057313ple.100.1705430593873; Tue, 16 Jan 2024 10:43:13 -0800 (PST) Received: from hermes.lan (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id m8-20020a1709026bc800b001d60a70809bsm379238plt.168.2024.01.16.10.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 10:43:13 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yuying Zhang , Beilei Xing , Bruce Richardson , Konstantin Ananyev Subject: [PATCH v3 3/5] net/i40e: avoid using const variable in assertion Date: Tue, 16 Jan 2024 10:41:13 -0800 Message-ID: <20240116184307.162882-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116184307.162882-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. 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(-) diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.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 #define I40E_FDIR_PRG_PKT_CNT 128 +#define I40E_FDIR_ID_BIT_SHIFT 13 /* * 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 = 13; - RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID != (1 << FDIR_ID_BIT_SHIFT)); + RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID != (1 << I40E_FDIR_ID_BIT_SHIFT)); v_fd_id_mask = _mm_srli_epi32(v_fd_id_mask, 31); - v_fd_id_mask = _mm_slli_epi32(v_fd_id_mask, FDIR_ID_BIT_SHIFT); + v_fd_id_mask = _mm_slli_epi32(v_fd_id_mask, I40E_FDIR_ID_BIT_SHIFT); /* 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] = _mm_blendv_epi8(descs[0], _mm_setzero_si128(), v_desc0_mask); /* Shift to 1 or 0 bit per u32 lane, then to RTE_MBUF_F_RX_FDIR_ID offset */ - const uint32_t FDIR_ID_BIT_SHIFT = 13; - RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID != (1 << FDIR_ID_BIT_SHIFT)); + RTE_BUILD_BUG_ON(RTE_MBUF_F_RX_FDIR_ID != (1 << I40E_FDIR_ID_BIT_SHIFT)); __m128i v_mask_one_bit = _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 -- 2.43.0