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 BEBEE45B61 for ; Fri, 18 Oct 2024 01:42:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4BF34021E; Fri, 18 Oct 2024 01:42:37 +0200 (CEST) Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by mails.dpdk.org (Postfix) with ESMTP id 481144021E for ; Fri, 18 Oct 2024 01:42:36 +0200 (CEST) Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-71e541be854so1661284b3a.1 for ; Thu, 17 Oct 2024 16:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729208555; x=1729813355; darn=dpdk.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=MeKbUbm69xrERKvyQsQYdiw1TTuQfKsjaDygQcXqxyA=; b=FGEwqBhsEwjEPy6iQAJZ/vnjnOIRwxW2Zbjp4kBrigcYOY5PrpmhSEaqZdUp6GahO3 zJ/6vegwcQy8R9LmOe/gx+JAKbrl0QV5R9/VjsQVLtclsWa0KMnz9ye41bvMYJ8Bj7uE luYAI4SqWR7cL9vo3qtv6QShw5EBGuwPGA+Uh3IHn2aaYOg/ceayDfIIYKm5bXQA4act rUGO7M7tQEs5C0LZSliJuaD5ifXHbpWwD4LStDvJO297ppUCpyaKInC8rg162PmA72V+ xQh7MgfHQ2lkeDbHTceZ3TGMbvMmbzfoXJeR28RrqqnFh5/40kdFMOoC9p9UT6pIpSDv zVgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729208555; x=1729813355; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MeKbUbm69xrERKvyQsQYdiw1TTuQfKsjaDygQcXqxyA=; b=VjikgEaJp5I3m9+G+QzoYRmr4d2aFyMHEP5kyJ9wUePCdwPlrgZkTr4jn9akVoITfD /I7E/ACuGJTHkHDJg0iVuraY+lX60Qn52W6WYqwaQDqhYFwakyP/oesrHaAdqoT3TMoA OrGKMxY9IlUGfUFyx423iSEuNCB6fA30KA0dXmRUCm4vpt6fdSNzQ7pb2EM81oU+Rw67 tvaG9buyWSotHVF/924xHzLq7VRsV6I0Is9e266z2/p2Eu1u9bFOzjjzmGgUg3KB3CBM cAdESO4iI2mXMQ20pbM6cqQwC9NnM7XKtiiy0B6b0FZUfMWZyTCccNtYqfGR8AKrTgnp v5Pg== X-Forwarded-Encrypted: i=1; AJvYcCX7mLoL+HGU+HoX5F2TWxebeVUKRJd6zOjH/VQVQGQV28jmM8Ak+rhtTHeLf+1Yr5I3lRdnIfY=@dpdk.org X-Gm-Message-State: AOJu0Yy/GFE7/v/iWrR6SwXnHIC/v/lGjNdDtWkGX8omaeaKLs2fycy0 fLgq6aOgHPNR5ECHKIW8T80Mkdbmrc99jva5BmyVk1mrJjlZgEDFNb2gU00mYOBP816pa1gwcEF ufg7vSC2CSQ== X-Google-Smtp-Source: AGHT+IEZWvp1vlJLeVWy8H5uXY3ZCPFYoCwXy1NhKJmnyPoehRKWNU7GwzCVFXWp/qpVBVaCiR0SlhPqfZG4dw== X-Received: from joshwash.sea.corp.google.com ([2620:15c:11c:202:d987:e3a3:db52:be2a]) (user=joshwash job=sendgmr) by 2002:aa7:8c4e:0:b0:71e:4ec7:aed8 with SMTP id d2e1a72fcca58-71ea32d1f72mr977b3a.6.1729208555186; Thu, 17 Oct 2024 16:42:35 -0700 (PDT) Date: Thu, 17 Oct 2024 16:42:33 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Message-ID: <20241017234233.3456943-1-joshwash@google.com> Subject: [PATCH] net/gve: replace typedefs with macros in gve osdep From: Joshua Washington To: Jeroen de Borst , Rushil Gupta , Joshua Washington , Junfeng Guo , Xiaoyun Li , Haiyue Wang Cc: dev@dpdk.org, stable@dpdk.org, Ferruh Yigit , David Marchand Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Currently, a number of integer types are typedef'd to their corresponding upserspace or RTE values. This can be problematic if these types are already defined somewhere else, as it would cause type collisions. This patch changes the typedefs to #define macros which are only defined if the types are not defined already. Fixes: c9ba2caf6302 ("net/gve/base: add OS-specific implementation") Fixes: abf1242fbb84 ("net/gve: add struct members and typedefs for DQO") Cc: junfeng.guo@intel.com Cc: stable@dpdk.org Signed-off-by: Joshua Washington Suggested-by: David Marchand --- drivers/net/gve/base/gve_osdep.h | 48 ++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/drivers/net/gve/base/gve_osdep.h b/drivers/net/gve/base/gve_osdep.h index c0ee0d567c..64181cebd6 100644 --- a/drivers/net/gve/base/gve_osdep.h +++ b/drivers/net/gve/base/gve_osdep.h @@ -29,22 +29,46 @@ #include #endif -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; +#ifndef u8 +#define u8 uint8_t +#endif +#ifndef u16 +#define u16 uint16_t +#endif +#ifndef u32 +#define u32 uint32_t +#endif +#ifndef u64 +#define u64 uint64_t +#endif -typedef rte_be16_t __sum16; +#ifndef __sum16 +#define __sum16 rte_be16_t +#endif -typedef rte_be16_t __be16; -typedef rte_be32_t __be32; -typedef rte_be64_t __be64; +#ifndef __be16 +#define __be16 rte_be16_t +#endif +#ifndef __be32 +#define __be32 rte_be32_t +#endif +#ifndef __be64 +#define __be64 rte_be64_t +#endif -typedef rte_le16_t __le16; -typedef rte_le32_t __le32; -typedef rte_le64_t __le64; +#ifndef __le16 +#define __le16 rte_le16_t +#endif +#ifndef __le32 +#define __le32 rte_le32_t +#endif +#ifndef __le64 +#define __le64 rte_le64_t +#endif -typedef rte_iova_t dma_addr_t; +#ifndef dma_addr_t +#define dma_addr_t rte_iova_t +#endif #define ETH_MIN_MTU RTE_ETHER_MIN_MTU #define ETH_ALEN RTE_ETHER_ADDR_LEN -- 2.47.0.rc1.288.g06298d1525-goog