From nobody Sun Feb 8 19:21:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1663951246; cv=none; d=zohomail.com; s=zohoarc; b=cxAbvBV1vZxmT8eKFmRvjHP/4sqSGgw0nJvoXFbM/VnAX1UAJ5yP5g6FC+lmmkLH+VTot2ECiQ2uIlhVigNXH7VFbyEOftuq/qTJENTuKAAd8fKc/uzo5GCTKi4+gCYfXyODVBNb7/fF07iXq3Jrx4IB8FCYWuO4ZFeJB+02A5w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663951246; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FG3Mj1csJ7FbeoY2zgdLrFVr7w1D2Zs//acRgBf+TRE=; b=a9b5QRfdeDdapO4tDl4Pv6hqkR5Pg6SbG9h2EZW7Udwsr+yefO3lKaDRQpAkO0euN0cZxCNlG71srm5JNDC9n6f+jPtUaVaN1J2gU2OzavTe/6vcdq1tfCjlcMf8+mx/VTPFOti5Uqdfd8BizXsAeLSZAOS0B3KOo4MN8ltq2g4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1663951246354900.1579519950899; Fri, 23 Sep 2022 09:40:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.410881.654053 (Exim 4.92) (envelope-from ) id 1oblj3-0004o3-1N; Fri, 23 Sep 2022 16:40:29 +0000 Received: by outflank-mailman (output) from mailman id 410881.654053; Fri, 23 Sep 2022 16:40:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oblj2-0004ni-Ug; Fri, 23 Sep 2022 16:40:28 +0000 Received: by outflank-mailman (input) for mailman id 410881; Fri, 23 Sep 2022 16:40:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oblj1-0003zv-CO for xen-devel@lists.xenproject.org; Fri, 23 Sep 2022 16:40:27 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6d4c0e39-3b5e-11ed-9647-05401a9f4f97; Fri, 23 Sep 2022 18:40:26 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id c11so791791wrp.11 for ; Fri, 23 Sep 2022 09:40:26 -0700 (PDT) Received: from 127.0.0.1localhost (188.28.201.74.threembb.co.uk. [188.28.201.74]) by smtp.gmail.com with ESMTPSA id x13-20020a5d60cd000000b0022af6c93340sm7717399wrt.17.2022.09.23.09.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 09:40:25 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6d4c0e39-3b5e-11ed-9647-05401a9f4f97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=FG3Mj1csJ7FbeoY2zgdLrFVr7w1D2Zs//acRgBf+TRE=; b=eE5aVrZKg1v/P9UeaHNz1t9u6KrDObJzPuHWUbsNB0CGvL2ozT6QO6y8RV3J4TvApK gPGLloFmul/9NycdPQzEdBinJ0njxpLdx/5DMi9pkPqxHexWAitmYT7B+590/zvfROM9 CIVg8YVhNarmc9WM95AOuXgoiDJPoZLmdOExh3cWbH26mGW6YjwixTE3hbClVdbEUOis 9uTUExsQwAPYQ75waTv9Um9hLpemVfJuIj+0GaxnBaIvAP3G5baJmEnOoa51UmzPE0/V 9wc+Ze+zqXKhGHGQroVMuqM6b/rlyf5FCzbF0pKQAhzaxGDoxQxA7E7iIWwRmyyPXktb EuHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=FG3Mj1csJ7FbeoY2zgdLrFVr7w1D2Zs//acRgBf+TRE=; b=PDUYkJvS55E7jbewHmaOR3gV/rGFlIPaB4COQizkHgTt6FELRhZZpzJjOjMbagFWGK Hhwo8d08/MsFT1jaNo6eKabQRZ7GhPlB0GxqfrCYLnXJNa9pL19vF7fxSE11P3sKw3tg xkSP2KF5AMqRIWGdHVHBZ076GXijHYVlhfy8zy9TRRqZc2VZY1H7X+jmPXZ9mEshfHtF prCPIFT387Kshds6qjUV9DyoJ2X+Assueldi7qbDTXz6g/zJiUIxb+fEtgSgVjYGzaVO zWLsRPdtYfnHkprvk9MkJTpo3cD70lpCeHvfWbwFPRh5NJrYVIlUEH35pwciuzCBuRgk Q7Kg== X-Gm-Message-State: ACrzQf3mTZzh5r3sRLPVqZSBK/3ZMMx51YFYbFHlWJHTEh+Aiq1+v1lW LLeckuWS2fM7NgB15javKvY= X-Google-Smtp-Source: AMsMyM7kN8lNHyV1w1d1RL8dD6evo1RUYO8Wx/UWQQUl5cn81n4HQTVjecLZI9rI0Uh/wzPOiMq83A== X-Received: by 2002:a5d:5452:0:b0:228:d6f0:dbeb with SMTP id w18-20020a5d5452000000b00228d6f0dbebmr5883466wrv.84.1663951226140; Fri, 23 Sep 2022 09:40:26 -0700 (PDT) From: Pavel Begunkov To: netdev@vger.kernel.org Cc: "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Wei Liu , Paul Durrant , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, "Michael S . Tsirkin" , Jason Wang , Pavel Begunkov Subject: [PATCH net-next 3/4] vhost/net: use struct ubuf_info_msgzc Date: Fri, 23 Sep 2022 17:39:03 +0100 Message-Id: <126df081c74ecf06de383b4fdaad5080346f93dd.1663892211.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1663951248171100003 Content-Type: text/plain; charset="utf-8" struct ubuf_info will be changed, use ubuf_info_msgzc instead. Signed-off-by: Pavel Begunkov --- drivers/vhost/net.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 68e4ecd1cc0e..d7a04d573988 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -118,7 +118,7 @@ struct vhost_net_virtqueue { /* Number of XDP frames batched */ int batched_xdp; /* an array of userspace buffers info */ - struct ubuf_info *ubuf_info; + struct ubuf_info_msgzc *ubuf_info; /* Reference counting for outstanding ubufs. * Protected by vq mutex. Writers must also take device mutex. */ struct vhost_net_ubuf_ref *ubufs; @@ -382,8 +382,9 @@ static void vhost_zerocopy_signal_used(struct vhost_net= *net, } =20 static void vhost_zerocopy_callback(struct sk_buff *skb, - struct ubuf_info *ubuf, bool success) + struct ubuf_info *ubuf_base, bool success) { + struct ubuf_info_msgzc *ubuf =3D uarg_to_msgzc(ubuf_base); struct vhost_net_ubuf_ref *ubufs =3D ubuf->ctx; struct vhost_virtqueue *vq =3D ubufs->vq; int cnt; @@ -871,7 +872,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, s= truct socket *sock) size_t len, total_len =3D 0; int err; struct vhost_net_ubuf_ref *ubufs; - struct ubuf_info *ubuf; + struct ubuf_info_msgzc *ubuf; bool zcopy_used; int sent_pkts =3D 0; =20 @@ -907,14 +908,14 @@ static void handle_tx_zerocopy(struct vhost_net *net,= struct socket *sock) ubuf =3D nvq->ubuf_info + nvq->upend_idx; vq->heads[nvq->upend_idx].id =3D cpu_to_vhost32(vq, head); vq->heads[nvq->upend_idx].len =3D VHOST_DMA_IN_PROGRESS; - ubuf->callback =3D vhost_zerocopy_callback; ubuf->ctx =3D nvq->ubufs; ubuf->desc =3D nvq->upend_idx; - ubuf->flags =3D SKBFL_ZEROCOPY_FRAG; - refcount_set(&ubuf->refcnt, 1); + ubuf->ubuf.callback =3D vhost_zerocopy_callback; + ubuf->ubuf.flags =3D SKBFL_ZEROCOPY_FRAG; + refcount_set(&ubuf->ubuf.refcnt, 1); msg.msg_control =3D &ctl; ctl.type =3D TUN_MSG_UBUF; - ctl.ptr =3D ubuf; + ctl.ptr =3D &ubuf->ubuf; msg.msg_controllen =3D sizeof(ctl); ubufs =3D nvq->ubufs; atomic_inc(&ubufs->refcount); --=20 2.37.2