From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C356DA04FF; Tue, 14 Jan 2020 15:01:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0C641C0CB; Tue, 14 Jan 2020 15:01:08 +0100 (CET) Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by dpdk.org (Postfix) with ESMTP id 3CAE81BFEC for ; Tue, 14 Jan 2020 15:01:07 +0100 (CET) Received: by mail-il1-f194.google.com with SMTP id b15so11593797iln.3 for ; Tue, 14 Jan 2020 06:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Nv9qWXQyYGULuuat5elJqebqKnM8UtOeZi2jgms9ukI=; b=DdVlW4oI2Z4HREiIKOo+G++AZufM9Vbb8JaWek0DzX0CSCYLdsdOybfVj9FcWlcFdS UtH/uXFGEo2igT0IGiudbsOsOgJ1LyL8EZsyhsVUey+ci6vNhHwHFiVPp4UbjAq62GrZ GqTXzVEze9HCBjc8yMkkr/Ti7g2LL93fSvZZ2jIhCGzqb7fWIa8LB0h3ort5wkjtQU/B f4E796fkNFyOnFx4XVxdeEdcnT+ekFFXHW7iAt6dh+OL0okiY5GZ+T4fE+52PaGfx9am b+iT2cDBKOCU/C2ttHufLP03qD4Xys39cw6AQB0mop7vXLU7296aADICLdBYHlcDP8oE e76Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nv9qWXQyYGULuuat5elJqebqKnM8UtOeZi2jgms9ukI=; b=cWowN/xVtzy+wv9yZySEa28Oc0ESB2oC7y3N6VIbM6hXeNI6j5fS2xKa1qXrjNqc/8 7JZQUJXeXNyZznHU6VQL7Anh/eeKyrNmslmKqy+xMeD4MNZG5h4HfEE3IO4lhF7qGOFQ CkEays31u5Y2PmQfIO6QutUwYmTzvgZVJa2MJBqdoYmxLQqAs+tSiQjl0/b3WJQi+dMj VRv9yEkuZtJ+J7gajX3hMOmjPEGyaZs6pIkdMxiL1rtBfygqrUXq9n0chRD0fhXJkcYH RfYbxuKAaSpBeyfmLt+u5Xl34h/8cWymKT5I4BaRnxWZSWTy7IqH1IOLxeeG7cU29Xe4 nDWw== X-Gm-Message-State: APjAAAXikkZgKHqlNH9M8eVkLwDmX+6fEE4HAFfSyofmso0qOnd3rrcQ b5tH51sEIhB2xvYzsjMw06qdQF3fmIMybbt2CpA= X-Google-Smtp-Source: APXvYqzNtbvUVfwb68OzabyNsnEwJcgMG3W8TLYF/F0qZbMuoXM50WokePLPGbHjXt2LLceYxe7NKE86W592jDFf5Bs= X-Received: by 2002:a92:481d:: with SMTP id v29mr3512138ila.271.1579010466510; Tue, 14 Jan 2020 06:01:06 -0800 (PST) MIME-Version: 1.0 References: <620a2408b0dd370b8483c452d2b5957b3144fac7.1578969179.git.jackmin@mellanox.com> <20200114101512.iew54qyy44siei7e@mellanox.com> In-Reply-To: <20200114101512.iew54qyy44siei7e@mellanox.com> From: Jerin Jacob Date: Tue, 14 Jan 2020 19:30:49 +0530 Message-ID: To: Jack Min Cc: Slava Ovsiienko , Matan Azrad , Raslan Darawsheh , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Adrien Mazarguil , Ori Kam , dpdk-dev , "Xueming(Steven) Li" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC 2/4] app/testpmd: new flow dump CLI X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jan 14, 2020 at 3:45 PM Jack Min wrote: > > On Tue, 20-01-14, 10:01, Jerin Jacob wrote: > > On Tue, Jan 14, 2020 at 9:15 AM Xiaoyu Min wrote: > > > > > > From: Xueming Li > > > > > > New flow dump CLI to dump MLX5 PMD specific flows into screen. > > > > > > Signed-off-by: Xueming Li > > > Signed-off-by: Xiaoyu Min > > > --- > > > app/test-pmd/Makefile | 4 ++ > > > app/test-pmd/cmdline_flow.c | 91 +++++++++++++++++++++++++++++++++++++ > > > app/test-pmd/config.c | 33 ++++++++++++++ > > > app/test-pmd/meson.build | 3 ++ > > > app/test-pmd/testpmd.h | 1 + > > > 5 files changed, 132 insertions(+) > > > > > > > > > > > +/** Dump all flow rules. */ > > > +int > > > +port_flow_dump(portid_t port_id __rte_unused, > > > + const char *file_name __rte_unused) > > > +{ > > > + int ret = 0; > > > +#ifdef RTE_LIBRTE_MLX5_PMD > > > > IMO, It should be the last resort to add driver-specific symbols in testpmd. > > Why not introduce rte_flow_dump() and hook the MLX driver underneath? > > > Hey Jerin, Hi Jack. > > Thanks for you comments. > > What my understanding is this flow dump is very Mellanox specific, it will dump > all flows in Mellanox HW using Mellanox format. They are hardware flows in > short, which are different from rte flow. We do have a similar API for other drivers to represent the internal info. I think, similar API[1] would suffice for your case. We should not standardize the output of dump, instead, it will provide a generic API to dump the internal representation of flow HW to file/stdout. Octeontx2 MACM HW (rte_flow) has similar internal information, We could implement the driver API if it is a generic API. [1] See the below example for eventdev driver. /** * Dump internal information about *dev_id* to the FILE* provided in *f*. * * @param dev_id * The identifier of the device. * * @param f * A pointer to a file for output * * @return * - 0: on success * - <0: on failure. */ int rte_event_dev_dump(uint8_t dev_id, FILE *f); > > I don't know whether other vendor has the similar functionality and needs > so an rte flow level API could be helpful. > > And basically rte flow API is based on rte_flow, a dump function probabily means > dump rte_flow itself (i.e flow->attr, pattern, actions). > > This is the reason a private API is choosen and driver-specific symbols added > in testpmd as result. > > -Jack