From: "Hu, Jiayu" <jiayu.hu@intel.com>
To: "Ma, WenwuX" <wenwux.ma@intel.com>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
"Xia, Chenbo" <chenbo.xia@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Wang, Yinan" <yinan.wang@intel.com>,
"He, Xingguang" <xingguang.he@intel.com>
Subject: RE: [PATCH] net/vhost: get csum offload capabilities of vhost backend
Date: Tue, 15 Mar 2022 02:56:03 +0000 [thread overview]
Message-ID: <0af0a6ff16424f189906260d797ed6c2@intel.com> (raw)
In-Reply-To: <20220217151628.441165-1-wenwux.ma@intel.com>
Hi Wenwu,
> -----Original Message-----
> From: Ma, WenwuX <wenwux.ma@intel.com>
> Sent: Thursday, February 17, 2022 11:16 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Wang, Yinan
> <yinan.wang@intel.com>; He, Xingguang <xingguang.he@intel.com>; Ma,
> WenwuX <wenwux.ma@intel.com>
> Subject: [PATCH] net/vhost: get csum offload capabilities of vhost backend
>
> The current vhost backend lacks csum offloads information, which will cause
> testpmd command such as "csum set tcp hw <port_id>" to fail. This patch
> adds the information according to the device features.
Vhost-pmd cannot report correct checksum offloading capabilities, since
feature negotiation may happen after vhost-pmd device creation. It's good
to see there is a solution for it, IMO.
>
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
> drivers/net/vhost/rte_eth_vhost.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/net/vhost/rte_eth_vhost.c
> b/drivers/net/vhost/rte_eth_vhost.c
> index 070f0e6dfd..7593d5a9ae 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -1281,6 +1281,24 @@ eth_dev_info(struct rte_eth_dev *dev,
> RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
> dev_info->rx_offload_capa = RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
>
> + if (internal->vid != -1) {
> + uint64_t features = 0;
> + if (rte_vhost_get_negotiated_features(internal->vid,
> &features) != 0)
> + return 0;
> +
> + if (features & (1ULL << VIRTIO_NET_F_CSUM)) {
> + dev_info->tx_offload_capa |=
> RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
The spec says "VIRTIO_NET_F_CSUM: host handles pkts w/ partial csum".
If this feature is negotiated, it means vhost pmd supports to receive packets
with partial checksum, right? So VIRTIO_NET_F_CSUM should represent Rx
offloading capabilities for vhost pmd.
> +
> RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
> +
> RTE_ETH_TX_OFFLOAD_IPV4_CKSUM;
> + }
> +
> + if (features & (1ULL << VIRTIO_NET_F_GUEST_CSUM)) {
> + dev_info->rx_offload_capa |=
Same as above.
Thanks,
Jiayu
next prev parent reply other threads:[~2022-03-15 2:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 15:16 Wenwu Ma
2022-03-15 2:56 ` Hu, Jiayu [this message]
2022-05-05 14:15 ` Maxime Coquelin
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=0af0a6ff16424f189906260d797ed6c2@intel.com \
--to=jiayu.hu@intel.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=wenwux.ma@intel.com \
--cc=xingguang.he@intel.com \
--cc=yinan.wang@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).