From patchwork Wed Dec 20 21:45:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mina Almasry X-Patchwork-Id: 181787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp28442dyi; Wed, 20 Dec 2023 13:46:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3Id6tX2Nl6VThnCB9U+IHkd+tzsWAJVQDtlet8KGDQm1nGqh1ZDgAZ3QleXSnihf+vy0I X-Received: by 2002:a2e:9f12:0:b0:2cc:5c93:7f8b with SMTP id u18-20020a2e9f12000000b002cc5c937f8bmr3623943ljk.59.1703108776610; Wed, 20 Dec 2023 13:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703108776; cv=none; d=google.com; s=arc-20160816; b=GckNDAdGE3kv4BVh+qgLDB6gHZMLv4Nk7WMQMozTsyXH1s7PFwfSqcIxMTkgJJDhCq 8PrPj06HHqJs9RhNF5zbjp5YMhD6qDVipduU3ByFadKCp2WoQcRVGctAA5pV8CsLhnIC +uGbrn1eH3LkZ+c/3560qZF+WIALrSrRwpZMSUqeOLZyOtEj0YLttzfALJOA+7t+h+ra mHj+iY7UEl3Q0Q9Zq//yEcEW8Nja+K1O36pmB8hJ4mU3O52I1JZkl5VxjA+aRSd+l5/a /FEvVthDqX4X4ylEqa0C9QuR1V1Ptbl0LplSCjguJfHQW798gDlC2Pw1VWJMVvGXIsAt L2cw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7477-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q26-20020a50c35a000000b00553327c7206si201168edb.104.2023.12.20.13.46.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 13:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7477-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7477-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 397F71F22B7D for ; Wed, 20 Dec 2023 21:46:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B116D4B5B0; Wed, 20 Dec 2023 21:45:15 +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_K=C3=B6nig?= " , Shakeel Butt , Yunsheng Lin , Willem de Bruijn X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785838988675996762 X-GMAIL-MSGID: 1785838988675996762 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 Reviewed-by: Shakeel Butt Acked-by: Stefano Garzarella --- 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++; } }