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 9EF67438E3; Tue, 16 Jan 2024 19:43:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B14F440DCB; Tue, 16 Jan 2024 19:43:16 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id C459B40685 for ; Tue, 16 Jan 2024 19:43:13 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d427518d52so74509575ad.0 for ; Tue, 16 Jan 2024 10:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705430593; x=1706035393; 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=XXOGgNHbQSerctOtBdqy+t/ORx8Hir/GEtXkPqLeiU4=; b=Qwd+ZtJCrIAthNZGDJuHJJQNWX2qe3tR6ONrSKBicghPDiB8+PKT82cTkKP+HFh/IH /6mriNRnBVryop+dJ7iGaRwf4FNOFX5c2gDrE2WYouMeX4wlYFpT8OdWM/L725Hs3nUM CLVYdZvMaOL2l3ZSttBOgX/byUh0AfWOwKmRkB3WPuKeD/eABvNQM5a7VLSUij+6ypZv a9pS9J0vKNV/QfajkBwUO2fYILTZ6KzyCxv9Ba5qsnLxRiTSLS+F4bNs8pesgZmNwWjl FO8c4qGHBiguguawJyiGHea+q/riThMpbfoPSktL83pYffpaU7mub0Ekc3vwEGX+zzmC af4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705430593; x=1706035393; 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=XXOGgNHbQSerctOtBdqy+t/ORx8Hir/GEtXkPqLeiU4=; b=gSN24QSwGikNFydr2D61XiNLidL6rV5eL5B0O1lBPyvc6wMWoIZx7cTvwg1vIEljy9 PR0Ul7Db6KHHqPL4jHVcl9dvSCeoPi5I77dkstTfxs+rVU4htvlh1UPXC8Y0mnlT5qX/ OKPR8FWiZqhTnHJOj7ddytAY12tRymJg9ro51CWkNmGtn5suXgni0w7kzYeMdV9PhIVi BmdtWkN2OYE1lAaBQKqkH8eRTS2eRXXGUuanObi9bOoCKQ8nY+CU52d25GVqHOX4uA3f 4pTA9ZL/RHgGdsJkIO2USmBu4/CrK+5d2eArp1Z1YL+RYQsfmleMo/pNTi9dAy9lx00k TswA== X-Gm-Message-State: AOJu0YxoYf+8LKl8csR0RwU+vsODipMZygJOsFTtUpb5aPPcBhYuiZtV i9gZSulMkUSw7pU5y7SmJdFbk0Qs3xL/fSmmekaQjAMbqrsqLQ== X-Google-Smtp-Source: AGHT+IH2udjOayg9wsn1hf/MPy7Ug3e6Y+xwtdbYE7qqY3KfmK/B8+d1ZT6Zlz2SpgwXAnLwbXd0qg== X-Received: by 2002:a17:902:e74e:b0:1d5:63c5:e17a with SMTP id p14-20020a170902e74e00b001d563c5e17amr10460113plf.43.1705430593009; Tue, 16 Jan 2024 10:43:13 -0800 (PST) Received: from hermes.lan (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id m8-20020a1709026bc800b001d60a70809bsm379238plt.168.2024.01.16.10.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 10:43:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , ivan.malov@oktetlabs.ru, Tyler Retzlaff , Andrew Rybchenko , Ivan Malov Subject: [PATCH v3 2/5] net/sfc: fix non-constant expression in RTE_BUILD_BUG_ON() Date: Tue, 16 Jan 2024 10:41:12 -0800 Message-ID: <20240116184307.162882-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116184307.162882-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20240116184307.162882-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 The macro RTE_MIN has some hidden assignments to provide type safety which means the statement can not be fully evaluated in first pass of compiler. Replace RTE_MIN() with equivalent macro. This will cause errors from checkpatch about multiple evaluations of same expression in macro but it is ok in this case. Fixes: 4f936666d790 ("net/sfc: support TSO for EF100 native datapath") Cc: ivan.malov@oktetlabs.ru Signed-off-by: Stephen Hemminger Acked-by: Tyler Retzlaff --- drivers/net/sfc/sfc_ef100_tx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/sfc/sfc_ef100_tx.c b/drivers/net/sfc/sfc_ef100_tx.c index 1b6374775f07..f4bcadc1e8e0 100644 --- a/drivers/net/sfc/sfc_ef100_tx.c +++ b/drivers/net/sfc/sfc_ef100_tx.c @@ -26,6 +26,10 @@ #include "sfc_ef100.h" #include "sfc_nic_dma_dp.h" +#ifndef MIN +/* not typesafe but is a constant */ +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif #define sfc_ef100_tx_err(_txq, ...) \ SFC_DP_LOG(SFC_KVARG_DATAPATH_EF100, ERR, &(_txq)->dp.dpq, __VA_ARGS__) @@ -563,8 +567,7 @@ sfc_ef100_tx_pkt_descs_max(const struct rte_mbuf *m) * (split into many Tx descriptors). */ RTE_BUILD_BUG_ON(SFC_EF100_TX_SEND_DESC_LEN_MAX < - RTE_MIN((unsigned int)EFX_MAC_PDU_MAX, - SFC_MBUF_SEG_LEN_MAX)); + MIN((unsigned int)EFX_MAC_PDU_MAX, SFC_MBUF_SEG_LEN_MAX)); } if (m->ol_flags & sfc_dp_mport_override) { -- 2.43.0