From patchwork Thu May 5 10:27:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 110688 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00EBCA04FF; Thu, 5 May 2022 12:27:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E10244281A; Thu, 5 May 2022 12:27:39 +0200 (CEST) Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.133.74]) by mails.dpdk.org (Postfix) with ESMTP id 6101940E5A for ; Thu, 5 May 2022 12:27:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651746457; 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; bh=bWG2upSYPP0l0OKgajG99rK1hRh+sPxAwv3OiBGMBhs=; b=dHJ1pZzt50lEHCmY0E40v9E18uf67ZqsAplT46WXlyl99fohQ4F+KGUXrShwCJoeGK2nDp RZbD9+Jq0dkqA3G7f7Q3y38Qyq75uP5Z0ue3GH/Xl//jPuVG+9fZlVKe8V2Be9z61zibMr 9es3l6h+RQhFBJKVpL08E+RbfiA1Sro= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-tM246XEzMDKWoymH-EeLYg-1; Thu, 05 May 2022 06:27:34 -0400 X-MC-Unique: tM246XEzMDKWoymH-EeLYg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B17C299E747; Thu, 5 May 2022 10:27:34 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EBC1415F2E; Thu, 5 May 2022 10:27:32 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, jasowang@redhat.com, chenbo.xia@intel.com, david.marchand@redhat.com, olivier.matz@6wind.com Cc: stable@dpdk.org, Maxime Coquelin Subject: [PATCH 0/6] Vhost checksum offload improvements Date: Thu, 5 May 2022 12:27:23 +0200 Message-Id: <20220505102729.821075-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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 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 This series aims at improving Vhost checksum offloading support. The first patch reverts overwritting MAC address in testpmd CSUM forward mode. This is required to be able to test checksum offloading with real traffic. MAC forwarding mode should be used if the MAC addresses need to be changed. Second patch is a Vhost library fix to be compliant with the Virtio specification, which requires that the pseudo-header checksum is being set by the device when offloading the checksum to the guest. Third patch enables the compliant offloading mode of Vhost library in Vhost PMD by default, since the legacy mode violates the mbuf API by setting Tx flags in the receive path. A new devarg is introduced for application willing to use the legacy mode. Fourth patch is just a small cleanup to represent a boolean value as a boolean. The two last patches introduces compatibility layers that performs checksum in SW when the ethdev and Virtio features are not aligned. Note that the two last patches are not tagged as fixes because they rely on the new compliant offload mode of Vhost library, and so would casue an ABI breakage if backported. With this series, it is now possible to perform IO forwarding between a vhost-user port and a Vitio-user with kernel backend port even if the guest has negotiated VIRTIO_NET_F_CSUM. With csum forward mode, it now works whathever the offloading configuration set either on Virtio or Ethdev sides. Maxime Coquelin (6): Revert "app/testpmd: modify mac in csum forwarding" vhost: fix missing enqueue pseudo-header calculation net/vhost: enable compliant offloading mode net/vhost: make VLAN stripping flag a boolean net/vhost: perform SW checksum in Rx path net/vhost: perform SW checksum in Tx path app/test-pmd/csumonly.c | 4 - doc/guides/nics/features/vhost.ini | 1 + doc/guides/nics/vhost.rst | 6 ++ drivers/net/vhost/rte_eth_vhost.c | 166 ++++++++++++++++++++++++++++- lib/vhost/virtio_net.c | 10 ++ 5 files changed, 179 insertions(+), 8 deletions(-)