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 221B1A0093; Fri, 10 Dec 2021 10:24:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 930FB4014F; Fri, 10 Dec 2021 10:24:03 +0100 (CET) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mails.dpdk.org (Postfix) with ESMTP id 5BE8240041 for ; Fri, 10 Dec 2021 10:24:02 +0100 (CET) Received: by mail-lj1-f173.google.com with SMTP id 207so12792060ljf.10 for ; Fri, 10 Dec 2021 01:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y9y+P+2BhrELG1p9XVwYONu4yEpQ3m4J0XTJrSbfnCc=; b=eVUlu3ok+8gpU+M7xpqYstsZvDXDFORciZ5YAQfgtlxwnq2y9l//mAth8/nB1leIqP BuqF4os/CR7OO7NVSw03a3uSYbiVTOn3yEIOqyzCeMW3wKRGyYcjA0G77Klam9iP8dLD 5vcB0Hpq9WXMIg62vmZraACMei7aStSO7EOxlOfuvmaXkI8uu8mA9o4dgw/jshdFbpgu 2rCLp3dw8RMOKxSU9t+DmErKlKrkF8vHWSepEOqMUfl2YBO8dTvxn5J/hWfV5Z7Ig4Lx TvGpQms8NnJ5dQqNbgJk/XwZSi3pwIvqdbEaJ1eCjhq0Kljqnu3aO5OUq7ga6FkqfA1u dMFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y9y+P+2BhrELG1p9XVwYONu4yEpQ3m4J0XTJrSbfnCc=; b=uwIYgCZrEshlumqQi3ZabTj7oTLyCmsJUPVMQflJRH65sFS6NJ1CIaYk8AQXH28SPm UzWIPMc0H4qmGCTL+9wKVdpq2GkWFMoPMTNhoPB4SemYP5zfmEJgvvwfHFdXNiyaUeUK QCyRN9Dn0cXO0moNpJBNHqFY2FdJYJeOAPVLvhnszxZRhUnlAYFsLXXcofPGgwsRytjX 3WUzR3Mjt41T3+d/qk+gs/3s++eRf/p7cCpTTE662ra7hluDYyOChuKGhkVYgNLpXUai L96H+NEI0EI34573G1QYBM2khzPSrZl1DO/X6llSv3hPtqh8VxEC+1cBEF6WJrkuEqXe Vijg== X-Gm-Message-State: AOAM533SeWuFygRQ9kxjlww/MkzZ1JsOi1IRg0R+1Mvr5ugvcQry02X0 Md6O5Oxy8LLpc9CkDCwP1Vo= X-Google-Smtp-Source: ABdhPJw3sXVpO8uPw0dDDVkDGRC/i976jkydlXBf2T23EIH/Rx2+2HWQhM9ctH4/53u0bqklshY/FA== X-Received: by 2002:a2e:9608:: with SMTP id v8mr11995986ljh.392.1639128240806; Fri, 10 Dec 2021 01:24:00 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id s10sm247924ljd.75.2021.12.10.01.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 01:24:00 -0800 (PST) Date: Fri, 10 Dec 2021 12:23:59 +0300 From: Dmitry Kozlyuk To: Bruce Richardson Cc: Aaron Conole , Jerin Jacob , Jie Zhou , dpdk-dev , roretzla@microsoft.com, Narcisa Ana Maria Vasile , "Dmitry Malloy (MESHCHANINOV)" , Pallavi Kadam , talshn@nvidia.com, Thomas Monjalon Subject: Re: [PATCH v14 04/11] app/test: skip interrupt tests on Windows Message-ID: <20211210122359.17a1be53@sovereign> In-Reply-To: References: <1638928262-13177-1-git-send-email-jizh@linux.microsoft.com> <1638990000-3228-1-git-send-email-jizh@linux.microsoft.com> <1638990000-3228-5-git-send-email-jizh@linux.microsoft.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 2021-12-09 16:39 (UTC+0000), Bruce Richardson: > On Thu, Dec 09, 2021 at 04:17:08PM +0000, Bruce Richardson wrote: > [...] > > I'm wondering if a reasonable compromise solution might be to have the > > build system expose a usable RTE_EXEC_ENV symbol that can be used in C-code > > if statements rather than just in ifdefs. That would allow us to easily add > > e.g. > > > > if (RTE_EXEC_ENV == rte_env_linux) > > return TEST_SKIPPED; > > > > into each test function needing it. Two lines of C-code is a lot easier to > > add and manage than #ifdefs covering the whole file, or alternative lists > > in meson. > > > Quick patch to allow C-code comparisons: > > diff --git a/lib/eal/meson.build b/lib/eal/meson.build > index 1722924f67..b5b9fa14b4 100644 > --- a/lib/eal/meson.build > +++ b/lib/eal/meson.build > @@ -10,6 +10,12 @@ if not is_windows > subdir('unix') > endif > > +exec_envs = {'freebsd': 0, 'linux': 1, 'windows': 2} > +foreach env, id:exec_envs > + dpdk_conf.set('RTE_ENV_' + env.to_upper(), id) > +endforeach > +dpdk_conf.set('RTE_EXEC_ENV', exec_envs[exec_env]) > + > dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1) > subdir(exec_env) > > A slightly simpler patch would just expose the environment as a string as > e.g. "linux", but I think numeric ids just make the code better rather than > having string comparisons. Alternatively, this could also be done via > C-code with ifdefs in EAL, but as it stands this meson change allows: > > if (RTE_EXEC_ENV == RTE_ENV_WINDOWS) > ... > > or: > > switch (RTE_EXEC_ENV) { > case RTE_ENV_LINUX: ... ; break; > case RTE_ENV_FREEBSD: ... ; break; > case RTE_ENV_WINDOWS: ... ; break; > } > > Thoughts? I like this. Even outside of tests more code can be made to compile on all platforms (e.g. ixgbe_wait_for_link_up). Alternative naming: RTE_EXEC_ENV_IS_* (similar to RTE_CC_IS_*), which does not allow switch statements, but shortens most practical cases. Will Coverity understand that if a condition is always false, variables beneath still may be used on another platform?