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 6515C4331D; Mon, 13 Nov 2023 18:06:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E5614026C; Mon, 13 Nov 2023 18:06:21 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 56D4F4067B for ; Mon, 13 Nov 2023 18:06:18 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1cc1ee2d8dfso41702945ad.3 for ; Mon, 13 Nov 2023 09:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699895177; x=1700499977; 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=Xfltq0FDtOzHtfnt35/mKLL5OageXwa8xNlYP8AehBI=; b=Nz9YNrYa8EXiezfzSOFOZokKImXrBH/njwijtw01aHjbFXlzFHyLlUGUVjnpal63M6 G0hV81yhB9xQ+B+uVjQB0QMxCQtB6kaBADM6MCkIjAPCJwjsbwhSNjHZKbAgrIWNSuHS 1KyrXp4CRJylN1kui5CavAZtxFUfH2CjZfPHx+YQZ+Fl++zRXPejV5Wr7u6guBp2dM9l yRdDgRleynD/b9BiOuyjegJRUK1+cdTVNfKOwY5gK6ipV8G++Y16saOnlcoPfZ13GRZ/ 3loVRO/4SbBCMHvcUmAi8bWEkSCH8AwpgK2TDUGzgelJmcWxfE/Nrsxq1UEUeoPU38sw t+aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699895177; x=1700499977; 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=Xfltq0FDtOzHtfnt35/mKLL5OageXwa8xNlYP8AehBI=; b=E0Q+09RnfzW29dJkXImYD3ub13vyoBaRxrW3pjzMNHeBMZzMxt6jS8qrXWwLu3UIHs y+6HGPacl3i/sgFt0B7/xUlZ0Apr9y17jUAlNWjjbhHqspxu6S0YJSm8ns8hO32RGpIV KyAOjg4zm/bi6f5A8GoYWXQn355F0nJ3pzrAqc1NgvbDf4iEUNg4J8qA47iPDJ+ULTcJ pVFkyn2uvdKIKliV4OzaaX0bRtbudug3RzvnSUlKsB/g0e7S3I/wEQxVlbx0emDgHUtx PlTEbB1XOqd2yMpbE4X1lKYsjG94TNrzTYq1P1f/jFdRn2fDdw7DemUrxyksFWQ8WS7E o5Ww== X-Gm-Message-State: AOJu0YzehMBi5ZwpWAhnQQ4kvG7fFFeoAdIDvjyeG2h7sBSo9CBRLE4D tF4a92umKlUH3He/i+AkNYBC/5/c0j8wwKL6hVo= X-Google-Smtp-Source: AGHT+IG0zMNkJprhj3y45r8npuncGBMZLjwVnZ0HwTa6TC99QmhMq7oLP4dlC4W0spf4XtqsBPTT/g== X-Received: by 2002:a17:902:e84f:b0:1cc:c243:1cb8 with SMTP id t15-20020a170902e84f00b001ccc2431cb8mr148929plg.43.1699895177185; Mon, 13 Nov 2023 09:06:17 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l4-20020a170902eb0400b001c61901ed2esm4232051plb.219.2023.11.13.09.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:06:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , ivan.malov@oktetlabs.ru, Andrew Rybchenko , Ivan Malov Subject: [PATCH v2 2/3] net/sfc: fix non-constant expression inr RTE_BUILD_BUG_ON() Date: Mon, 13 Nov 2023 09:06:04 -0800 Message-Id: <20231113170605.408281-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231113170605.408281-1-stephen@networkplumber.org> References: <20231111172153.57461-1-stephen@networkplumber.org> <20231113170605.408281-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 evaluted 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 --- 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.39.2