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 BF93CA0542; Thu, 13 Feb 2020 00:08:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B85E1DB9; Thu, 13 Feb 2020 00:08:23 +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 472C1DE3 for ; Thu, 13 Feb 2020 00:08:21 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id 70so1988957pgf.8 for ; Wed, 12 Feb 2020 15:08:21 -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:mime-version :content-transfer-encoding; bh=zMgYz9fOZGYPeiTO5Nhv6lZjERl3hFMDlQGJHubYPaw=; b=KpQXp286jGnsYURQpbnKmkj4pwRxuHvo13zPuLlCd1JG7JcFCBSBcJIdOcqUCA0COw Ws4Yb5jKD35Ocw3+Q/9r6+pLeJ7DonU2fnip9GIa04MOD1n4nDBaI4j41dj5NgsqaVFV efJorrjLZxXMd2rFOrWL58V+VdTseQiCxHaaReO2PQThC6Ypm5cmzEr9cV89kHQrKkDO gWocu4F8bfY/viRkli7B2v5a1rzSkJiGP0ueAS22azuh2NejXHYjzEB50KH0aOMf3aFl 7I7BevVtc4MJQ4Iqt9q95V2JMB9GaisQwkP2pfdjQkOa4pLAHXXEWoQSc32/hgpz3HPU 9qlQ== 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:mime-version :content-transfer-encoding; bh=zMgYz9fOZGYPeiTO5Nhv6lZjERl3hFMDlQGJHubYPaw=; b=WHVHtRVPh5jueUCu69Lmtrcbkg373vwxhv1xDdRIbdijBTPB9qT82B4t4CfOEHuRyU ByiTQexX59l4XCVB4WiP5Wz6L5Y4bfGMvZoE5z9MiG6c88nwCEfSHmGefltjYPwEJkfp tWpdrjpB4op/kfxbO6KeM9MmcIBg19K+hUxEfnmD9QjXlI45xSTd7F+jqyVdrRqabPaz HDxc8hIEzcFIIyTQiDxMiNrzsgj4kp0ZmGTq/QMQHn6nnulOuMEJ3QXI3BpCOwiBnPwO 0bvjTkby0VTcDSDCRVSX9iKGw6Q0/9gsy7GRtA2+J694U9LQt9aYTe+P6O+WRnW/0kT5 4G5w== X-Gm-Message-State: APjAAAUB2SzPHzgOqFphRcgNv17xjnypoRMAB6CTHvbvXZ6piSL0oCjK /MXdXZHEEMT24atDsEJKfnfmzWIIEMQ= X-Google-Smtp-Source: APXvYqybe97kWmALiIJJ8UXGnzepk7BPKSdGyW6+48uNFgNPOk+BD2HbqtZaeKdNv7C9kJdAV0Kn6w== X-Received: by 2002:a63:fe43:: with SMTP id x3mr11551257pgj.119.1581548899641; Wed, 12 Feb 2020 15:08:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 15:08:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 12 Feb 2020 15:08:06 -0800 Message-Id: <20200212230810.2837-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC 0/4] Enforce flag checking in API's 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" Since the DPDK api's are lazy about checking for flag values it means the flags can never be extended in future releases without causing ABI breakage. This means we end up doing unnecessary symbol versioning just to work around applications that might pass in naughty bits. This is the DPDK analog of the Linux kernel openat() problem. Openat api was added but since kernel did not check flags it ended up that another syscall openat2() was necessary before the flags could be used. Stephen Hemminger (4): ring: future proof flag settings hash: check flags on creation stack: check flags on creation cfgfile: check flags value lib/librte_cfgfile/rte_cfgfile.c | 4 ++++ lib/librte_hash/rte_cuckoo_hash.c | 9 +++++++++ lib/librte_ring/rte_ring.c | 7 +++++++ lib/librte_stack/rte_stack.c | 5 +++++ 4 files changed, 25 insertions(+) -- 2.20.1