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 755B143F56; Tue, 30 Apr 2024 22:03:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0262240262; Tue, 30 Apr 2024 22:03:59 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 9FC424025C for ; Tue, 30 Apr 2024 22:03:57 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6e46dcd8feaso3514160b3a.2 for ; Tue, 30 Apr 2024 13:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1714507436; x=1715112236; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Fhm4nMvhZoaogkexnH2HQ8Zkv1duiXDewvxNSdw9Qvc=; b=Rt3g4eZbHjqW9TOTbRymVt/aD7CMROmGDlRFXWxOB7vP4QoRVQ3xL2qXDKesoclSX8 wE0OHG867zKl/wfm4iDVtIx8qmWTzPx/rIs4gji2PpOoeG+Nv11Tv+u8kZBK9ADtsLen 2Gg4M6U13ntTUKkJopu2fO4eJGqnpTIIzAca0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714507436; x=1715112236; 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=Fhm4nMvhZoaogkexnH2HQ8Zkv1duiXDewvxNSdw9Qvc=; b=bGvtqernlu+8XFFxAZ6mZ2uTZtqXEg4NbVpJPk3tKEDEdpNeOcEvIYrUfMa+PnFpg6 26rWZrj96KwFPXcTD4hlqpaF/X6NRpr07pYHlxbOi71exbam9gFFgEXxDLmhHuv6eqye TIxP72DL1wcX6lUR9Ap4XcEL2mCSABoZgyZAoHJHN44asckJY8iPzWQAXE2FaVxxvToa huyQhWgz1LEXpjdWig/mENDwEZ4aBXDkLLg2THhoR8f4lhGTroKRzhGUYAvf+78zk3PP PfzOWh1zub1T+Z1sGKDVRohoOiUNFsmLmg3G+2VnP6bsoKxJDfUJIcX+PtJag9Yo5hER mPOQ== X-Gm-Message-State: AOJu0YxvUoeAC67vUGmDHCV/L1joreFb09Y50jM5pfeYuUXfUyWVInya AuR7Txvr/lwBChUjnfb9xqhEjEZZ8lOMuk3alGA8PXUJsReR9njUsHstaXgpB7dHbkwK56ShSU5 O9o86pHezONQz6OX03zZECGxcmJt3NqbO5yFQLg== X-Google-Smtp-Source: AGHT+IGLuMlnxap/FA5xzxfGOsc+zo4ntvK0kNlOur4S0doIBGqMXvIdthKP/yAeHwMRXthhIyJpyJcN7dUHrX9yCCA= X-Received: by 2002:a05:6a21:191:b0:1af:3857:e653 with SMTP id le17-20020a056a21019100b001af3857e653mr1123854pzb.12.1714507436496; Tue, 30 Apr 2024 13:03:56 -0700 (PDT) MIME-Version: 1.0 References: <20240412111136.3470304-1-luca.vizzarro@arm.com> <20240412111136.3470304-4-luca.vizzarro@arm.com> In-Reply-To: From: Jeremy Spewock Date: Tue, 30 Apr 2024 16:03:45 -0400 Message-ID: Subject: Re: [PATCH 3/5] dts: add parsing utility module To: Luca Vizzarro Cc: dev@dpdk.org, =?UTF-8?Q?Juraj_Linke=C5=A1?= , Paul Szczepanek 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, Apr 30, 2024 at 6:49=E2=80=AFAM Luca Vizzarro wrote: > > > > Is it simpler to default this to base 10? I assume that's what it'll > > be most of the time so we might as well allow users to skip this > > parameter. > > Base 0 just assumes the base of the number from the number prefix[1]. So > if it's 0xAF it's base 16, 0o755 it's base 8 and so on. Of course base > 10 is assumed with no prefix. I can certainly leave it as 10 as default, > but is there a benefit to our purpose? I wasn't aware that was the effect of having base 0. In that case, not only is there no benefit to defaulting to base 10, I would argue there is benefit to not doing so and leaving it 0 by default! Thanks for letting me know! > > > If we just skip instead of raising an exception here, would this solve > > the issues caused by the first and last line in the testpmd output? > > The check to see if the first line is an invalid port would obviously > > still not work, but would it solve the problem of the trailing prompt? > > This exception is only raised when a field does not have a default value > and there is no value to be assigned. Of course an exception is raised > when attempting to construct and omitting a mandatory field, but this > one is more meaningful as it provides context on what's wrong. > > It is not related to neither trailing/leading strings. These don't > affect the functionality of the class. But rather the actual parsing > done by the "user". > Ahh, I see. I was confused, I thought the issue you were facing with the trailing prompt might have been that you were feeding it into the structure which uses this parsing utility and then it was throwing an exception because it just didn't know what it was, but that makes sense that it wouldn't even be a flag in the structure so wouldn't have much effect. I was hoping that would make things easier so that we could just assume that the tool using the utility will always specify *exactly* the information it cares about and ignore anything that it doesn't so that you could still use the raw output from testpmd even with the irrelevant lines. I see now that this is not relevant, apologies. > [1] https://docs.python.org/3.10/library/functions.html#int