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 DF490438E4; Wed, 17 Jan 2024 19:26:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33BA840EE4; Wed, 17 Jan 2024 19:25:59 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 3C20C40E8A for ; Wed, 17 Jan 2024 19:25:55 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d5ece717aeso14283315ad.1 for ; Wed, 17 Jan 2024 10:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705515954; x=1706120754; 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=ogQ0oPpnjLJSCaj43afXL6oNaBnS3R99jcnEhMJei/sLq/29FyC/P+rQ4sX8Z8y388 1Lt09b1KjITXGl/wAESv+X6k4I+F/poqzELf8KpzK2LdT1PZeiK6ZTXk34QLWnc0ECrh sj+B4iUs4CdFaRtf3VsOcvSWDf4itnH/DRrIc1E0JxL4yZX5EUZUN0UEye8sVRBiDm8O 7tecTS7vEDTuZ79C7ib9fddynI2Alrl2We3BkZLfBNU8SDkNz6vehthp+AzSMD2ANnNZ 90toJ8JWMiT4RmM4GYWn8HNRNhxqVIRWzNdNSrLhnPPVKtaVaQg9cAlF5CHXJt5A7mKh Z1dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705515954; x=1706120754; 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=YYhbZx551Tmu1QxeeuzBmikHIHewQX6m8bpc0rAfvXSO7hR/baitHHkp3VNsOvaV1n krA5GoGPlk0nER/wm208ZzMzWlxXkPuJjXITuhWR303fMqWId9+ftpEvdgrawkqBscfK sIQNnWlrZSY71pMmUGe3kcQ2nt4wiLja/IxWNKYS0UeDpzD1KIzr9m5cpBTmcKyK7K9w 0JF0Clj7k6rc6/AH8f9PJaVfBbg/E51nXyYrJfGQbt1Ex4AIGJCcX4DzDOFlWQMvepuc RcM9pr9NSeqTI90Ym3d18ftaVZ2u55/7lA5exTnV4CbYoT1k7UyXFyvmCUnc1tiY0B8C uLQg== X-Gm-Message-State: AOJu0YyGZhfN+6WsGn4uG5B7qb64QdE/tSlaBgxficVA/O9Sp5mTa479 zTSZKYdvtKIvvJ2ITuVSdrbQVT/D5SxR6F0nsucepZb8knUjGw== X-Google-Smtp-Source: AGHT+IEV7BNDwQEAqqWAujDI98vNhOckBaPN2OPYV3PeRZzcWtnowmu8q8wxuhtdCF8U4Ge9aAgzRg== X-Received: by 2002:a17:90b:3e87:b0:28c:7ca2:ee49 with SMTP id rj7-20020a17090b3e8700b0028c7ca2ee49mr5012604pjb.54.1705515954485; Wed, 17 Jan 2024 10:25:54 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id qj15-20020a17090b28cf00b0028ce507cd7dsm14334124pjb.55.2024.01.17.10.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 10:25:54 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yuying Zhang , Beilei Xing , Bruce Richardson , Konstantin Ananyev Subject: [PATCH v4 4/6] net/i40e: avoid using const variable in assertion Date: Wed, 17 Jan 2024 10:19:58 -0800 Message-ID: <20240117182541.211125-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117182541.211125-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240117182541.211125-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