From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F0C245584; Thu, 4 Jul 2024 23:36:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 391B142F7B; Thu, 4 Jul 2024 23:36:51 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 3931940DCD for ; Thu, 4 Jul 2024 23:36:50 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-70b07bdbfbcso341646b3a.0 for ; Thu, 04 Jul 2024 14:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1720129009; x=1720733809; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hcC7Sj75sWIX1hmEdgaIds/jP9STGEPwV4+6mxvJZV0=; b=T/TIjU7oiPs13W0AxyiKGtymoX6yyaH0vYc4T/dLkPimfqeu0Y+ldEmQ7XtdV88UFs HJpkN9NQhbxJcm0Q2UIppwjYxNyEqikRIE/q39iA9OgaTCLCEHxt3Bnvye9sruxKBsqt hnsHlvkxNp8gyIhtTJ75zmcJEm0vp5twVnA6zF+Nrj9Jo3xVDumDg3LeYYu1DdGGldzr aMTfvLeevVvU/trS4gz8Mb5zF7DI/73ciB1wyWUJ0JR3cnRUMGlOI6o+FLKTRU2BxKdH YGiLxLdLchElau0bbhUlqHjCnqFS3XowXz9+Dy6lOtglCoVSV10du3qKtiHU9R5uUYP5 VaCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720129009; x=1720733809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hcC7Sj75sWIX1hmEdgaIds/jP9STGEPwV4+6mxvJZV0=; b=sm06IHZ6j+jaPK8iO1/kwf1wBPY+eCZkKJuJ+Kt6nP8z8d0dvpxwKrb7L9Hcn526aX 62tsnIS21Fs8HjYnT2tmYWePrNBMMPYFYGa/WFi5WFfHPFxEoCntM04cYxQn741QAniQ Ou+F3hClNwkfaha+cISLuivkVfp8NoSHat060qQ4Pyz8iLOEEBgOxXH8ldqEWijFztXb J5nrQCI+SDDBdHd5ksnrUO/qfOwkobxU1c11M1UOSJWYS8H3V2YuSPD1LVmaoM9Im5NV dO5Nb8G6prgFUU/Mum17odS/eIiLbWTfjTFt/PRceJnQrm5BdnEBttauBlMjgVe3x+Y/ LWTg== X-Forwarded-Encrypted: i=1; AJvYcCX/98smp6FKFhxOXlq0MCNHFdQfjptjPVnbKu4lpFmgyh7K7pzPOTPOegKFlIs5xbq+sN4tkn7XDCjD8Fo= X-Gm-Message-State: AOJu0Yw1wLyyhzPS0kEyPxmnNjaJBmaDxKILUweNkIKMYHnXAt42AN22 Kr/MVzuaRNvGf4u3HdbIYR2J4hHl7dsugz9WmOxAer/iFh6zQQOKDdeKd9gjhao= X-Google-Smtp-Source: AGHT+IG4Tmhxqc4oqpaK36+wjC27IV21gF+H+Go++RHXnxyXgbocIGqb0hTpwy0s4y6uixxKzrj07A== X-Received: by 2002:a17:902:ec90:b0:1f7:1d71:25aa with SMTP id d9443c01a7336-1fb3701641cmr38388145ad.6.1720129009152; Thu, 04 Jul 2024 14:36:49 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac2f03acdsm127262815ad.302.2024.07.04.14.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 14:36:49 -0700 (PDT) Date: Thu, 4 Jul 2024 14:36:46 -0700 From: Stephen Hemminger To: Chengwen Feng Cc: , , Subject: Re: [PATCH 4/4] cfgfile: add unique name flag Message-ID: <20240704143646.1f19b480@hermes.local> In-Reply-To: <20240220035840.32978-5-fengchengwen@huawei.com> References: <20240220035840.32978-1-fengchengwen@huawei.com> <20240220035840.32978-5-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 20 Feb 2024 03:58:40 +0000 Chengwen Feng wrote: > The cfgfile supports duplicate section name and entry name when parsing > config file, which may confused and hard to debug when accidentally set > duplicate name. > > So add unique name flag, it will treat as error if encounter duplicate > section name or entry name. > > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng https://en.wikipedia.org/wiki/INI_file Interpretation of multiple section declarations with the same name also varies. In some implementations, duplicate sections simply merge their properties, as if they occurred contiguously. Others may abort, or ignore some aspect of the INI file. The standard reference for INI file parsing on Linux is the Python configparser https://docs.python.org/3/library/configparser.html strict, default value: True When set to True, the parser will not allow for any section or option duplicates while reading from a single source (using read_file(), read_string() or read_dict()). It is recommended to use strict parsers in new applications. The problem I see is that cfgfile allows duplicates on names, and sections. Perhaps there should be a new strict flag for this.