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 2333CA0542; Thu, 13 Feb 2020 00:08:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 456791BFA0; Thu, 13 Feb 2020 00:08:29 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 5385F1BE94 for ; Thu, 13 Feb 2020 00:08:25 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id j15so1996941pgm.6 for ; Wed, 12 Feb 2020 15:08:25 -0800 (PST) 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=2HjE9Fdln2VqbWx5zdMwbDOEwGuLxlBznt/D/+mv+9U=; b=wElqKNNUKsio7pZ8X5OhP9iXIT7WVT+MI13bpz+BcsbFA2a9J7AI1Mb7QsVbmcaduG 0E00veLhnC2+rNRTTZkGq7bJMJXZavp14qFcopniHW+2bqnsCVH8Y1uJ0iYLpxygtGZK ylD3TF4tmxochgX4WuuPwyxmfSoqf85m6aKo5vPVOQXh+Aamcf5/5jp+AjX6Cchc9hxi qWmPk++bJtTlXUipZllG6RZTMTr1T6C6B5qeHjS0Yphhk1wd8zNmPpTWx8P5ZbdPZV/E jBqhBtn/5kThbZtz2vEAn6ZFjWZw+lf9gANVS/pfrRw6FOPmvH48C17Xyoy1S2VXdT98 3H3A== 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=2HjE9Fdln2VqbWx5zdMwbDOEwGuLxlBznt/D/+mv+9U=; b=s9Ja7q+lTZ5loMvF6DXs7o973ZSpcQZWmrfni0vdlBlyS0tjpwkf66xiTYKjgNCx4g aSdPBFZSWAAibbBYb3MiNHEhVnJackC7I2QrNt3QIgodujjcf6I0GS2RQpv4HzxrDF0Y EHHeM+q9HF9CdVe91U1C9Ea4/1sqALPiLz9qw8KmQbKxzrKRMR9AIMa4LIWt6q7o8uJM JpStrAWsj3k0ShO4MKQnR9bIIPa1UvFsNrnV7EvmH3VdjM6Mpt2ebm95n4dDq/d/vXO3 jm3Dw9txJUanewUpk5Fcfhm1FOKboBUvhhpPLTPtVq/OPvCb12f8Pvq0HtEpMSvesPFD u0tg== X-Gm-Message-State: APjAAAWZp7ypYraBsTf2H5VWi62ImA5PLgBUWWAZBGZgYk65l/GPMEMZ zpjDioAExMELvDTciYA0k1iVFeWpKsw= X-Google-Smtp-Source: APXvYqymi8eyEthUl0Q0+NiSuy4P6OinDCr768nwl7/ssneB9DnFduEJCFbjiahw0zvDWnOIB9B9Kw== X-Received: by 2002:aa7:8bda:: with SMTP id s26mr10964829pfd.194.1581548903971; Wed, 12 Feb 2020 15:08:23 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f18sm198301pgn.2.2020.02.12.15.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 15:08:22 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 12 Feb 2020 15:08:09 -0800 Message-Id: <20200212230810.2837-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200212230810.2837-1-stephen@networkplumber.org> References: <20200212230810.2837-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC 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..4b09ff30d6bd 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