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 2F66845B13; Fri, 11 Oct 2024 16:13:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B227402A1; Fri, 11 Oct 2024 16:13:33 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 46053402A1 for ; Fri, 11 Oct 2024 16:13:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728656011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2sBeIDexxmwEI/UO5Q9IAn8BGpBabjUPur/QDGyZghk=; b=aR/mwNAfQJHqlaihqILqQ38vk267BT5CcAUlAeBn2RollLXu9X8RINsacKXUPZ/GP0XaLz 13D4FuSNldWihF6r80ACW0Oy3Dq8n0hWXt3Efx2dOIt3v7a5Xkz58jO4BkzSYgEGuo7N8r d1bh0LrUXf3WBuPlrLlXawFf0vyRGas= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-480-5sfbl41cNFGGVs8KtjxV3Q-1; Fri, 11 Oct 2024 10:13:30 -0400 X-MC-Unique: 5sfbl41cNFGGVs8KtjxV3Q-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-536800baa8aso2772707e87.2 for ; Fri, 11 Oct 2024 07:13:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728656009; x=1729260809; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2sBeIDexxmwEI/UO5Q9IAn8BGpBabjUPur/QDGyZghk=; b=WtR7YbJG08FiUnfMGyKwULDPObac1QCva2v1dTSQOKSZvn6MWqYiqQUw4tr+YWlYnR 2BmwZW2U/VDRwi/96vaLBjweupglP/DjMIBJTkgwJbSNYDpSkLNVV+P6MAhdFSI/r6yC DDENUwxLV5eymiJPv2ldzMBGJ43a0ZiWuiHJklhUmqEWMFWqz9d0HyC/rqq9YhnIAC1t ke6yuSWKUY8otqX8hm8bbUwC+zyQwrrS8z2erGVJtih71B45ua9nU+HcL3jEkLjPHmzF N0lkh3gBbhySgiXzOp+hnNy8V5rKe2jjR5mx6DPZg6h9AQTH1v/kpMqPhhEGQvbRdLfD LxuQ== X-Forwarded-Encrypted: i=1; AJvYcCV1FgHDgGc3mk58UTB9thlpy/9ZCJdYjScgdgb0FHT9KhpGVIOKbLl0XdrW2iLYJwmyKo4=@dpdk.org X-Gm-Message-State: AOJu0YyuS6UPn75+E2M9rUKwZ+D09RD5PvY5JoJr+hKWhVJmyIcnjs7v b6xCuhII7MCGzRnC4EtcqGALId7j6eY39u30vv9mjm1w8enu25SXfnnLK+riDuzKhmPlj+8Pvmk KkQTXcU+Gur4xLRFJnAcSTEHpYyA9vVa1GvVBW2tl+6Qtyk421hlgO7Ln7mp23Ue+QFt7KN1BZ+ shuTDjQDsrxEOQWcQ= X-Received: by 2002:a05:6512:660a:b0:539:dbf9:ea30 with SMTP id 2adb3069b0e04-539dbf9ec40mr1054912e87.58.1728656008871; Fri, 11 Oct 2024 07:13:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsHnUDHK8hkxPsQjRBANbviJM/v7J/K6yxmtf1D6wfTmvJZVNzT3IfqloknLAie+vMZ4TcDADKZ/BO31OMxyU= X-Received: by 2002:a05:6512:660a:b0:539:dbf9:ea30 with SMTP id 2adb3069b0e04-539dbf9ec40mr1054891e87.58.1728656008509; Fri, 11 Oct 2024 07:13:28 -0700 (PDT) MIME-Version: 1.0 References: <20230314124813.39521-1-fengchengwen@huawei.com> <20241009045030.26874-1-fengchengwen@huawei.com> In-Reply-To: <20241009045030.26874-1-fengchengwen@huawei.com> From: David Marchand Date: Fri, 11 Oct 2024 16:13:16 +0200 Message-ID: Subject: Re: [PATCH v6 0/4] fix segment fault when parse args To: Chengwen Feng Cc: thomas@monjalon.net, ferruh.yigit@amd.com, dev@dpdk.org, stephen@networkplumber.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Wed, Oct 9, 2024 at 6:50=E2=80=AFAM Chengwen Feng wrote: > > The rte_kvargs_process() was used to parse key-value (e.g. socket_id=3D0)= , > it also supports to parse only-key (e.g. socket_id). But many drivers's > callback can only handle key-value, it will segment fault if handles > only-key. so the patchset [1] was introduced. > > Because the patchset [1] modified too much drivers, therefore: > 1) A new API rte_kvargs_process_opt() was introduced, it inherits the > function of rte_kvargs_process() which could parse both key-value and > only-key. > 2) Constraint the rte_kvargs_process() can only parse key-value. > > [1] https://patches.dpdk.org/project/dpdk/patch/20230320092110.37295-1-fe= ngchengwen@huawei.com/ > > Chengwen Feng (4): > kvargs: add one new process API > net/sfc: use new API to parse kvargs > net/tap: use new API to parse kvargs > common/nfp: use new API to parse kvargs I see Stephen wanted to have a look on the series, but rc1 is close, and I decided to merge it with following comments. I marked the new API as stable from the go. The reason being that it provides the "legacy" behavior of previous rte_kvargs_process function, and as such, some users may have been relying on it. If you think this is wrong, please submit a followup patch. I was surprised of the change in behavior wrt to a NULL kvlist input parameter mixed in the change. But I left it as is. Idem, a followup patch may be sent. Series applied, thanks for fixing this old issue Chengwen. --=20 David Marchand