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 1AA8245B61; Fri, 18 Oct 2024 01:42:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01E98402E2; Fri, 18 Oct 2024 01:42:38 +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 4821740268 for ; Fri, 18 Oct 2024 01:42:36 +0200 (CEST) Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-71e8641f2a7so1884757b3a.2 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=WzpUvja+YhegvixPI+1408ZJndtM7dX79hkPzYOZGTMl8bb2P82Iw2M6i+5NvS4rwO 2CmPvcLiTFieLWgX57tYahmW2XEWdkRNT6TQEZfOpB0w0QuG8WHr9bJLrx1fCm0SfJU0 3Qt8EVOTNQ4gT222rBaABOUTjT8kbRUFGt7ViWCsmsGm5089FaaMahl7xmRS/28Wh+JE /7Yb7mMc4g5EFSSriUF0DqRArmagAv1sadR9xntMxMzYveGhEt+PPTNBHY347n9UJTV1 Odn9x858JhQcdOilG4uk0f0eREgERjc1B9nVVqjnumv2WNsN0gnzHayLz+ituCviNt9m E97g== X-Gm-Message-State: AOJu0YzJwu/PDuvDsh5Q4nQrYk9t7V7CzntB/FiiBHwiuRc8a55j1Zoc P0lpCHHY+25V5mW7q6D8yLM9jv3KksYnAhY7DhAeiPssxpJoWe9f804vWmevAhuKIA+djIp1R6Y GnENo7XotHA== 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: 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 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