From patchwork Mon Jul 20 10:19:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 74486 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7879A0540; Mon, 20 Jul 2020 12:19:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AEB7D1023; Mon, 20 Jul 2020 12:19:25 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id C7DFA255 for ; Mon, 20 Jul 2020 12:19:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595240363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tYQpqWJuTITdpYTdSju+OhB19KQjvln29X/ijCDExvs=; b=g4LpFaHohiFos7J2NiEKgmG+Fi3uLSlrmPuRXg/Lv4F36D7yQFczvMa8TZLHAqZ5gKiNtd fWQnqdW8noAUv4npMGqJsJFJNGVEpsx5ZmOnCxmMb12Ur0Ha0mVi0lx9H3/48BJbXBPGGS QVYLVi+lq11+rBSwPZkZtjAreFXCMNs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-MDttjx9xPda1pFtCqvLyow-1; Mon, 20 Jul 2020 06:19:21 -0400 X-MC-Unique: MDttjx9xPda1pFtCqvLyow-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6D668005B0; Mon, 20 Jul 2020 10:19:20 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 113487852C; Mon, 20 Jul 2020 10:19:16 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: david.marchand@redhat.com, l.wojciechow@partner.samsung.com, Kevin Traynor Date: Mon, 20 Jul 2020 11:19:08 +0100 Message-Id: <20200720101908.12500-1-ktraynor@redhat.com> In-Reply-To: <20200720101739.12427-1-ktraynor@redhat.com> References: <20200720101739.12427-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2] test/eal: check invalid cpu value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When using --lcores option, there is a limit of CPU_SETSIZE. Currently that allows 0..1023 on Linux. Check it is caught when this limit is exceeded. Signed-off-by: Kevin Traynor Acked-by: Lukasz Wojciechowski --- app/test/test_eal_flags.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 4ee809e3d..b019656b2 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -528,4 +528,7 @@ test_missing_c_flag(void) "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; + /* check an invalid cpu value >= CPU_SETSIZE */ + const char * const argv30[] = { prgname, prefix, mp_flag, + "--lcores", "3@" RTE_STR(CPU_SETSIZE) }; if (launch_proc(argv2) != 0) { @@ -577,5 +580,5 @@ test_missing_c_flag(void) launch_proc(argv24) == 0 || launch_proc(argv25) == 0 || launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || - launch_proc(argv28) == 0) { + launch_proc(argv28) == 0 || launch_proc(argv30) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n");