From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 41A09A04AB;
	Fri,  8 Nov 2019 05:13:38 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 604AD1BEE0;
	Fri,  8 Nov 2019 05:13:37 +0100 (CET)
Received: from mail-io1-f67.google.com (mail-io1-f67.google.com
 [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 35CE71BEDC
 for <dev@dpdk.org>; Fri,  8 Nov 2019 05:13:36 +0100 (CET)
Received: by mail-io1-f67.google.com with SMTP id v17so3792571iol.12
 for <dev@dpdk.org>; Thu, 07 Nov 2019 20:13:36 -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=uAsfItFy50wxspszc6aU9aSHi32RAv2PMe/lyyCvmGY=;
 b=KVofxg3SGU5JHpGDcWIx3OlXcTMxBDg3ScSFqw5xl/T1L0pDyiPqKjrfAPvC1NYuPG
 n7kBUO7Bq1sWMB1nvwXDe9R+ZbdjsemBqwPWCWO/wqblpwCgCWE52L/xZTs7/sYcpwDr
 9+JsO/qcKsI84wQe6of5WMQ4pYiksDLlwmIfTezAeyV+aRvrbeqSs3glgOLhoQVzQvJs
 73G0Tv4Y0/6/7NDGjdU08fyc4PD46ju34h/DHU8Kl67n9gCORR79W0bHpQmx3VCCUNEK
 BvYho9BYVdyG6Lt408FUj3o0pitRQXyOUn+CnyERVO3RwuGM7GiAuWrz2blYuux1P0W+
 /BSQ==
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=uAsfItFy50wxspszc6aU9aSHi32RAv2PMe/lyyCvmGY=;
 b=iGuw7fkiuXAKkiD2HgwUb6n/iZO5d8/aADpzxKlIN+HvIxn6xuWykonUMJCLXgx8H/
 TaEkXDSVq0Lnag5cpSpnZ2xZelQw9kz+TWoA8p875z0e0EgYgnH3TugQSE150FzrbRqw
 mdNs/sO2Zh60kCGRGZ8IuFV5Wnnl+L65Ayx7OQiVOycboUE3TjuD61KyPs/DLY9r+sYa
 z8I0RpWl07Jeb0vLrMZUWfdlVMJmbB7xZAI3F0l8WPOAhQoJcHZZdiKN9eHikx3n0RUF
 Mh3RnkrDPNdb36JijsjRZAkt28Im1o8SsrzEhY2ZNwGK8hpciKIzrLuZ8+skoi0EpToZ
 n57g==
X-Gm-Message-State: APjAAAW5dX+EwWloR58T6GQ1N1B4qXPnb/B/oGnHX0Z+sv708cTmyEOB
 7qU4tXW/7o+f4kIJFeueyhA6hFBOc3gx9/YXgAM=
X-Google-Smtp-Source: APXvYqwxutg9g86q260TjlUTsXAWQBvaQYjyKdo3CpZPLlvhlvdjEHkDftvSgKYwuchqraxi2AxU98P4aOgluK+kjs4=
X-Received: by 2002:a5d:9613:: with SMTP id w19mr7646573iol.271.1573186415379; 
 Thu, 07 Nov 2019 20:13:35 -0800 (PST)
MIME-Version: 1.0
References: <20191029153722.4547-1-pbhagavatula@marvell.com>
 <20191106191803.15098-1-pbhagavatula@marvell.com>
 <20191106191803.15098-9-pbhagavatula@marvell.com>
 <ee54dec9-e123-8718-b810-eef53c1403a4@intel.com>
 <CALBAE1NvkiDwPVQdpKiZniv+da0bT7ArxEVUCvGwt-fafQOZTg@mail.gmail.com>
 <bbcfe81b-cbab-89f3-0c74-fa9886a54e59@intel.com>
In-Reply-To: <bbcfe81b-cbab-89f3-0c74-fa9886a54e59@intel.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Fri, 8 Nov 2019 09:43:18 +0530
Message-ID: <CALBAE1OttYP7coc-ztj0PUbhpNkh6Owk6ovGOBSctEy+zLES0g@mail.gmail.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>,
 Andrew Rybchenko <arybchenko@solarflare.com>, 
 Jerin Jacob <jerinj@marvell.com>, Thomas Monjalon <thomas@monjalon.net>, 
 Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, 
 Bernard Iremonger <bernard.iremonger@intel.com>,
 John McNamara <john.mcnamara@intel.com>, 
 Marko Kovacevic <marko.kovacevic@intel.com>, dpdk-dev <dev@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v16 8/8] app/testpmd: add command to set
 supported ptype mask
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, Nov 8, 2019 at 1:11 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 11/7/2019 6:55 PM, Jerin Jacob wrote:
> >
> >
> > On Fri, 8 Nov, 2019, 12:10 am Ferruh Yigit, <ferruh.yigit@intel.com
> > <mailto:ferruh.yigit@intel.com>> wrote:
> >
> >     On 11/6/2019 7:18 PM, pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com> wrote:
> >     > From: Pavan Nikhilesh <pbhagavatula@marvell.com
> >     <mailto:pbhagavatula@marvell.com>>
> >     >
> >     > Add command to set supported ptype mask.
> >     > Usage:
> >     >       set port <port_id> ptype_mask >  /* ***************
> >     >
> >     >  /* list of instructions */
> >     > @@ -19155,6 +19237,7 @@ cmdline_parse_ctx_t main_ctx[] = {
> >     >       (cmdline_parse_inst_t *)&cmd_show_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
> >     >       (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,
> >     > +     (cmdline_parse_inst_t *)&cmd_set_port_ptypes,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,
> >     >       (cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,
> >     > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> >     > index 5ba974162..812aebf35 100644
> >     > --- a/app/test-pmd/testpmd.c
> >     > +++ b/app/test-pmd/testpmd.c
> >     > @@ -2024,6 +2024,7 @@ start_port(portid_t pid)
> >     >       queueid_t qi;
> >     >       struct rte_port *port;
> >     >       struct rte_ether_addr mac_addr;
> >     > +     static uint8_t clr_ptypes = 1;
> >     >
> >     >       if (port_id_is_invalid(pid, ENABLED_WARN))
> >     >               return 0;
> >     > @@ -2153,6 +2154,10 @@ start_port(portid_t pid)
> >     >                       }
> >     >               }
> >     >               configure_rxtx_dump_callbacks(verbose_level);
> >     > +             if (clr_ptypes) {
> >     > +                     clr_ptypes = 0;
> >     > +                     rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN, NULL, 0);
> >     > +             }
> >
> >     I am not sure about this command, we have now capability to set/disable ptypes
> >     on demand, why disabling them by default?
> >
> >
> > As forward engines are not using the ptype offload. If a specific forward mode
> > need the offload, it can be enabled.
> >
>
> OK, I am still not sure but I understand your reasoning.
>
> But this is a behavior change and it may caught people, what about following
> more operational updates:
> - Separate this into its own patch, this is different than adding new command
> - move "clr_ptypes" next to other static global variables, to make this
> selection more obvious, and those global variables tend to have some comments,
> we can add comment to this one as well.
> - print a log when "rte_eth_dev_set_ptypes()" returns success, to say packets
> types parsing is disabled, to help user to understand what is happening. Because
> currently there is no other way to get the current configured ptypes from PMD.

+1 for operational updates.