Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp25194rdb; Sun, 17 Dec 2023 00:09:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9bYbUWbV8R/akuHEcUmaMhWWBNUjgcR4DTKM6tZYf/mkbuAgWgBfBNxgJhA6SwOTG0OJ4 X-Received: by 2002:a05:620a:4154:b0:77f:6b52:cd89 with SMTP id k20-20020a05620a415400b0077f6b52cd89mr16580177qko.91.1702800594028; Sun, 17 Dec 2023 00:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702800594; cv=none; d=google.com; s=arc-20160816; b=aFTHvBshBH1dxP9OORpFr2nOKNGdzJw5FPJW/ziqH9ndGoZ2JH24FbVMrGHAyB0T4C KnuvIarxgN1vJ+KG1Cts4XTk2IyaJrcBaBzHj9Okzlow2pIR32rsllH2NZB9yLvcUTi3 vbxBzsUuhRW6SEGNOzJN7hKdsC5VJLq0g9TkQ3ZWBZSi1lVck6GbGW5agpnAPmW4Xenz pYzvKlj8TxxMLhZOaPJxv9S8bB/7j+1z5RosCunvfZKayVTJWhpyquzgj8LHs329tB+r XDMZOlVT4CTgJk6D3dmeumsiBksGitrK9Ul+PcJW2O2WLmbftCfIG0lgOWGzK9QT5ATJ Dizw== 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=5+YZn3qid70ipf23l+1Skq9YU3IOegijAT5j4LrIkeM=; b=j3f74yVOnYZEBUVG1ENgfyDQmqjBRVXb2lcCpo/ljOrmd6O9E7kKtNSpRMAOkwJatK SFn5BpCJKvfC4BmL32yyeYyznp9QLjuTwTiKJH1qCCXd4FKSH7Tx7Irttpn13T4FQTcu /vT1UalIGA1OEzvSGd7Y0rSYyk4/+CX/rF38sIbU1yuzL0JiCM+lLNNg1PTt9V9Gkfx4 tCylLCEc3MdZk06AV09V2ZENEvOPybcCzN3NY0Zg8IbNZkjDxKvnIRbqKgAO2cs5GB+w eWtTBCDSnExJ0gaimQ+knthn7n5stUlQ1Sia2F5PM+Wld7Bf2gw1lTlNiUPbYEwCTIEG 40cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vhvMowPD; spf=pass (google.com: domain of linux-kernel+bounces-2501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2501-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f3-20020a05620a408300b0077f60bceeddsi18859918qko.272.2023.12.17.00.09.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 00:09:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vhvMowPD; spf=pass (google.com: domain of linux-kernel+bounces-2501-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2501-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C64BF1C2115B for ; Sun, 17 Dec 2023 08:09:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 351253C36; Sun, 17 Dec 2023 08:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vhvMowPD" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.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 26D641C20 for ; Sun, 17 Dec 2023 08:09:21 +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-yb1-f202.google.com with SMTP id 3f1490d57ef6-dbcd8c649edso2264153276.3 for ; Sun, 17 Dec 2023 00:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702800560; x=1703405360; 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=vhvMowPDr4sLum8/34TI9++Tk1uFJc07pqhf20tmo5zM3v8PhMagvrXPbIQ8OIpLBD 9xnezFGb/RekGg82Z/GCkdBWQH8ehOHy4FtpvNQRRwNlJVw9tmjp8h8warVitOJHtpOz uCBs4eDOgK3WjSGPoBJ9t3giV92Lupxo5w4CDXt8awG4/wCWQndY6NVMd7F6zklL3r2/ z/c7hfrYs3nRP2b4kQqK5ECfCVIB6ctsjfQDUbHU8y1zSgUSrpavluBB4tuJp2pOnOhC 6+nKGicouYy8xQ5y38Pi9O1TAy4D71VYzaVL+iZYL6i7990iKpF9NlgxespIru74W194 RpIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702800560; x=1703405360; 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=s3P43b0Uri5Ye4sUvNeZb3dDEciRMY4Awk2cJtBywfaikj4081PD54etCMjGKPypW2 byrdUCAZlIY/8zFvqrNbouhuMmU2j5NlkbwK7qrmYTemD5Ru7gqJkKMGAzOewE33YkG7 i1di93KexiNsok7bleZlMuvueqw2QGOu1Agszarooyxe3jnq0hv+q/yjos4RpsNDypbi is9YrUDgkl7Q6Nk9/gZidk1G8mBzxCPWE9LKQlwGz0Mi/LRUz9DwSddAVE1oJvCWPOxM 12dEV9mj2U6tmRj9mQK35cWUnGWdKPRdYhZTTNBatLYH3pRKGklkn6JJ+XVJCJ0v9l6h d0cw== X-Gm-Message-State: AOJu0Yyni5GImNM0qHNw/Ng2pikZT79jhHHEIIZtXVhRUfGkPuVtOFMX dHBDyon4jNxd5HnDMuD0lorI7NEHtCrUHx5CsKASnu467ftoNXEI0m+zu7A6Y/XBOsJPI7vJUzB Qnzb/tcgACyhvemxeMIfdPrZwzDzKLdHG82HjbMjqSEvFNrC+3TnsjN0zAYG/s0wt6E7s7IZZcm pbrXnmE4I= X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:3eb4:e132:f78a:5ba9]) (user=almasrymina job=sendgmr) by 2002:a05:6902:1343:b0:dbd:13b8:2598 with SMTP id g3-20020a056902134300b00dbd13b82598mr628107ybu.3.1702800560127; Sun, 17 Dec 2023 00:09:20 -0800 (PST) Date: Sun, 17 Dec 2023 00:09:09 -0800 In-Reply-To: <20231217080913.2025973-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: <20231217080913.2025973-1-almasrymina@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231217080913.2025973-2-almasrymina@google.com> Subject: [PATCH net-next v2 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 , 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