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 9B0FDA00C2; Fri, 24 Apr 2020 19:16:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DDC601D440; Fri, 24 Apr 2020 19:15:54 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 850E41D447 for ; Fri, 24 Apr 2020 19:15:49 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id k18so3963497pll.6 for ; Fri, 24 Apr 2020 10:15:49 -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=QJjUu9lU9z257+aNM+N0wkTgROAoOGyqjwBD7dhmRj/CFttSV/pxIviE8fmC4hlaxi TBohZh4yHT3DbTVKCJKdPoKAE+wepTdl+WSYkKYuVoFrp9MxvVxPt6ndUmHIPnNQNrxD 01NT01ISVHheUm8tkBN9qhlPZ7PdJsAxO0c35j7U1WVf9ICgV/CIcsc2WNWUaAUv4qa7 O+Dgid/4azrIA3wsqxDQli8ev9HmEzfiJh7QyXyO37SoCO/wrF6tGgpoY55sCPi4SaW6 rsLP0USb+844Ho3kbgBjFSyQb4t04EIml7XOrK6tYHZimIpulKmepMkIA5FodILLM2jP f0dQ== 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=kfO/zJA/hDWZD9K8Jj2yFkY9T204dLUr2kIaZ8eZl6XUNmiGL3BTULEw7w+ms9QNWA /Ou48egTiOjAdVu2+uEl7XgCapc8yqgAu2smwi6l+QRRpBaFRXVY53J13hggoXTbTcfh 9gSmu67cCfxf3mrGMq24hKS0GiUhRZZGwwarN7ALuTIZ3rWxRTuaQABQJDiHDaCI/y5x jcm0+VAUtLkOwGkSo8FTgOWuGZuTPyvpAsQfA+hCtl3FfVMRa0L+guFPCfdtGpsRLy2m wCaB5Df58O8XERfPit/nlbbYhdhj6JIJhah3wNVzXBSxvcDhAy4iCt1yKYpCksUJ5i6z /0Ng== X-Gm-Message-State: AGi0PuZgTqq3GgFkcoBHh40fkcGAyW1LAf9Fv5u0mFw1oJfmFpDxpHQC qFXyt5KzsUU6oZhULmJEPk+zdoIo5vo= X-Google-Smtp-Source: APiQypKLeZQ3cwYDLHE6JT5lC41AywPX6gtPPIQcVspJ0v+QrBUfx9qFHi1d/xNRu8QW7VPMRvKWmA== X-Received: by 2002:a17:902:8e84:: with SMTP id bg4mr9673241plb.50.1587748548292; Fri, 24 Apr 2020 10:15:48 -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 w3sm6153245pfn.115.2020.04.24.10.15.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 10:15:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 24 Apr 2020 10:15:35 -0700 Message-Id: <20200424171536.11535-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424171536.11535-1-stephen@networkplumber.org> References: <20200212230810.2837-1-stephen@networkplumber.org> <20200424171536.11535-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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