From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7B72A00BE; Tue, 15 Mar 2022 03:56:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62A4D40395; Tue, 15 Mar 2022 03:56:09 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 629BF4014F for ; Tue, 15 Mar 2022 03:56:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647312967; x=1678848967; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VfHFZq+U4GJ7O27YDqS8Qknae6jx0z9fPVW6YqGtShs=; b=nNt9OnLUN5+oXu362AOx3yrFshlmODsg9ILLkDKpLN0mnKTtxkJsz0zq jzal1ukPbDkrwx/Vhv/qXb+5n7VEmZoDWM3Vjupu5Drun7OQOaak4qGm9 a9KJ1Jh+oHrJBL1lrF0grdbLpymKDSra6krCoUcPQyvFqqPRxI9nLTjzi HavwpcmHNcyD0boJ0liNOQ6WWstswGsswlADUz9atnFci1h0fsbiXzXYE i9FjlnWXdxJwcTIMrvDn+AblhGq29iF/yf3MJZ0ePamBQ7D5cmxiQQG0q RhykpvnNepOWBP4QDJbfIdKz6D35fgQsxCtliYruHXOavYjF0uYaUIaJL A==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="253758546" X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="253758546" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 19:56:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="782910419" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga006.fm.intel.com with ESMTP; 14 Mar 2022 19:56:06 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 19:56:05 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 15 Mar 2022 10:56:03 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.2308.021; Tue, 15 Mar 2022 10:56:03 +0800 From: "Hu, Jiayu" To: "Ma, WenwuX" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" CC: "dev@dpdk.org" , "Wang, Yinan" , "He, Xingguang" Subject: RE: [PATCH] net/vhost: get csum offload capabilities of vhost backend Thread-Topic: [PATCH] net/vhost: get csum offload capabilities of vhost backend Thread-Index: AQHYI85tEn6U4drm6kaYuTIRZcyIg6y/3gKQ Date: Tue, 15 Mar 2022 02:56:03 +0000 Message-ID: <0af0a6ff16424f189906260d797ed6c2@intel.com> References: <20220217151628.441165-1-wenwux.ma@intel.com> In-Reply-To: <20220217151628.441165-1-wenwux.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Wenwu, > -----Original Message----- > From: Ma, WenwuX > Sent: Thursday, February 17, 2022 11:16 PM > To: maxime.coquelin@redhat.com; Xia, Chenbo > Cc: dev@dpdk.org; Hu, Jiayu ; Wang, Yinan > ; He, Xingguang ; Ma, > WenwuX > Subject: [PATCH] net/vhost: get csum offload capabilities of vhost backen= d >=20 > The current vhost backend lacks csum offloads information, which will cau= se > testpmd command such as "csum set tcp hw " 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. >=20 > Signed-off-by: Wenwu Ma > --- > drivers/net/vhost/rte_eth_vhost.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > 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 =3D RTE_ETH_RX_OFFLOAD_VLAN_STRIP; >=20 > + if (internal->vid !=3D -1) { > + uint64_t features =3D 0; > + if (rte_vhost_get_negotiated_features(internal->vid, > &features) !=3D 0) > + return 0; > + > + if (features & (1ULL << VIRTIO_NET_F_CSUM)) { > + dev_info->tx_offload_capa |=3D > 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 packe= ts 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 |=3D Same as above. Thanks, Jiayu