From: "Dai, Wei" <wei.dai@intel.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>,
"Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add commands to test new Rx offload API
Date: Sat, 17 Mar 2018 13:49:25 +0000 [thread overview]
Message-ID: <49759EB36A64CF4892C1AFEC9231E8D66CF5FCFF@PGSMSX112.gar.corp.intel.com> (raw)
In-Reply-To: <9BB6961774997848B5B42BEC655768F810FB77D7@SHSMSX103.ccr.corp.intel.com>
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Thursday, March 15, 2018 3:41 AM
> To: Dai, Wei <wei.dai@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v2 1/2] app/testpmd: add commands to test new Rx
> offload API
>
> <...>
>
> > +static int
> > +config_rx_offload(const char *name, uint64_t *offload, int on) {
> > + uint64_t local = *offload;
> > +
> > + if (!strcmp(name, "vlan_strip")) {
> > + if (on)
> > + local |= DEV_RX_OFFLOAD_VLAN_STRIP;
> > + else
> > + local &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
> Would it decrease the lines if move the "on" checking to the end of this
> function, just set the BIT which you want to set or mask here?
Thanks, will follow your suggestion in v3 patch set.
> <...>
>
> > +static void
> > +cmd_config_per_port_rx_offload_parsed(void *parsed_result,
> > + __attribute__((unused)) struct cmdline *cl,
> > + __attribute__((unused)) void *data) {
> > + struct cmd_config_per_port_rx_offload_result *res = parsed_result;
> > + portid_t port_id = res->port_id;
> > + struct rte_port *port = &ports[port_id];
> > + int on;
> > +
> > + if (port->port_status != RTE_PORT_STOPPED) {
> > + printf("Error: Can't config offload when Port %d "
> > + "is not stopped\n", port_id);
> > + return;
> > + }
> > +
> > + if (!strcmp(res->en_dis, "enable"))
> > + on = 1;
> > + else if (!strcmp(res->en_dis, "disable"))
> > + on = 0;
> > + else {
> > + printf("Unknown parameter: %s\n", res->en_dis);
> > + return;
> The en_dis is already defined as "enable#disable", so the else is useless here.
Thanks, the second if and second else can be removed and will change in v3 patch set.
>
> <...>
>
> > +static void
> > +cmd_config_per_queue_rx_offload_parsed(void *parsed_result,
> > + __attribute__((unused)) struct cmdline *cl,
> > + __attribute__((unused)) void *data) {
> > + struct cmd_config_per_queue_rx_offload_result *res = parsed_result;
> > + struct rte_eth_dev_info dev_info;
> > + portid_t port_id = res->port_id;
> > + uint16_t queue_id = res->queue_id;
> > + struct rte_port *port = &ports[port_id];
> > + int on;
> > +
> > + if (port->port_status != RTE_PORT_STOPPED) {
> > + printf("Error: Can't config offload when Port %d "
> > + "is not stopped\n", port_id);
> > + return;
> > + }
> > +
> > + if (!strcmp(res->en_dis, "enable"))
> > + on = 1;
> > + else if (!strcmp(res->en_dis, "disable"))
> > + on = 0;
> > + else {
> > + printf("Unknown parameter: %s\n", res->en_dis);
> > + return;
> Same comments as above.
> <...>
>
> > @@ -707,6 +708,17 @@ init_config(void)
> > }
> > }
> >
> > + port->rx_offloads = rte_zmalloc("testpmd: port->rx_offloads",
> > + sizeof(port->rx_offloads[0]) *
> > + port->dev_info.max_rx_queues,
> > + sizeof(port->rx_offloads[0]));
>
> When will you free it?
I will free port->rx_offloads and port->tx_offloads when testpmd is existed.
>
> > + if (port->rx_offloads == NULL)
> > + rte_exit(EXIT_FAILURE,
> > + "rte_zmalloc(%d port->rx_offload[0]) "
> > + "failed\n", port->dev_info.max_rx_queues);
> > + for (k = 0; k < port->dev_info.max_rx_queues; k++)
> > + port->rx_offloads[k] = port->dev_conf.rxmode.offloads;
> > +
> In the get configure command, the port->rx_offloads is printed.
> Here you init it to be port configuration, when will you update it?
This init_config() is only run once in the initialization stage in the main().
Port->rx_offloads[] can be changed using new testpmd command in this patch set.
Testpmd> rx_offload enable/disable per_queue <offload> <port_id> <queue_id>
And will be applied when the command port start <port_id> is run.
next prev parent reply other threads:[~2018-03-17 13:49 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 8:15 [dpdk-dev] [PATCH 0/2] app/testpmd: add new commands to test new Tx/Rx " Wei Dai
2018-03-12 8:15 ` [dpdk-dev] [PATCH 1/2] app/testpmd: add commands to test new Rx " Wei Dai
2018-03-12 8:42 ` Andrew Rybchenko
2018-03-13 1:06 ` Dai, Wei
2018-03-12 8:15 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-13 6:42 ` [dpdk-dev] [PATCH v2 0/2] app/testpmd: add new commands to test new Tx/Rx " Wei Dai
2018-03-13 6:42 ` [dpdk-dev] [PATCH v2 1/2] app/testpmd: add commands to test new Rx " Wei Dai
2018-03-13 7:21 ` Andrew Rybchenko
2018-03-13 9:30 ` Ananyev, Konstantin
2018-03-17 13:45 ` Dai, Wei
2018-03-14 19:40 ` Wu, Jingjing
2018-03-17 13:49 ` Dai, Wei [this message]
2018-03-13 6:42 ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-17 13:31 ` [dpdk-dev] [PATCH v3 0/3] app/testpmd: add new commands to test new Tx/Rx " Wei Dai
2018-03-17 13:31 ` [dpdk-dev] [PATCH v3 1/3] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
2018-03-17 13:31 ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-03-17 13:31 ` [dpdk-dev] [PATCH v3 3/3] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-19 12:33 ` [dpdk-dev] [PATCH v4 0/3] app/testpmd: add new commands to test new Tx/Rx offload Wei Dai
2018-03-19 12:33 ` [dpdk-dev] [PATCH v4 1/3] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
2018-03-19 12:33 ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-03-19 12:33 ` [dpdk-dev] [PATCH v4 3/3] pp/testpmd: add commands to test new Tx " Wei Dai
2018-03-19 12:40 ` [dpdk-dev] [PATCH v4 0/3] app/testpmd: add new commands to test new Tx/Rx offload Wei Dai
2018-03-19 12:40 ` [dpdk-dev] [PATCH v4 1/3] ethdev: add enum type for loop on Rx/Tx offloads Wei Dai
2018-03-19 14:05 ` Zhang, Qi Z
2018-03-20 1:52 ` Dai, Wei
2018-03-19 12:40 ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-03-19 12:40 ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-20 3:09 ` [dpdk-dev] [PATCH v5 0/2] app/testpmd: add new commands to test new Tx/Rx offloads Wei Dai
2018-03-20 3:09 ` [dpdk-dev] [PATCH v5 1/2] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-03-20 3:09 ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-22 8:00 ` [dpdk-dev] [PATCH v6 0/2] app/testpmd: add new commands to test new Tx/Rx offloads Wei Dai
2018-03-22 8:00 ` [dpdk-dev] [PATCH v6 1/2] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-03-30 8:40 ` Wu, Jingjing
2018-03-22 8:00 ` [dpdk-dev] [PATCH v6 2/2] app/testpmd: add commands to test new Tx " Wei Dai
2018-03-30 23:05 ` Wu, Jingjing
2018-04-03 8:57 ` [dpdk-dev] [PATCH v7 0/2] app/testpmd: add new commands to test new Tx/Rx offloads Wei Dai
2018-04-03 8:57 ` [dpdk-dev] [PATCH v7 1/2] app/testpmd: add commands to test new Rx offload API Wei Dai
2018-04-03 8:57 ` [dpdk-dev] [PATCH v7 2/2] app/testpmd: add commands to test new Tx " Wei Dai
2018-04-12 17:53 ` [dpdk-dev] [PATCH v7 0/2] app/testpmd: add new commands to test new Tx/Rx offloads Ferruh Yigit
2018-05-08 13:30 ` Dai, Wei
2018-05-08 15:33 ` Ferruh Yigit
2018-05-09 12:13 ` [dpdk-dev] [PATCH v8] app/testpmd: add commands to test new offload API Wei Dai
2018-05-11 0:00 ` Ferruh Yigit
2018-05-11 0:10 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49759EB36A64CF4892C1AFEC9231E8D66CF5FCFF@PGSMSX112.gar.corp.intel.com \
--to=wei.dai@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).