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 5CD9841EAF; Thu, 16 Mar 2023 10:19:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00C4D40FDF; Thu, 16 Mar 2023 10:19:34 +0100 (CET) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by mails.dpdk.org (Postfix) with ESMTP id A099140EF1 for ; Thu, 16 Mar 2023 10:19:32 +0100 (CET) Received: by mail-ed1-f53.google.com with SMTP id x3so4767886edb.10 for ; Thu, 16 Mar 2023 02:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678958372; 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=lNK4/In0scTYf7+YcYavTj44no8F3YsR3qCjA1SCv4E=; b=pGBB26PnZAwJQxuzbX4lblHG6khqv+giyhmd49nNYyEQrc+dVLn/q03CZpKSkGhciU rFn54iZe2SNHoRutreKdWw4pwuJ2cR75R7f/ijW7f2Hl1KadrNjn2le/DLgiJ1rwE9l8 vJbwP8EBMZnCzEcoZjIGJ59WhnPyLD0Lx0/QZmsSmpYbx06TAgtoi4F6Q5CztYwxxzy/ 0XoRVF1m17u3Th1rutSzaM3QAx2UVSdDLV5jW362a3PzI+GKr41ZwNH+2RJj+9R5Un/5 FezJummGgmtfLV5g+hDyb0frTcSz2HDORm/kYCitFt7cjDaMb8DYGJmkuePjnO+Y3yX9 UngA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678958372; 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=lNK4/In0scTYf7+YcYavTj44no8F3YsR3qCjA1SCv4E=; b=sEw/ji1LjrS8BLvOGdMSx2RCqdaVFvpl3AH4o4PmxluaIgUU7I6CxAl4nUO4b7g1u3 Ses06Y5ZNdqLOJbJLIuXlMX2PBbWfaKkIsb6XZPGNEKf9lGgZbTGPCxoMZIoSwc5KD5B FTSAknGtKX9PucN9hRi9MqdrYzBL1Ud7jdjgVkWruEizKBlq19E2LJfn1F099xHz+m8M KWjbp8LzAu0N7xhvi9SWnKNj3FkBoLpSOObp6WGUhmhsIKQGKU73rBvbWSKx4wUd8h7a KVz0vOZl//GGQGpNur5TexTTC+08aHLarmEBgeA3NH4TLnHaPyBi6AJDMVemGnnHwDkv VxfA== X-Gm-Message-State: AO0yUKW+JazaCarnSsoKJuGsJ1gb8qOr3PfAYIIveHrIS49prE8VrZSg wRX6d0HIW4VPWXNVegx+e5VgINS2ggJTbPcSkTw= X-Google-Smtp-Source: AK7set8sVIp/wV75WCiZVtBgHm7yxjcKojQnL3jtEC6LZgPxa6h7xsMD1lhXhUmFP3piL7CXSap1OQCarCOZXbLBnSs= X-Received: by 2002:a17:906:1f53:b0:879:5db8:8bb2 with SMTP id d19-20020a1709061f5300b008795db88bb2mr4288374ejk.7.1678958372193; Thu, 16 Mar 2023 02:19:32 -0700 (PDT) MIME-Version: 1.0 References: <20230314115035.33356-1-fengchengwen@huawei.com> <20230315023328.35980-1-fengchengwen@huawei.com> <33a601b7-8e44-6dc7-923a-27d9a74c6993@amd.com> In-Reply-To: From: Dmitry Kozlyuk Date: Thu, 16 Mar 2023 12:19:20 +0300 Message-ID: Subject: Re: [PATCH] app/testpmd: dump private info in 'show port info' To: fengchengwen Cc: Ferruh Yigit , thomas@monjalon.net, Aman Singh , Yuying Zhang , 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, Mar 16, 2023 at 4:11=E2=80=AFAM fengchengwen wrote: > Because we have no API to know the PMD whether impl specific ops, we coul= d only knowed by invoking. > Except above impl, I also consider the other two: > 1. just invoke rte_eth_dev_priv_dump without previous printf("Device priv= ate info") and later error printf. > and I think people may curious about the extra output without a prompt= just like "Device private info". > 2. use fmemopen (the below code), this way will perfect process the PMD w= hich not imp ops. > FILE *f =3D fmemopen(buf, max-size(e.g. 128KB)); > ret =3D rte_eth_dev_priv_dump(port_id, f); > if (ret =3D=3D 0) { > printf("Device private info:\n"); > printf("%s", buf); > } > But the windows platform don't support fmemopen. > > Hope for more feedback. What if rte_eth_dev_priv_dump() was a documented no-op when "f =3D=3D NULL"= ? This can be implemented in ethdev layer: 1) if not implemented, return ENOTSUP 2) if f =3D=3D NULL, return 0 3) else call PMD Technically, even now a null device handle can be used, but this is cumbersome and wastes resources for running the API twice.