From patchwork Mon Apr 1 17:01:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 139015 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 804D743DAA; Mon, 1 Apr 2024 19:03:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A73E402D2; Mon, 1 Apr 2024 19:03:11 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id D0EA34028B for ; Mon, 1 Apr 2024 19:03:09 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6ea9a616cc4so2872513b3a.1 for ; Mon, 01 Apr 2024 10:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711990989; x=1712595789; 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=S5dUAq3LAjAuy8LOJ/UIb1Pod3vsFVofJPHmB2uTlKA=; b=pbyBhDnyDtYGeUKgSWzuJbNRyWzSU6rgtQJANQWDsqLX7POpMgEKq0aks8C0X0KfFW +tULNmx8hUe0oCCy+UUqN57M9sWKNLThOZLc9NB7rrq+y9osWBXTgVqBiie/xya3Gw7Y 3vpnk0azqdoCrVOeu8alR064qbJHHawd6yXMFJHxfl9cM098a3SqsXy+8Qe85KrYhkZe I9b7zBRmf2+mWup7dwdlkN8PqnvZT/eFdSsEBRqelmOzBuWvjbKJM48ehT3iHSKxwmkv N6aoCHTp6poeP5VDe1azmvuf8wMWAKg369Irly+3N+w/A/grTA39rNrGZ8m43M2p6Cek 1W7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711990989; x=1712595789; 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=S5dUAq3LAjAuy8LOJ/UIb1Pod3vsFVofJPHmB2uTlKA=; b=K8ZWahTjcytJImNl2sbabL/maDJDH7u7Gy8u4cSkIvb3CtPQgevWc+losOcAAZ+Bhg x5aKTZM6NJMtsvdrFKo1DSNfalqA4ielV0/DK0aWEI4bV0zYM7SNZKaJMMW3vTtp5ocM Z0NOWvK9n/99Zn56LtHH2xMrkhc7ylRg1O7EGlDq1jduZDsZlwX9FT2E6DZO5R9NgFrR 2jDemL/Ufnc2AyfuscO80qJBxGZqfX4zxgAeIqFBTBDGOnzTkwaA0Pf8YeO38e/rOiIW oaTH4bOCLRZLMD+kXubMAQU7IbVTDbZkK3U7ZsFB1w8Hb/hBdwHEOKKK7CugVNMaYlB1 iFsw== X-Gm-Message-State: AOJu0YwLwBsJVDSALAZN5GWT8KUNqs7N/4kAeJU/J2ERmlcWXkXVFV5I Zebn+ZmrhUofWh3g/JOWSkVzeFanTBZ4KIVx4o/Jr/tnSqWhYyqC70Y/loZF7XPFyl3P/Y1oglF t X-Google-Smtp-Source: AGHT+IFb6ekNM/mVfCbYTq5+EBdgUErQgnjkgKGMpOjgONCdPbm+puBY475RIhZlXqdd27hoXMegVw== X-Received: by 2002:a05:6a20:2d12:b0:1a3:6465:208e with SMTP id g18-20020a056a202d1200b001a36465208emr11910349pzl.55.1711990988943; Mon, 01 Apr 2024 10:03:08 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id a18-20020aa780d2000000b006e6cc93381esm8101729pfn.125.2024.04.01.10.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 10:03:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 1/2] mempool: replace GCC pragma with cast Date: Mon, 1 Apr 2024 10:01:52 -0700 Message-ID: <20240401170257.121047-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401170257.121047-1-stephen@networkplumber.org> References: <20240401170257.121047-1-stephen@networkplumber.org> 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 Building mempool with MSVC generates a warning because of this pragma (same with clang when debug is enabled). The issue the pragma was working around can be better solved by using an additional cast. Fixes: af75078fece3 ("first public release") Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- lib/mempool/rte_mempool.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 12390a2c81..734e8a2feb 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -1056,10 +1056,6 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp) return count; } -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - /* check and update cookies or panic (internal) */ void rte_mempool_check_cookies(const struct rte_mempool *mp, void * const *obj_table_const, unsigned n, int free) @@ -1074,7 +1070,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp, /* Force to drop the "const" attribute. This is done only when * DEBUG is enabled */ - tmp = (void *) obj_table_const; + tmp = (void *)(uintptr_t)obj_table_const; obj_table = tmp; while (n--) { @@ -1183,10 +1179,6 @@ mempool_audit_cookies(struct rte_mempool *mp) #define mempool_audit_cookies(mp) do {} while(0) #endif -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic error "-Wcast-qual" -#endif - /* check cookies before and after objects */ static void mempool_audit_cache(const struct rte_mempool *mp) From patchwork Mon Apr 1 17:01:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 139016 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A82643DAA; Mon, 1 Apr 2024 19:03:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59E1C402DD; Mon, 1 Apr 2024 19:03:12 +0200 (CEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 98440402CF for ; Mon, 1 Apr 2024 19:03:10 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e703e0e5deso3260879b3a.3 for ; Mon, 01 Apr 2024 10:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711990990; x=1712595790; 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=cxteX4w5ekKNt3zOa0ShIw6MHKISUV86ugVaH4nx8P4=; b=01y+1b+aNm8JNFpL2vpFyuJhAGdurAwcuSlp9yuTY2QasEQhxSOe3wxIwNLM4PkVNw HgRiGY1+SMNgCtK44zLULbjYtLiqNeyZ/NkQGuA4bDkgH0qwvjtfCcbWPLbFu66Ytrih fuWKOwArxPPxzqVtsgggy29Ir6Jw9G3DvvbnQPCdYLuSeDZCcCXwv/IH4vp/j3Hy8y1Y fxpBxbTiNT62qNGwfTIKrym132qgmLNRnP2vcVg/YTh/c2+C5aShxlIHXe38L3evywc8 KWcQQv8WQWx1B0m9fZE2xxIDsxRSDDzm3qDKDT4e4AGPSPXHRuTGT1FA5yukWgsPc2cD SQNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711990990; x=1712595790; 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=cxteX4w5ekKNt3zOa0ShIw6MHKISUV86ugVaH4nx8P4=; b=sj/mKOsDXBk/j87PC6+HY7MfyHnYsbiBqpgIeK1b73lM1us5ACO4rRg/9ELGgVWRpB fmE+rypFDMpoALJs6jbQd8UKxb6p5MSUXrxj7RCaJqihkKdP5N5CCnxFIaHdd4D6WqHM m+9C0NNWykqHiI9+YXk7wHRPKjdfnPrevB3AP27zB50lJ9+3q7K1fruvUTaiCisPEPex KCeu69h/aJ3oxk03pbLXeW+9UVl/IGQeBdcieDC3mwHUOizofMAt4B/FbK3bJ6E64r4/ TugIqD+6CsPB+rG7KeCeWnKafNoSzsIzI3dhNxkOjcDux926w/mgR0TMoRKBsHClDDlY JBQg== X-Gm-Message-State: AOJu0YwIEJqdpWJX4NiE7FVUaCzd0+sq5nWbLc0V9RZBL4ceHnRQkXT+ /06iAm89xxSqULMpJ9sDL4cKnq+aJQmZfS5FTH+TLWQU1j1/ApXNFLzIJ4qvSC1DOyogN+rg8S0 a X-Google-Smtp-Source: AGHT+IEyNexX4D+6fTruMcJwh+Lurn6lg1IFM3dv7rxPnbf6zFNViEta3m5gfkw+2xCewAyrEeHkIQ== X-Received: by 2002:a05:6a00:39a9:b0:6ea:7468:1f31 with SMTP id fi41-20020a056a0039a900b006ea74681f31mr10026883pfb.30.1711990989643; Mon, 01 Apr 2024 10:03:09 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id a18-20020aa780d2000000b006e6cc93381esm8101729pfn.125.2024.04.01.10.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 10:03:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 2/2] mempool: fix unused warning with MSVC Date: Mon, 1 Apr 2024 10:01:53 -0700 Message-ID: <20240401170257.121047-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240401170257.121047-1-stephen@networkplumber.org> References: <20240401170257.121047-1-stephen@networkplumber.org> 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 Applying __rte_unused to a variable has no effect with MS windows compiler. The temporary variable used if debug enabled can just be eliminated. Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- lib/mempool/rte_mempool.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 734e8a2feb..2ac815a3bb 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -164,7 +164,6 @@ mempool_add_elem(struct rte_mempool *mp, __rte_unused void *opaque, void *obj, rte_iova_t iova) { struct rte_mempool_objhdr *hdr; - struct rte_mempool_objtlr *tlr __rte_unused; /* set mempool ptr in header */ hdr = RTE_PTR_SUB(obj, sizeof(*hdr)); @@ -175,8 +174,7 @@ mempool_add_elem(struct rte_mempool *mp, __rte_unused void *opaque, #ifdef RTE_LIBRTE_MEMPOOL_DEBUG hdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2; - tlr = rte_mempool_get_trailer(obj); - tlr->cookie = RTE_MEMPOOL_TRAILER_COOKIE; + rte_mempool_get_trailer(obj)->cookie = RTE_MEMPOOL_TRAILER_COOKIE; #endif }