From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A63EBA00BE; Tue, 28 Apr 2020 01:17:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B2C3E1D54A; Tue, 28 Apr 2020 01:16:43 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id 8E0351D529 for ; Tue, 28 Apr 2020 01:16:39 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id fu13so281960pjb.5 for ; Mon, 27 Apr 2020 16:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5zDoPIQZJD4BR+6Ns9o1Oli/kD0TyZk6fTRGDLaM0dc=; b=WD0u7zGmitRyDG9Ua8BVkkoLZVln9dLhraXdWHnooVdq0jafau57lCA+tQm79xNAHw RxLJWLgItmTBU1Vt2gVFZjJXztNn33lf6YU07PNUSzkxjGbb6IQPqekxCUVodLv6zAeV RBstK3FutqzcLs+T3pOZ19v3y0cwq7JRGKah3sPZCgRsEa4J44u0ooE+9O3f10QjPxbW /oqSQkTiXv1Mx31AddpNsZpdYQT79BBrE9Jccz8Dw6ECvTFiKSE3Clfp+Zx6up+kuVqK BjxVb0rPD1tFCVt7koWK/JEOh9NsRLVtiIavAPnjGT7wnBgvlrm9mctKXZfBjwPXC0OL eDag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5zDoPIQZJD4BR+6Ns9o1Oli/kD0TyZk6fTRGDLaM0dc=; b=SJKStm1xILtJWkXKMnt6P2dXL1XqiyXQG5tgtDEGtQImuzF+mOGzn7T3xD53H20hyN sYPVN+QMTO2Ee19iDoa6R75Zy56jiv+6M89EZxDwdgVVb7ET6kTwNjw19VmFUzGwkmdj tHaPDF2iGs7cuR3heUx/qjIFMmkNE95SSmDvGypsR2VVdJLuimIz48yZbnbvyFCfn/3d pfDXE4J101o3uvUeegPkHm9usry9Hxw9308owclf6uljc7d1CqmxPe/y4s2xdEQEGd+C Ajqn0A2PCYqEJ5WjsDwp41ez5uGIuy/39WhveG/qjClXTd+Ao5yKrFR0Q7SLppK+rlGz zTTw== X-Gm-Message-State: AGi0PubYVeo5W4kdr3Zm3PXC2b/BtvfvtdRBHhAkoqhm4/cKpnFyfyf1 DSm5LGQf1+NHAXORtx/ZZXN9xEQoKzw= X-Google-Smtp-Source: APiQypJ3hIB9N0azj7YIGfxuEygGbhTbInPRRlPIniZDI+8uE3PplUT737vElXmlT+AdD+Z8tvewlA== X-Received: by 2002:a17:90a:3aef:: with SMTP id b102mr1266190pjc.177.1588029398168; Mon, 27 Apr 2020 16:16:38 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id kb10sm353104pjb.6.2020.04.27.16.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 16:16:37 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Gage Eads , Olivier Matz Date: Mon, 27 Apr 2020 16:16:24 -0700 Message-Id: <20200427231625.10135-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200427231625.10135-1-stephen@networkplumber.org> References: <20200212230810.2837-1-stephen@networkplumber.org> <20200427231625.10135-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 3/4] stack: check flags on creation 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" All API's should check that they support the flag values passed. If an application passes an invalid flag it could cause problems in later ABI. Signed-off-by: Stephen Hemminger --- lib/librte_stack/rte_stack.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_stack/rte_stack.c b/lib/librte_stack/rte_stack.c index d19824f00439..e58fa545fca4 100644 --- a/lib/librte_stack/rte_stack.c +++ b/lib/librte_stack/rte_stack.c @@ -59,6 +59,11 @@ rte_stack_create(const char *name, unsigned int count, int socket_id, unsigned int sz; int ret; + if (flags & ~(RTE_STACK_F_LF)) { + STACK_LOG_ERR("Unsupported stack flags %#x\n", flags); + return NULL; + } + #ifdef RTE_ARCH_64 RTE_BUILD_BUG_ON(sizeof(struct rte_stack_lf_head) != 16); #else -- 2.20.1