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 6DAD6A04A4; Fri, 1 May 2020 00:43:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 239AF1DAC6; Fri, 1 May 2020 00:43:25 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 8EE301DA73 for ; Fri, 1 May 2020 00:43:23 +0200 (CEST) IronPort-SDR: 0lmBCTThGNBhzniP3Nv/jL1s/1T0eZnSeRYtB7+R1GSCRUtHSqaVBaVjoFH7xe+VggYVqvbKq5 o/1z7sgJaL4w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 15:43:22 -0700 IronPort-SDR: iS7i01+VzaeE+GSKIy6Subq+PfuAkwIzjaUWYvsQ5ngI83fZsrqjwcNB5e1FQeJcP0ZAZXvFqC sbQFp6ejf4Ew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,337,1583222400"; d="scan'208";a="261936202" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.213.243.251]) ([10.213.243.251]) by orsmga006.jf.intel.com with ESMTP; 30 Apr 2020 15:43:20 -0700 To: Bill Zhou , wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, orika@mellanox.com, john.mcnamara@intel.com, marko.kovacevic@intel.com, matan@mellanox.com Cc: dev@dpdk.org References: <20200424105511.13147-1-dongz@mellanox.com> <20200430155345.1384-1-dongz@mellanox.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMq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/UTn5vlivul+cThi6ERPvjqjblLncQtRg8izj2qgmwQkvfj+h7Ex88bI 8iWtu5+I3K3LmNz/UxHBSWEmUnkg4fJlRr7oItHsZ0ia6wWQ8lQnABEBAAGJAjwEGAEKACYC GwwWIQTSNlOHQi7ChOOZgcf5M+tD3xNhHwUCXqFrngUJCKxSYAAKCRD5M+tD3xNhH3YWD/9b cUiWaHJasX+OpiuZ1Li5GG3m9aw4lR/k2lET0UPRer2Jy1JsL+uqzdkxGvPqzFTBXgx/6Byz EMa2mt6R9BCyR286s3lxVS5Bgr5JGB3EkpPcoJT3A7QOYMV95jBiiJTy78Qdzi5LrIu4tW6H o0MWUjpjdbR01cnj6EagKrDx9kAsqQTfvz4ff5JIFyKSKEHQMaz1YGHyCWhsTwqONhs0G7V2 0taQS1bGiaWND0dIBJ/u0pU998XZhmMzn765H+/MqXsyDXwoHv1rcaX/kcZIcN3sLUVcbdxA WHXOktGTQemQfEpCNuf2jeeJlp8sHmAQmV3dLS1R49h0q7hH4qOPEIvXjQebJGs5W7s2vxbA 5u5nLujmMkkfg1XHsds0u7Zdp2n200VC4GQf8vsUp6CSMgjedHeF9zKv1W4lYXpHp576ZV7T GgsEsvveAE1xvHnpV9d7ZehPuZfYlP4qgo2iutA1c0AXZLn5LPcDBgZ+KQZTzm05RU1gkx7n gL9CdTzVrYFy7Y5R+TrE9HFUnsaXaGsJwOB/emByGPQEKrupz8CZFi9pkqPuAPwjN6Wonokv ChAewHXPUadcJmCTj78Oeg9uXR6yjpxyFjx3vdijQIYgi5TEGpeTQBymLANOYxYWYOjXk+ae dYuOYKR9nbPv+2zK9pwwQ2NXbUBystaGyQ== Message-ID: <5fc8bc00-e4b1-b2c4-1caf-03dea0456f4c@intel.com> Date: Thu, 30 Apr 2020 23:43:19 +0100 MIME-Version: 1.0 In-Reply-To: <20200430155345.1384-1-dongz@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: support flow aging 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 4/30/2020 4:53 PM, Bill Zhou wrote: > Currently, there is no way to check the aging event or to get the current > aged flows in testpmd, this patch include those implements, it's included: > - Registering aging event when the testpmd application start, add new > command to control if the event expose to the applications. If it's be > set, when new flow be checked age out, there will be one-line output log. > - Add new command to list all aged flows, meanwhile, we can set parameter > to destroy it. > > Signed-off-by: Bill Zhou > --- > v2: Update the way of registering aging event, add new command to control > if the event need be print or not. Update the output of the delete aged > flow command format. <...> > @@ -19387,6 +19394,44 @@ cmdline_parse_inst_t cmd_showport_macs = { > }, > }; > > +/* Enable/Disable flow aging event log */ > +struct cmd_set_aged_flow_event_log_result { > + cmdline_fixed_string_t set; > + cmdline_fixed_string_t keyword; > + cmdline_fixed_string_t enable; > +}; > +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_set = > + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, > + set, "set"); > +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_keyword = > + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, > + keyword, "aged_flow_event_log"); > +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_enable = > + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, > + enable, "on#off"); > + > +static void > +cmd_set_aged_flow_event_log_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_set_aged_flow_event_log_result *res = parsed_result; > + int enable = (strcmp(res->enable, "on") == 0) ? 1 : 0; > + update_aging_event_log_status(enable); > +} > + > +cmdline_parse_inst_t cmd_set_aged_flow_event_log = { > + .f = cmd_set_aged_flow_event_log_parsed, > + .data = NULL, > + .help_str = "set aged_flow_event_log on|off", What do you think "set aged_flow_verbose on|off" to be more similar to existing verbose command? <...> > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3068,6 +3068,21 @@ rmv_port_callback(void *arg) > start_packet_forwarding(0); > } > > +static int aged_flow_event_enable; Other global config values are at the beginning of the file, with a comment on them, can you do same with variable? > +void update_aging_event_log_status(int enable) > +{ > + aged_flow_event_enable = enable; > +} > + > +int aging_event_output(uint16_t portid) This can be a 'static' function. > +{ > + if (aged_flow_event_enable) { > + printf("port %u RTE_ETH_EVENT_FLOW_AGED triggered\n", portid); > + fflush(stdout); > + } > + return 0; > +} > + > /* This function is used by the interrupt thread */ > static int > eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, > @@ -3098,6 +3113,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, > rmv_port_callback, (void *)(intptr_t)port_id)) > fprintf(stderr, "Could not set up deferred device removal\n"); > break; > + case RTE_ETH_EVENT_FLOW_AGED: > + aging_event_output(port_id); Can't this provide more information than port_id, like flow id etc, what event_process function provides? can we print it too? And what is the intended usage in real application, when flow aged event occurred, should application destroy the flow? So it should know the flow, right? <...> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -1062,6 +1062,21 @@ Where: > > Check the NIC Datasheet for hardware limits. > > +aged flow event log set > +~~~~~~~~~~~~~~~~~~~~~~~ > + > +Currently, the flow aging event is registered when the testpmd application start, if new flow be checked > +age out, there will be one output log for it. But some applications do not interest this event, use this > +command can set if the event expose to the applications:: > + > + testpmd> set aged_flow_event_log (on|off) > + > +For examine:: > + > + testpmd> set aged_flow_event_log on > + testpmd> port 0 RTE_ETH_EVENT_FLOW_AGED triggered > + testpmd> set aged_flow_event_log off > + This can be moved below the "set verbose" command since they are in similar group.