[5/5] examples/l3fwd-power: support virtio/vhost
Checks
Commit Message
This patch adds two command line arguments which will be needed when using
virtio/vhost vdev. One argument sets rx offloads capabilities
DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ off
for RX side.
Signed-off-by: Miao Li <miao.li@intel.com>
---
examples/l3fwd-power/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Comments
On 9/10/21 3:05 PM, Miao Li wrote:
> This patch adds two command line arguments which will be needed when using
> virtio/vhost vdev. One argument sets rx offloads capabilities
> DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ off
> for RX side.
>
> Signed-off-by: Miao Li <miao.li@intel.com>
> ---
> examples/l3fwd-power/main.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index aa7b8db44a..4e28008578 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -1811,6 +1811,8 @@ parse_args(int argc, char **argv)
> {"high-perf-cores", 1, 0, 0},
> {"no-numa", 0, 0, 0},
> {"enable-jumbo", 0, 0, 0},
> + {"vlan-strip", 0, 0, 0},
> + {"rx-none", 0, 0, 0},
> {CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
> {CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
> {CMD_LINE_OPT_LEGACY, 0, 0, 0},
> @@ -1986,6 +1988,19 @@ parse_args(int argc, char **argv)
> (unsigned int)port_conf.rxmode.max_rx_pkt_len);
> }
>
> + if (!strncmp(lgopts[option_index].name,
> + "vlan-strip", 10)) {
> + printf("set vlan strip\n");
> + port_conf.rxmode.offloads =
> + DEV_RX_OFFLOAD_VLAN_STRIP;
> + }
> +
> + if (!strncmp(lgopts[option_index].name,
> + "rx-none", 7)) {
> + printf("none of DCB,RSS or VMDQ mode\n");
> + port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> + }
> +
> if (!strncmp(lgopts[option_index].name,
> CMD_LINE_OPT_PARSE_PTYPE,
> sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {
>
Why not just rely on the capabilities exposed by the driver?
Maxime
In l3fwd-power, there is default port configuration which requires RSS and IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-power will exit and report an error.
Miao
-----Original Message-----
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Sent: Friday, September 10, 2021 3:24 PM
To: Li, Miao <miao.li@intel.com>; dev@dpdk.org
Cc: Xia, Chenbo <chenbo.xia@intel.com>; David Marchand <david.marchand@redhat.com>
Subject: Re: [PATCH 5/5] examples/l3fwd-power: support virtio/vhost
On 9/10/21 3:05 PM, Miao Li wrote:
> This patch adds two command line arguments which will be needed when
> using virtio/vhost vdev. One argument sets rx offloads capabilities
> DEV_RX_OFFLOAD_VLAN_STRIP. The other argument sets DCB, PSS and VMDQ
> off for RX side.
>
> Signed-off-by: Miao Li <miao.li@intel.com>
> ---
> examples/l3fwd-power/main.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index aa7b8db44a..4e28008578 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -1811,6 +1811,8 @@ parse_args(int argc, char **argv)
> {"high-perf-cores", 1, 0, 0},
> {"no-numa", 0, 0, 0},
> {"enable-jumbo", 0, 0, 0},
> + {"vlan-strip", 0, 0, 0},
> + {"rx-none", 0, 0, 0},
> {CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
> {CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
> {CMD_LINE_OPT_LEGACY, 0, 0, 0},
> @@ -1986,6 +1988,19 @@ parse_args(int argc, char **argv)
> (unsigned int)port_conf.rxmode.max_rx_pkt_len);
> }
>
> + if (!strncmp(lgopts[option_index].name,
> + "vlan-strip", 10)) {
> + printf("set vlan strip\n");
> + port_conf.rxmode.offloads =
> + DEV_RX_OFFLOAD_VLAN_STRIP;
> + }
> +
> + if (!strncmp(lgopts[option_index].name,
> + "rx-none", 7)) {
> + printf("none of DCB,RSS or VMDQ mode\n");
> + port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
> + }
> +
> if (!strncmp(lgopts[option_index].name,
> CMD_LINE_OPT_PARSE_PTYPE,
> sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {
>
Why not just rely on the capabilities exposed by the driver?
Maxime
On Fri, Sep 10, 2021 at 10:34 AM Li, Miao <miao.li@intel.com> wrote:
>
> In l3fwd-power, there is default port configuration which requires RSS and IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-power will exit and report an error.
Maxime suggested to update the port configuration based on its capabilities.
For RSS, it would be something like what I proposed for OVS:
https://patchwork.ozlabs.org/project/openvswitch/patch/20210830101304.13689-1-david.marchand@redhat.com/
As for IPv4/UDP/TCP rx checksums, I am not sure there is any actual
requirement for this app.
Probably something to investigate wrt DO_RFC_1812_CHECKS.
Got it. I will change the codes and add the port configuration updating according to the device information. Thanks!
Miao
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, September 10, 2021 4:50 PM
> To: Li, Miao <miao.li@intel.com>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; dev@dpdk.org; Xia,
> Chenbo <chenbo.xia@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 5/5] examples/l3fwd-power: support
> virtio/vhost
>
> On Fri, Sep 10, 2021 at 10:34 AM Li, Miao <miao.li@intel.com> wrote:
> >
> > In l3fwd-power, there is default port configuration which requires RSS and
> IPV4/UDP/TCP checksum. Once device does not support these, the l3fwd-
> power will exit and report an error.
>
> Maxime suggested to update the port configuration based on its capabilities.
>
> For RSS, it would be something like what I proposed for OVS:
> https://patchwork.ozlabs.org/project/openvswitch/patch/20210830101304.1
> 3689-1-david.marchand@redhat.com/
>
> As for IPv4/UDP/TCP rx checksums, I am not sure there is any actual
> requirement for this app.
> Probably something to investigate wrt DO_RFC_1812_CHECKS.
>
>
> --
> David Marchand
@@ -1811,6 +1811,8 @@ parse_args(int argc, char **argv)
{"high-perf-cores", 1, 0, 0},
{"no-numa", 0, 0, 0},
{"enable-jumbo", 0, 0, 0},
+ {"vlan-strip", 0, 0, 0},
+ {"rx-none", 0, 0, 0},
{CMD_LINE_OPT_EMPTY_POLL, 1, 0, 0},
{CMD_LINE_OPT_PARSE_PTYPE, 0, 0, 0},
{CMD_LINE_OPT_LEGACY, 0, 0, 0},
@@ -1986,6 +1988,19 @@ parse_args(int argc, char **argv)
(unsigned int)port_conf.rxmode.max_rx_pkt_len);
}
+ if (!strncmp(lgopts[option_index].name,
+ "vlan-strip", 10)) {
+ printf("set vlan strip\n");
+ port_conf.rxmode.offloads =
+ DEV_RX_OFFLOAD_VLAN_STRIP;
+ }
+
+ if (!strncmp(lgopts[option_index].name,
+ "rx-none", 7)) {
+ printf("none of DCB,RSS or VMDQ mode\n");
+ port_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
+ }
+
if (!strncmp(lgopts[option_index].name,
CMD_LINE_OPT_PARSE_PTYPE,
sizeof(CMD_LINE_OPT_PARSE_PTYPE))) {