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 2E5BAA0C40; Wed, 28 Apr 2021 14:12:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C89640697; Wed, 28 Apr 2021 14:12:40 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 2710D40147 for ; Wed, 28 Apr 2021 14:12:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619611957; 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: in-reply-to:in-reply-to:references:references; bh=2ByWVvpxK+gvYwuPsG+3GnD5BEYEr6NnYcRVwZBk9Sk=; b=bFYeDHTGxWYm16Yu7WrBQzbwkXdh3YoI0qz4j5Im5XShuYVgm/YwBgnX3zHgImMCm29bqB vNhPLRJDXCOQaDSQPadijLnfO3a1DcFP5rajcQ4f68EfF58vU/iaGHLRzGomL3/PepyPDW OeoT+sZt3dZADzenIFXr1mfgGOpilfo= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-eb52IN9ROQK8eZd99Swsfg-1; Wed, 28 Apr 2021 08:12:32 -0400 X-MC-Unique: eb52IN9ROQK8eZd99Swsfg-1 Received: by mail-vs1-f70.google.com with SMTP id d1-20020a67ed810000b02901a9fcd861faso13753869vsp.9 for ; Wed, 28 Apr 2021 05:12:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2ByWVvpxK+gvYwuPsG+3GnD5BEYEr6NnYcRVwZBk9Sk=; b=Qgoh93FoxD0+s1S/JOm23IiIISmYROp7wRQikH+c83y9n20GRlHZEZEqwuqShikXui xFwiL88mfENzYZOUg+J40WjE2vKquVKYlR3WD0tROzLDnZEXk1HwQNyDo2JeHj7Gqflo tsoIpt7cAv/dJ+aCfkx7COKt+nI14Y/flBtRQz2/Evwu8jtq9AyW7xTGbwAJQU9drDTD m8/HCCBBALBCnQzul1MYkYlJM+irIK4/3zIhXL+wX/flZFViJNn2nl7TMH6rL/Qh6qSp IfrtG7QtwUspWkrMBX7yPkIAWvn6gAEZXwKDfvUoi3GayCNJGs9qpIxOE87E5O/cCPYw Bekw== X-Gm-Message-State: AOAM530UXEnJoE+wK6/3GUu1Kef4HgV49EmwtqfVAlNclZyn9RiLpHKk 7TPdvzwsxfxP7rlTmqR9Vi9yEFSKb0cTkkVObZUo7fjoQ4Lw4zCg0SyE3tlLzyilNGUVtxp/Fcl 1zffrgGjbBjGpPCoIFYQ= X-Received: by 2002:a67:fdd8:: with SMTP id l24mr14383748vsq.18.1619611952063; Wed, 28 Apr 2021 05:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD2eEQfrw9fihkh/4Pf2nRyl9b/Q2JpnqheRGzj4S0ejJiO/WuiPcVSTXcIwcINN/Q0NtbgqkvRtuA4aR+xNk= X-Received: by 2002:a67:fdd8:: with SMTP id l24mr14383719vsq.18.1619611951837; Wed, 28 Apr 2021 05:12:31 -0700 (PDT) MIME-Version: 1.0 References: <20210401095243.18211-1-david.marchand@redhat.com> <20210401095243.18211-3-david.marchand@redhat.com> <20210408075352.GR1650@platinum> In-Reply-To: <20210408075352.GR1650@platinum> From: David Marchand Date: Wed, 28 Apr 2021 14:12:20 +0200 Message-ID: To: Olivier Matz Cc: dev , Maxime Coquelin , Flavio Leitner , Ilya Maximets , Keith Wiles Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 2/5] net/tap: do not touch Tx offload flags 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 Sender: "dev" On Thu, Apr 8, 2021 at 9:53 AM Olivier Matz wrote: > > On Thu, Apr 01, 2021 at 11:52:40AM +0200, David Marchand wrote: > > Tx offload flags are of the application responsibility. > > Leave the mbuf alone and check for TSO where needed. > > > > Signed-off-by: David Marchand Self nack on this patch. > > Maybe the problem being solved should be better described in the commit > log. Is it a problem (other than cosmetic) to touch a mbuf in the Tx > function of a driver, where we could expect that the mbuf is owned by > the driver? > > The only problem I can think about is in case we transmit a direct mbuf > whose refcnt is increased, but I wonder how much this is really > supported: for instance, several drivers add vlans using > rte_vlan_insert() in their Tx path. This was my initial thought, as I suspected issues with applications which keep a refcount on the mbuf. But after more discussions offlist, it is hard to find a usecase for this. The gso library already touches the ol_flags from the input mbuf and this is documented in its API. Plus, my patch also has an issue. This library gives back an array of direct/indirect mbufs pointing at the data from the original mbuf. Those mbufs are populated with the original mbuf ol_flags but nothing has been done on the checksum in this data. The net/tap driver relies on this feature: mbuf_in is marked with PKT_TX_TCP_CKSUM so that the generated mbufs given back by the rte_gso library has this offload flag set and PKT_TX_TCP_SEG is not present anymore. Later in the net/tap tx handler, PKT_TX_TCP_CKSUM presence triggers tcp checksum computation. So this patch breaks the tso support in net/tap. Just for the record. As far as rte_vlan_insert() is concerned, it ensures that the mbuf is not shared. https://git.dpdk.org/dpdk/tree/lib/net/rte_ether.h#n352 -- David Marchand