Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp16559rdh; Wed, 20 Dec 2023 14:27:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkdjZyJrw3bWonJlS9/aa1QnmWHBuZSEi4d3+00Snun0/Y/98gOHMUIQe+dSQ00lC+gop0 X-Received: by 2002:a17:903:2444:b0:1d0:83bc:564c with SMTP id l4-20020a170903244400b001d083bc564cmr13728144pls.51.1703111255582; Wed, 20 Dec 2023 14:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703111255; cv=none; d=google.com; s=arc-20160816; b=JfDDvJux+vvx5oHUvHWdBJD7ztQw/L4Y6s7/vD3MCQnT9hnl8Df3Opxr9lDRlEHOEb ldQb75pG9DuLXc9qDxYiT4Is/2CAFJq4iOMmqkSCSJcwBxn/nILhHGpzPnn/JpNWhga1 LkE6d8hAj5bLJMN5YWZZkpwI2kgk4NzROXhGO/ipaRJBsEpxYrzBREH1Yhy3lMm3qDzB Dsirmc1o8fe6efQquk2H+1edqRnipQcQlqMKd4FofAfBBscbM+6Dc7/lb0K2ZnEvFYMo HlreV1hrAkALpAsXKJi4WO2EF9SbPipYuMHyGbuqdBn0HENxddhaBWdMRQzZnbe1p8Z2 x+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=Dx3B6aLRQGDHWIOJfDNBvVD3RlXkr+3jhLG4738eUjE=; fh=JlPK37Up5EiBiZMpR+3rbUHDZrxBspzZ+EmMm14SzR0=; b=v62l90Wn/Kdc+EMWuBHGhukcj1n2dXiSJFna4EzYYaz4i3YCe6IPui1lSXedTMhqU8 abKxtM2EckkWPg8XVJNLnWzE5k3b/YN31dulrzhmN0ERInb2vcP2Z0wVpIGVzoK7cdqg thGCZmZP0fYLxuPVafCiYttMmv8uMrc7ose58Rvf4WGdxBHYVbAnpmgfUuH6gBdN7Fgn gG+vh1U3ngvKGzHdIEjqCQGLvjh/g4dp6wE+irOAEyMHvu8Gj0poRZtH+hS7CTijXOZB Gi90qTxK4/t49K+WPnK7SLIqnEtFrvUIhlY6Kb6mu7hxujEVDuZVUWCTs/1MK6BDJ9wb /GVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=QQ2nudT2; spf=pass (google.com: domain of linux-kernel+bounces-7477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id je15-20020a170903264f00b001d405784898si1691plb.487.2023.12.20.14.27.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 14:27:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=QQ2nudT2; spf=pass (google.com: domain of linux-kernel+bounces-7477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0F28E28A56C for ; Wed, 20 Dec 2023 21:45:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2F694AF81; Wed, 20 Dec 2023 21:45:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QQ2nudT2" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD34149F66 for ; Wed, 20 Dec 2023 21:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--almasrymina.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-5e8e0c7f9a8so1918737b3.0 for ; Wed, 20 Dec 2023 13:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703108711; x=1703713511; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Dx3B6aLRQGDHWIOJfDNBvVD3RlXkr+3jhLG4738eUjE=; b=QQ2nudT2J+0/gyYlb4aFR4GB1GA9nYXGLGGlkwgTAFDf2nttTsqQ8jKu8mlH8lGNPW KCTcxPUN8vkn4s7EXCKVEYjnScp89S2zQvvWJdG+Gb4mq1w2DGrsktLgUjJSz01In2hn nbG77gGNJVQ8o7N+ODDBEFcUrDOEnxSeewm1YIW/BDWU3s/oNzeor5fgtLVdyCFTVhvr GYeHhrKhFMCvBy/EyeS376WEoQYFcJmTwenkANWzHdXvG6PPRflXGVocePVfpRrwDM6Y tAAqjYwAmmOeW/MMMc+dVyQG5EJofnsxMMIQEdGRhzhJyh/B9wX+/tJ/S8QusrQr4865 azgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703108711; x=1703713511; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Dx3B6aLRQGDHWIOJfDNBvVD3RlXkr+3jhLG4738eUjE=; b=Y8e1TY+zdqwHLLV9eLWeV+EYZdSqkHb5nJGALKgS+0x1h1jTeJVPzX8NTfPXio18jT uLW0Ogib21swr4pj+idQFx287cA0ngg+e69qxzv9etg6EUDTDl17+FmDGdWGzTXIJ+4H v/8puWli36OP3XarSgSRvJuERp0VwPp4zq0TO39etT8fSs+ZCH0/KIpCAhr1lZJS+NMK bDqScGxin07961MtdHumTCRC+AuJk4gSnD+7sYOwcQr3gw1vulybIlg7ssslye+cNAJE Snd2qs2GqDhxV7li985TD1qgxCKGGhrDEemjxL114xxy4NA97u2g4YkZgMenpoB7rnXh O8uA== X-Gm-Message-State: AOJu0YzrZ3JL0L9xmQ8rS6TM16ngqYxvwgzEJ5ljZ1mMmzddHXbvam0r 36MZcw/+O+Nbu+gJzm4fINSaeKQ4FR0VUYRTdWxOgNK14a3fsZPPJEwJijmtuG1cWKsk80oD8Mx j1f7oiEh4NOY/tCBsnJgGC3vQfUqJ8/pfVzt7/mqjSR4LluwDjkyCsZQHZeQBfyIP5hlRmfZPMO 88Mbu4uXs= X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:13cc:a33:a435:3fe9]) (user=almasrymina job=sendgmr) by 2002:a05:690c:c01:b0:5d6:f1d2:2e5e with SMTP id cl1-20020a05690c0c0100b005d6f1d22e5emr170815ywb.0.1703108710831; Wed, 20 Dec 2023 13:45:10 -0800 (PST) Date: Wed, 20 Dec 2023 13:45:00 -0800 In-Reply-To: <20231220214505.2303297-1-almasrymina@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231220214505.2303297-1-almasrymina@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231220214505.2303297-2-almasrymina@google.com> Subject: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers From: Mina Almasry To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev Cc: Mina Almasry , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Hajnoczi , Stefano Garzarella , David Howells , Jason Gunthorpe , "=?UTF-8?q?Christian=20K=C3=B6nig?=" , Shakeel Butt , Yunsheng Lin , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Minor fix for virtio: code wanting to access the fields inside an skb frag should use the skb_frag_*() helpers, instead of accessing the fields directly. This allows for extensions where the underlying memory is not a page. Signed-off-by: Mina Almasry --- v2: - Also fix skb_frag_off() + skb_frag_size() (David) - Did not apply the reviewed-by from Stefano since the patch changed relatively much. --- net/vmw_vsock/virtio_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index f495b9e5186b..1748268e0694 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -153,10 +153,10 @@ virtio_transport_send_pkt_work(struct work_struct *work) * 'virt_to_phys()' later to fill the buffer descriptor. * We don't touch memory at "virtual" address of this page. */ - va = page_to_virt(skb_frag->bv_page); + va = page_to_virt(skb_frag_page(skb_frag)); sg_init_one(sgs[out_sg], - va + skb_frag->bv_offset, - skb_frag->bv_len); + va + skb_frag_off(skb_frag), + skb_frag_size(skb_frag)); out_sg++; } } -- 2.43.0.472.g3155946c3a-goog