Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp422510pxj; Fri, 14 May 2021 06:46:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2aa0AbFexnCQSz+X2nOgS/aWnNDjOQTig38q5XktgJNN40/02lxA04WTyt4F/WBO/BXXN X-Received: by 2002:a02:9109:: with SMTP id a9mr43682182jag.93.1621000006618; Fri, 14 May 2021 06:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621000006; cv=none; d=google.com; s=arc-20160816; b=ilVquPlNqsjxx3G6OXaMJZ0vehWgbtdS1BdCFjO2nuOGwhymsGeT7qoaSkMDF8mynY xwvvBd62uOrD4dnuZJqs/SpThgOo4LeR97b1K9pT4aURlzxcm1vfOKsFP3hK9KIICga2 J01fViS3d9zxkVYVAX1YRDjeFBkYJV4y5n5Gk0XaRvWtSq3bWMTdw67Mfc2sdt4ehqyF yi3peRU80iMoLFrwgue/i6rFXxzOHm3E5AmaKOQwFWddcb9ltaniR3HgUfbYGurGi/lH en/d3odseK1fJHUP6aAx5mZpq18dezLenFmrFnnhVPV3DNHYQSrzGjqe/Toib4v3xw+3 vWsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bE06xAXCXCRjHxZIVvCKZFVX3we62E4nDMf17dk25ts=; b=nDRZZBuJJMECi+SCLD7ONVt4JA02/t+3CI6xaX+TERJ4QiIFc8Fi6IPe0IRC+onz86 07KnqjV8tPZCO279eAxasTuFHuaYjMJd3dxwvXC9IFKjhJyCJm5Kw1/8tko8uQVIMyk1 7MntekNigKHoJaJpTpD+rzhHSrvXHx49j2BECRa5djRFG0KmX2q6o+yc9Bp9p82iqvmE VVWlK9q91X9KrCUR/pcMKuLTOD/JE4qYLtvNzPKpYnDVMPzYm/OlSUFfRWnYuUpiS3/3 dFh8dHdbylTz5U0Zd+JxayICLLYeiLgm+aZcKVlPCrh2/aTcerpjmLClMDE9kRgogyz3 KQAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20150623.gappssmtp.com header.s=20150623 header.b=N1aj48wf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si7349921jas.111.2021.05.14.06.46.32; Fri, 14 May 2021 06:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20150623.gappssmtp.com header.s=20150623 header.b=N1aj48wf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhENFuQ (ORCPT + 99 others); Fri, 14 May 2021 01:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbhENFuQ (ORCPT ); Fri, 14 May 2021 01:50:16 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80D4BC06174A for ; Thu, 13 May 2021 22:49:05 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id d25-20020a0568300459b02902f886f7dd43so12170953otc.6 for ; Thu, 13 May 2021 22:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bE06xAXCXCRjHxZIVvCKZFVX3we62E4nDMf17dk25ts=; b=N1aj48wfBA8fNXog/TNxwKCt1hOpvt3nk6RJEDP4coWUX2s7+9OH6R3QaLITJoxTrE Zzn+EXzYJhzRVDLXDunJXDPWRAQOP7W0GEDCsedZbqtO5C8ePdg5FixKLFwOhXriy6VH 0f/WGx3ISGrBqNorGa4/HjdG7FK6YohsZNy6G4jAB4l4uz+izg3LXc2SkhVwDmV+GEyP auhpYNKA4q4C2ZCYunWce4JTb6nEDPr5I00fsv+hvFpsdf9jKvsVG8IsDByybgV9u4Rg 4i6eHzJJ/52mWwaB9g+oMNmDR8u/HM6RUnuhbWWsKM3J5FXGw7XOdMVskvjFiYXhYysj ordg== 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=bE06xAXCXCRjHxZIVvCKZFVX3we62E4nDMf17dk25ts=; b=quFndevLFOHaPFGMISwBBz1s/+k+TvApfK9Enhm8DPe1QDqgvD8j5bpVKpNsqvHlLW XW8R1oQYARawHGqQHkm5S8UjCN75JYtB5eAYIWL9ny+yrIIr+vR/dMJ2k8/NZi0wY2AR ZmgByMoHdzmhHsnS0E1edMHtxGiCpJPCY8yXf6qV3NkaQ1nzyx7yc8xNMZkgL2/6BC2P gEfECsWsZEa49F7uHGclXOgNeoiP05RqFNSrrrOrQarWfZu86psZ90e6c8ZHAzZQEbW3 mEcGA5dMvN4Vb2B8Y3NPmLqDPym/gZXX75sdvz92EC3roFeU7eIc5jjcUrc99utik1LB ZB0w== X-Gm-Message-State: AOAM533wCoAn8h0aLb/ZwXVVZFVQ3kt7zaUrEtRkGqkWd/OoSTeCp1ZJ 3dZCepQCT4DXWBalFqnWcVCw0KfaM01puud+2geoiQ== X-Received: by 2002:a9d:8ce:: with SMTP id 72mr39720820otf.220.1620971344860; Thu, 13 May 2021 22:49:04 -0700 (PDT) MIME-Version: 1.0 References: <20210511044253.469034-1-yuri.benditovich@daynix.com> <20210511044253.469034-5-yuri.benditovich@daynix.com> <89759261-3a72-df6c-7a81-b7a48abfad44@redhat.com> In-Reply-To: From: Yuri Benditovich Date: Fri, 14 May 2021 08:48:52 +0300 Message-ID: Subject: Re: [PATCH 4/4] tun: indicate support for USO feature To: Willem de Bruijn Cc: Jason Wang , Yan Vugenfirer , davem , Jakub Kicinski , mst , netdev , linux-kernel , virtualization Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 11:43 PM Willem de Bruijn wrote: > > > > > > > So the question is what to do now: > > > > > > A) > > > > > > Finalize patches for guest TX and respective QEMU patches > > > > > > Prepare RFC patches for guest RX, get ack on them > > > > > > Change the spec > > > > > > Finalize patches for guest RX according to the spec > > > > > > > > > > > > B) > > > > > > Reject the patches for guest TX > > > > > > Prepare RFC patches for everything, get ack on them > > > > > > Change the spec > > > > > > Finalize patches for everything according to the spec > > > > > > > > > > > > I'm for A) of course :) > > > > > > > > > > I'm for B :) > > > > > > > > > > The reasons are: > > > > > > > > > > 1) keep the assumption of tun_set_offload() to simply the logic and > > > > > compatibility > > > > > 2) it's hard or tricky to touch guest TX path only (e.g the > > > > > virtio_net_hdr_from_skb() is called in both RX and TX) > > > > > > > > I suspect there is _some_ misunderstanding here. > > > > I did not touch virtio_net_hdr_from_skb at all. > > > > > > > > > > Typo, actually I meant virtio_net_hdr_to_skb(). > > OK. > > 2) tun_get_user() which is guest TX - this is covered > > 3) tap_get_user() which is guest TX - this is covered > > 4) {t}packet_send() which is userspace TX - this is OK, the userspace > > does not have this feature, it will never use USO > > What do you mean exactly? I can certainly imagine packet socket users > that could benefit from using udp gso. I've just tried to understand whether we have a real functional problem due to the fact that I define the USO feature only for guest TX path. This set of patches modifies virtio_net_hdr_to_skb and Jason's comment was that this procedure is called in both guest TX and RX, there are 4 places where the virtio_net_hdr_to_skb is called, userspace TX is one of them. AFAIU userspace 'socket' and 'user' backends of qemu do not have any offloads at all so they will never use USO also. Sorry for misunderstanding if any. > > When adding support for a new GSO type in virtio_net_hdr, it ideally > is supported by all users of that interface. Alternatively, if some > users do not support the flag, a call that sets the flag has to > (continue to) fail hard, so that we can enable it at a later time. I agree of course. IMO this is what I've tried to do. I did not have in the initial plan to make Linux virtio-net to use the USO at all but this should not present any problem (if I'm not mistaken).