From patchwork Fri Jun 12 12:09:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 71354 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 8F8E6A00BE; Fri, 12 Jun 2020 14:10:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8291FF12; Fri, 12 Jun 2020 14:10:22 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id C741DDE0 for ; Fri, 12 Jun 2020 14:10:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591963820; 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; bh=Di8uUPDljKjrkqnb0s+lKr6QR7yU95c9yz2i+OS/rx4=; b=A8qKGX+/P6YmVGUcZKcvQRoSO7uBPl7e/dLd9iWZ6TMeuwYcSTldsj5BAW7NgMjCDGQ3CJ pGYGvnz0jT1PHf1QZs3Wlp/C/i0smynznNrt0dROV/GHMg6AegDRDb5plklGlR0p0OvKl8 WVbOYGWPDp23+enfe0IC5MCIOXYvvng= 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-179-jNvLihttNR6GOLvDKgKzIw-1; Fri, 12 Jun 2020 08:10:10 -0400 X-MC-Unique: jNvLihttNR6GOLvDKgKzIw-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 04E838018A7 for ; Fri, 12 Jun 2020 12:10:09 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 685359CA0; Fri, 12 Jun 2020 12:10:05 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: david.marchand@redhat.com, Kevin Traynor Date: Fri, 12 Jun 2020 13:09:59 +0100 Message-Id: <20200612120959.25626-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] 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, CPU_SETSIZE allows a range of 0-1023. Check it is not being exceeded. Signed-off-by: Kevin Traynor --- app/test/test_eal_flags.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 4ee809e3d..044cc1c59 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@1024" }; if (launch_proc(argv2) != 0) { @@ -577,5 +580,6 @@ 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");