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 8774B43A37; Thu, 1 Feb 2024 12:13:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5041F40299; Thu, 1 Feb 2024 12:13:45 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BBFAA4021D for ; Thu, 1 Feb 2024 12:13:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706786023; 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=1WS6YY5D9C4lRXPqoPX69ulyludtm35hRIBuIR0l3zY=; b=DQBCoQIW6jPNP9awa+GyG6rhQQNgtR3Jw0GjeTiIM8irpIzf1sVitcz/VoCLPWjHImCXL4 NbYSHWtJMEEBgm1wyYUdpdi/UTWP5GD+CFufaz6xZic7iu9xXIQI/BIGv2crs2ZL0tjT6M ILTvpKuqu9R+ic0/XRfbtYfzdFkBsRA= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-301-bBWC6zmwMf2U7zzjhAClKw-1; Thu, 01 Feb 2024 06:13:42 -0500 X-MC-Unique: bBWC6zmwMf2U7zzjhAClKw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-510254e6163so726646e87.2 for ; Thu, 01 Feb 2024 03:13:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706786020; x=1707390820; 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=1WS6YY5D9C4lRXPqoPX69ulyludtm35hRIBuIR0l3zY=; b=tZYQLcD2ErTVZ4CmpTRVYsuAZW7A2byS5z/q8U+KlpUuXBW1KSi1jkjSBnrfsyiSg/ uSTcxFvesoI5qQd4Gj6wl0XGjuxl7cRlOdVqophddz8ku7pmOHOm0R0l2yGcdvVmsQrx gyl/BEJzFIB1QbJYDVaFXF/XRlp6oe0QVRvfEtRZXP4nbntS+eekUH0O7icQVcafUp7B mixjosrCi5PPtABBo2nzBphUpv8F6DuYTyD/p4t2xxfcOSzZBZTMN3IdKV0B1SgqpGGu LW8RoDABrfmRb/N4sjWgsRHaSiIR7eIKprF/Ah/He+TpKIYf7RcnsE4gnO1HqZV4RU+d iFCA== X-Gm-Message-State: AOJu0YyM206QWTiPV4KH3cOq0zZV60mmJ4YoPi67QsmLnXsmQEyJ9i2O eC5Poa7EJYNtmq/uKpf+RvTWk08B+pr2g6zrIesTbsnYiAulHiSxxNtwy5Lpd9FnzWeWzbq2I6Z zMdaMXSvNFATR1ZFTwB/c4NEAdt5FEBeJbB/W73VWwIND6pivqCXn+2SrvOn7gM6VetaTCT6fqy E8e9EGTwB5+4nDh9o= X-Received: by 2002:ac2:551c:0:b0:510:2582:5591 with SMTP id j28-20020ac2551c000000b0051025825591mr1277627lfk.25.1706786020763; Thu, 01 Feb 2024 03:13:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1mE64jHer/BgfXlxAaWI3xHg3r+7QCimftI2oRAGAGre0lsdvY9jvtM5DGIXGde3EywrochT1aaF3L6aHun4= X-Received: by 2002:ac2:551c:0:b0:510:2582:5591 with SMTP id j28-20020ac2551c000000b0051025825591mr1277614lfk.25.1706786020337; Thu, 01 Feb 2024 03:13:40 -0800 (PST) MIME-Version: 1.0 References: <20231113104550.2138654-1-haijie1@huawei.com> <20231113170928.GD13153@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20231114173248.GA23774@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20231114173433.GB23774@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20231114174916.GD23774@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <1e636881-c543-b23b-4f75-499b175db058@huawei.com> <98CBD80474FA8B44BF855DF32C47DC35E9F027@smartserver.smartshare.dk> <20231115070803.73846b03@hermes.local> In-Reply-To: From: David Marchand Date: Thu, 1 Feb 2024 12:13:29 +0100 Message-ID: Subject: Re: [PATCH 00/21] replace strtok with strtok_r To: Jie Hai , Stephen Hemminger , Tyler Retzlaff Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , fengchengwen , dev@dpdk.org, lihuisong@huawei.com 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 Tue, Nov 21, 2023 at 4:33=E2=80=AFAM Jie Hai wrote: > > On 2023/11/15 23:08, Stephen Hemminger wrote: > > On Wed, 15 Nov 2023 12:27:37 +0100 > > Morten Br=C3=B8rup wrote: > > > >>>> just a final follow up, i can see that we already have a rte_strerro= r > >>>> here to do the replace with reentrant dance. it is probably good to > >>>> follow the already established pattern for this and have a > >>> rte_strtok. > >>> > >>> +1 for have rte_strtok which could cover different platform. > >> > >> +1 to rte_strtok doing the reentrant dance for us. > >> > >> If we had such an rte_strtok(), we could also generally disallow the u= se of strtok(). > > > > Good idea, I like this. > > Would be good to have a version on Windows as well. > > > > . > Hi, all maintainers, > > Since the map of strtok_r to strtok_s with three patramaters has > been done in "rte_os_shim.h", I just include this file. > And the rte_strtok is defined as below. > My question is whether the > "strtok_s(s, stringlen, delim, save_ptr)" and > "strtok_s(str, delim, saveptr)" are compatible for C11. > > And I check the glibc codes here, > https://sourceware.org/git/glibc.git > there is no definition of strtok_s, is strtok_s not in use? > > If so, should we delayed processing for the C11 standard strtok_s > function? That is, delete the "#ifdef __STDC_LIB_EXT1__... > #endif" part, but keep the extension of the four parameters for later > use. Or keep the following change but never use stringlen as not null > until the function can be used. > > What do you think? Regardless of how it is done internally, I would not inline this helper. This will minimise headaches with checks against toolchain/compiler support in a DPDK header. --=20 David Marchand