From: Ferruh Yigit <ferruh.yigit@amd.com>
To: "lihuisong (C)" <lihuisong@huawei.com>,
Ivan Malov <ivan.malov@arknetworks.am>
Cc: dev@dpdk.org, Aman Singh <aman.deep.singh@intel.com>,
Yuying Zhang <yuying.zhang@intel.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Bernard Iremonger <bernard.iremonger@intel.com>,
Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>,
liuyonglong@huawei.com
Subject: Re: [PATCH v1 1/3] app/testpmd: fix random value to set tunnel TSO
Date: Sat, 11 Nov 2023 03:22:42 +0000 [thread overview]
Message-ID: <dbf1bbfc-ff38-46f2-a287-2ee7bfb962bf@amd.com> (raw)
In-Reply-To: <75d6ecbb-42b6-e591-754f-a70d1aa29fc5@huawei.com>
On 11/11/2023 1:17 AM, lihuisong (C) wrote:
> Hi,
>
> Thanks for your review.
>
>
> 在 2023/11/10 19:42, Ivan Malov 写道:
>> Hi,
>>
>> (minor question below)
>>
>> On Fri, 10 Nov 2023, Huisong Li wrote:
>>
>>> Currently, testpmd set tunnel TSO offload even if fail to get dev_info.
>>> In this case, the 'tx_offload_capa' in dev_info is a random value,
>>>
>>> Fixes: 6f51deb903b2 ("app/testpmd: check status of getting ethdev info")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>> ---
>>> app/test-pmd/cmdline.c | 29 ++++++++++++++---------------
>>> 1 file changed, 14 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>>> index 05078f8377..25462bdbfc 100644
>>> --- a/app/test-pmd/cmdline.c
>>> +++ b/app/test-pmd/cmdline.c
>>> @@ -5035,39 +5035,33 @@ struct cmd_tunnel_tso_set_result {
>>> portid_t port_id;
>>> };
>>>
>>> -static struct rte_eth_dev_info
>>> -check_tunnel_tso_nic_support(portid_t port_id)
>>> +static void
>>> +check_tunnel_tso_nic_support(portid_t port_id, uint64_t
>>> tx_offload_capa)
>>> {
>>> - struct rte_eth_dev_info dev_info;
>>
>> Why not just initialise this to zeros?
> The main purpose of this function is to check which tunnel TSO offload
> port supports instead of getting dev_info, right?
>
Agree with Huisong, zeroing out the dev_info doesn't help much, this
function still will fail to do its job, and caller function will still
get wrong dev info.
>>
>>> -
>>> - if (eth_dev_info_get_print_err(port_id, &dev_info) != 0)
>>> - return dev_info;
>>> -
>>> - if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: VXLAN TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: GRE TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: IPIP TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - if (!(dev_info.tx_offload_capa &
>>> RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: GENEVE TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_IP_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: IP TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - if (!(dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO))
>>> + if (!(tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO))
>>> fprintf(stderr,
>>> "Warning: UDP TUNNEL TSO not supported therefore not
>>> enabled for port %d\n",
>>> port_id);
>>> - return dev_info;
>>> }
>>>
>>> static void
>>> @@ -5077,6 +5071,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
>>> {
>>> struct cmd_tunnel_tso_set_result *res = parsed_result;
>>> struct rte_eth_dev_info dev_info;
>>> + int ret;
>>>
>>> if (port_id_is_invalid(res->port_id, ENABLED_WARN))
>>> return;
>>> @@ -5088,7 +5083,11 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
>>> if (!strcmp(res->mode, "set"))
>>> ports[res->port_id].tunnel_tso_segsz = res->tso_segsz;
>>>
>>> - dev_info = check_tunnel_tso_nic_support(res->port_id);
>>> + ret = eth_dev_info_get_print_err(res->port_id, &dev_info);
>>> + if (ret != 0)
>>> + return;
>>> +
>>> + check_tunnel_tso_nic_support(res->port_id,
>>> dev_info.tx_offload_capa);
>>> if (ports[res->port_id].tunnel_tso_segsz == 0) {
>>> ports[res->port_id].dev_conf.txmode.offloads &=
>>> ~(RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
>>> --
>>> 2.33.0
>>>
>>>
>>
>> Thank you.
>>
>> .
next prev parent reply other threads:[~2023-11-11 3:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 8:19 [PATCH v1 0/3] app/testpmd: fix the command " Huisong Li
2023-11-10 8:19 ` [PATCH v1 1/3] app/testpmd: fix random value " Huisong Li
2023-11-10 11:42 ` Ivan Malov
2023-11-11 1:17 ` lihuisong (C)
2023-11-11 3:22 ` Ferruh Yigit [this message]
2023-11-10 8:19 ` [PATCH v1 2/3] app/testpmd: add the explicit check for tunnel TSO offload Huisong Li
2023-11-11 3:30 ` Ferruh Yigit
2023-11-11 4:27 ` lihuisong (C)
2023-11-10 8:19 ` [PATCH v1 3/3] app/testpmd: fix unnecessary change when set tunnel TSO Huisong Li
2023-11-11 3:37 ` Ferruh Yigit
2023-11-11 4:28 ` lihuisong (C)
2023-11-11 4:59 ` [PATCH v2 0/3] app/testpmd: fix the command to " Huisong Li
2023-11-11 4:59 ` [PATCH v2 1/3] app/testpmd: fix random value " Huisong Li
2023-11-11 4:59 ` [PATCH v2 2/3] app/testpmd: add the explicit check for tunnel TSO offload Huisong Li
2023-11-11 4:59 ` [PATCH v2 3/3] app/testpmd: fix unnecessary change when set tunnel TSO Huisong Li
2023-11-11 5:59 ` [PATCH v2 0/3] app/testpmd: fix the command to " 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=dbf1bbfc-ff38-46f2-a287-2ee7bfb962bf@amd.com \
--to=ferruh.yigit@amd.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=ivan.ilchenko@oktetlabs.ru \
--cc=ivan.malov@arknetworks.am \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=yuying.zhang@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).