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 7FA6C45A39; Thu, 26 Sep 2024 16:43:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49F7E4042E; Thu, 26 Sep 2024 16:43:16 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id E3CA940279 for ; Thu, 26 Sep 2024 16:43:14 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e07e40e7d2so939476a91.1 for ; Thu, 26 Sep 2024 07:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1727361794; x=1727966594; 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=xwkkw6iu3UZMDreUb43FjgZyYYBPfN59D+T2/Ga19tY=; b=AWT+LozL5N9i3WSJwOaYSUoeKRqcmS27ezmyGsq08gy3BNj3SlnB0b5bEZdtar+EvK sBMPbf0PjmSCWtsr/S4tAJNv76bc6ecdAvfXeQ6DGlD2OTvyN22QIAJJZrnrKK1UIGY2 MNwHcWSXEc/hKlasN9/zTsaM7Oy1dGgq0sm/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727361794; x=1727966594; 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=xwkkw6iu3UZMDreUb43FjgZyYYBPfN59D+T2/Ga19tY=; b=j09zUetBW/AwJS6S7aKjVFl1lLF1hk/nom7GlJvNivXDDkc2RpEy4CQEEdY6LQqrzS iv9/YF9W7IiA37NPlolWNf2tnVD+bI6Y+7uAFszlt2qVMvvRNnb1pipWPnUrJuLlhy7h Oiw9Y7f753uxntiM9Nx3PWRN1FGEywGXtkzw1JY7y98wtIuvow0x6NPumseZPk0l+ud+ 7/LyXzJWXXE8jX6gMEEoOqh7eICpUlIFaYMIu/9aR2NFeAAo1tWKrTERaETDFa5PZgFz I/JdOldq9Q0gzRZgqKX3GTNIWThbSAsE9gSwRRdPPTLOp78UNQXqVd//+NeLkVi5VuE7 5H3Q== X-Forwarded-Encrypted: i=1; AJvYcCUOeTC56Iy47S4HpN88ctwN0audWaWDw1l3aFvkjYZoGAQi7rJU4adJswDabj5KxTNy0/8=@dpdk.org X-Gm-Message-State: AOJu0YzYOskgGffVoDLkiRCnK0LYxxcuL/nt1SwMR3Xabv5JBUSabao4 ccZSV1x0IbqRrgYD7/eoWkOYw+rLml3wevOFikKgiyFOYj6R37nJ8LKeXjGhGCZlcJXfTfCQTxd IEE3RFuzZBIirSbTdVI1ixejBGlnWczj1MBSWHg== X-Google-Smtp-Source: AGHT+IHYWceYzJolvcdKvKamwxpSc/2HpP9jGpVM1VelEgCtyCcECnR1hO2EdUOsILP/CJS2AKZd6TrsyjM2qCMBmHo= X-Received: by 2002:a17:90a:a790:b0:2da:8c08:6a29 with SMTP id 98e67ed59e1d1-2e06ae279e1mr7189727a91.8.1727361794019; Thu, 26 Sep 2024 07:43:14 -0700 (PDT) MIME-Version: 1.0 References: <20240729203955.267942-1-jspewock@iol.unh.edu> <20240925154612.11399-1-jspewock@iol.unh.edu> <20240925154612.11399-2-jspewock@iol.unh.edu> In-Reply-To: From: Jeremy Spewock Date: Thu, 26 Sep 2024 10:43:02 -0400 Message-ID: Subject: Re: [PATCH v6 1/1] dts: add text parser for testpmd verbose output To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, wathsala.vithanage@arm.com, thomas@monjalon.net, yoan.picchi@foss.arm.com, npratte@iol.unh.edu, dev@dpdk.org 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 Thu, Sep 26, 2024 at 4:25=E2=80=AFAM Juraj Linke=C5=A1 wrote: > > > > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framew= ork/remote_session/testpmd_shell.py > > > @@ -581,6 +581,506 @@ class TestPmdPortStats(TextParser): > > tx_bps: int =3D field(metadata=3DTextParser.find_int(r"Tx-bps:\s+= (\d+)")) > > > > > > +class PacketOffloadFlag(Flag): > > > + #: RX IEEE1588 L2 Ethernet PT Packet. > > + RTE_MBUF_F_RX_IEEE1588_PTP =3D 1 << 9 > > + #: RX IEEE1588 L2/L4 timestamped packet. > > + RTE_MBUF_F_RX_IEEE1588_TMST =3D 1 << 10 > > There are a few instances with two or three consecutive bits set > expliticly instead with auto(). I don't know if it's better to use > auto() or the explitic value, just wanted to point it out. > If it was only two consecutive bits I avoided using auto because I thought that made it more clear (at least for me, it felt like less bouncing back and forth). This is a good point though, I also don't know which is really better. > > > + > > + #: FD id reported if FDIR match. > > + RTE_MBUF_F_RX_FDIR_ID =3D 1 << 13 > > + #: Flexible bytes reported if FDIR match. > > + RTE_MBUF_F_RX_FDIR_FLX =3D 1 << 14 > > + @classmethod > > + def from_str(cls, flags: str) -> Self: > > Now that we're doing the same thing as the other classes, I think it > makes sense to just flat out copy-paste the from_list_string method. Sure, that makes sense to me. > > > + """Makes an instance from a string containing whitespace-separ= ated the flag members. > > + > > + Args: > > + arr: A string containing ol_flag values. > > + > > + Returns: > > + A new instance of the flag. > > + """ > > + flag =3D cls(0) > > + for name in flags.split(): > > + if hasattr(cls, name): > > This is still different from the other class. I think making these > exactly the same would make it clear what needs to be put into the base > class if we ever create one. Ack. > > > + flag |=3D cls[name] > > + return flag > > > + > > +class RtePTypes(Flag): > > + """Flag representing possible packet types in DPDK verbose output. > > + > > + Values in this class are derived from definitions in the RTE MBUF = ptype library in DPDK located > > + in lib/mbuf/rte_mbuf_ptype.h. Specifically, the names of values in= this class should match the > > + possible return options from the methods rte_get_ptype_*_name in r= te_mbuf_ptype.c. > > I think these are functions (rte_get_ptype_*_name), not methods. > Ahh, good call. I wasn't thinking of the distinction when I wrote it. > > + """ > > You didn't update the docstring here (double backticks (for file and > function names) and the References: section). Good catch, I'll fix those as well. > > > > + @classmethod > > + def from_str(cls, flags: str) -> Self: > > The same comments apply here. Ack. > >