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 B13BD438F4; Thu, 18 Jan 2024 17:53:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C25DA42E18; Thu, 18 Jan 2024 17:53:32 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id C493A42DD0 for ; Thu, 18 Jan 2024 17:53:29 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1d6f2443b06so14193495ad.2 for ; Thu, 18 Jan 2024 08:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705596809; x=1706201609; 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=9qVpor/C8jYPDUZeUkQwv6mKRDDZAs4KcMRWuyLcbxg=; b=lyX4ql6hmh2H7D5gC3pnFskGeG63WfRqmmtrSoWmbzlILYIiJzobCE3r3Kr1pXixm4 1sod/zusEtr4TCHxUyMvIvd0EIWYKbJ8ZnG5pCOM6J+0jRUSaCeluSg7KOCIFaVtFc7W LeW+26/nU6A+prhY10BfNYNaNpxw6HcFWP/d/xxnIBIiuotI8aNOH9xw3IMpeQ439XKb njPX98bsS8mixTDXrhnvBcoe8Q5Ux6kGHwQE6jn6B/GJZutkXXEMUTXIUibHdlMLBqKE vNdsJQcDrYqK9V0HHHv4cFF5WY9q50T1THkhgXfZns9a7UN4MNijcQouk+CgUoKQ9s1t jM8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705596809; x=1706201609; 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=9qVpor/C8jYPDUZeUkQwv6mKRDDZAs4KcMRWuyLcbxg=; b=KN06fPfU/ObS+KwT92PeOwwp0eQ7gCcKGDF8SX/omib0K3CSFqcSDm/HWsSlWkFT2U xmxfz+bARrfYZuQz6WSK8tSGZ9RNdQOGrWleQrgLYxK7Mg+4emGCma7fyK5Iq51ci9cs /PEOIjVxP668oSNN2JkHDlzP8Dze69QIXS5pLsFmpyLUrpQOPhqUSPRahP77DmN3duNQ pWUWeg6tO/Cu2++YvEccKe9JrXkxKdDzXmnEscjJkZ/BHKIprM8Hha/mQmbW7UCk0UZa xdZoaDWyX9jaXsjQJQwSimvtNBxvlc2m8Uz4hUeMjk4AKniRhL/Fqmalz7/rcRrAcm4T yeJQ== X-Gm-Message-State: AOJu0YwDwg3/ALV3bbPCgP+FibCeWAjrHYS4xGM5ChPIutQEOVrUKvtK 0nEFhzELOt9zYVgu+ysPt6GyS+mIMGpQdTdCgRoO39zbMCLibZPXMxklXQIG6RMt4T1RDPX/ppt koVU= X-Google-Smtp-Source: AGHT+IFsoWW8VwmrHINdj31mZNIIGtrnPI0w9YunUz6JNXYkNEtTETh8+/s2yKBfzKga/Tdf7izM3A== X-Received: by 2002:a17:902:bb01:b0:1d6:f493:b219 with SMTP id im1-20020a170902bb0100b001d6f493b219mr986428plb.137.1705596809021; Thu, 18 Jan 2024 08:53:29 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id u2-20020a170903304200b001d706912d1esm1427980pla.225.2024.01.18.08.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 08:53:28 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson , Konstantin Ananyev , Yuying Zhang , Beilei Xing , Konstantin Ananyev Subject: [PATCH v5 4/6] net/i40e: avoid using const variable in assertion Date: Thu, 18 Jan 2024 08:50:59 -0800 Message-ID: <20240118165315.63959-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118165315.63959-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240118165315.63959-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 Acked-by: Bruce Richardson Acked-by: Konstantin Ananyev --- 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