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 237E3A04A2; Mon, 31 Jan 2022 11:04:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC0DE41163; Mon, 31 Jan 2022 11:04:05 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 17D7A40E25 for ; Mon, 31 Jan 2022 11:04:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643623443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8lXzLwyoe9uEieP/kBRLXkgzZCjK3sz3bb13IHoywbY=; b=N1tFRZZ3AAAm6XEDQlW3kth/JKmgLGuCIavgiaYKqzO4sw2LlXjDAsMiC0X5SPv5EpSjKh EkKG7k/KlUpqxfe2cvtqX5LU783QTEOozESa51tgrQ234wT9PON7PszLpfw37TJfsxYopn kvug6q2cClA5MPnhdAJ7fenGwgqkqu0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-GL-PMlH_NQ6hxY22YE51YA-1; Mon, 31 Jan 2022 05:04:01 -0500 X-MC-Unique: GL-PMlH_NQ6hxY22YE51YA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFDFB1926DA0; Mon, 31 Jan 2022 10:04:00 +0000 (UTC) Received: from [10.39.208.24] (unknown [10.39.208.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05A476E4D2; Mon, 31 Jan 2022 10:03:59 +0000 (UTC) Message-ID: Date: Mon, 31 Jan 2022 11:03:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] net/virtio: include ipv4 cksum to support cksum offload capability To: Harold Huang , dev@dpdk.org Cc: Chenbo Xia References: <20220107115312.280036-1-baymaxhuang@gmail.com> From: Maxime Coquelin In-Reply-To: <20220107115312.280036-1-baymaxhuang@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Harold, On 1/7/22 12:53, Harold Huang wrote: > Device cksum offload capability usually include ipv4 cksum, tcp and udp > cksum offload capability. The application such as OVS usually negotiate > with the drive like this to enable cksum offload. > > Signed-off-by: Harold Huang > --- > drivers/net/virtio/virtio_ethdev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index c2588369b2..65b03bf0e4 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -3041,6 +3041,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_SCATTER; > if (host_features & (1ULL << VIRTIO_NET_F_GUEST_CSUM)) { > dev_info->rx_offload_capa |= > + RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | > RTE_ETH_RX_OFFLOAD_TCP_CKSUM | > RTE_ETH_RX_OFFLOAD_UDP_CKSUM; > } > @@ -3055,6 +3056,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > RTE_ETH_TX_OFFLOAD_VLAN_INSERT; > if (host_features & (1ULL << VIRTIO_NET_F_CSUM)) { > dev_info->tx_offload_capa |= > + RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | > RTE_ETH_TX_OFFLOAD_UDP_CKSUM | > RTE_ETH_TX_OFFLOAD_TCP_CKSUM; > } I'm not sure to understand why this is needed, as Vhost lib will always ensure the IP csum has been calculated. Could you please elaborate? Thanks, Maxime