Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6774262rdb; Tue, 2 Jan 2024 12:59:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiK2WtRv2iLm0wL2fifECSIE022J0HB9r/bvSkmNkZAfEctkZPZXYSdP2Q5qLHYU9zscJV X-Received: by 2002:a50:a6d3:0:b0:553:5978:dac5 with SMTP id f19-20020a50a6d3000000b005535978dac5mr10924710edc.67.1704229169693; Tue, 02 Jan 2024 12:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704229169; cv=none; d=google.com; s=arc-20160816; b=B0AYWySojPbb+QhVf8wiCRWZ5R30AoaN2BTRA/g/yOd1kPcgvWPWlYkFObYreTLnM5 sY1qidACC2cA3DTKz8a3IPSoVQz7DKIWGLwV3B6t+nyEdDtPp4RfzXkpRMqUyOUWGEY+ zHuedpLGZ8Ch3gRzcqfSMH+Qs+IAj152FpyAsLXyM/OhnXWKKTUVDtCK4j4aZp9JisSv JP7MsB6YgbOd9LCq5Kt4c0/qNu3x+uCzWErPJXtf5rvzS0VsoXiAENUC0ToMXOg8q9QU MoxXA2wFM/R9AssbXyd30GUfcVzj1q+9uy9xaIUNsfRbrQO89j9XnZnXSI3O17Ar7EbP vXtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=6OrdrWvBDxOQfJ4vcbx726UKsh13Gg6rlqSW8b/m6AQ=; fh=mKmlFNKomSAlUc5fdU2x/hjUGnxAdNf0Nso+CSutyMw=; b=vEnUu9IbdwAm6nRu/tLIiG/P77rBcVY9Xf9uiWTSsPImaxpQhlBwqDbBeGNTJSNMp9 ig2Q4m8UGcUTZWLY8DuUjns2a6b6YH3sjGnxkCfTT0H1b1DAt7sfhrUH6GDCIG5FtaJN Jl6YVU/nVY2Q4mIuitzORMUpIasTyVZCZfuzCRo4HcSo6BdiF9e4JWHcMfZuWe1AyxeA mB1wO+8y8XOCrHZKhMHdgNTbEAWpZja5L1IZLh/nZ+/Bx5+XY1cFFABd1yK76G8QmMuf IW8y6p96JHR7wZwGMmN6KrjpvqxNZLyv/6Q76/CyhWWLNYlblSP5o95/bNSPLNNwtF2B ljLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3l33vppm; spf=pass (google.com: domain of linux-kernel+bounces-14816-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14816-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u21-20020a50d515000000b0054c8ed3da42si10947821edi.16.2024.01.02.12.59.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 12:59:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14816-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3l33vppm; spf=pass (google.com: domain of linux-kernel+bounces-14816-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14816-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6E5EF1F22B7A for ; Tue, 2 Jan 2024 20:59:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9920C16436; Tue, 2 Jan 2024 20:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3l33vppm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 C8456168B1 for ; Tue, 2 Jan 2024 20:59:09 +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-f201.google.com with SMTP id 00721157ae682-5e898eb4432so131710947b3.0 for ; Tue, 02 Jan 2024 12:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704229149; x=1704833949; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=6OrdrWvBDxOQfJ4vcbx726UKsh13Gg6rlqSW8b/m6AQ=; b=3l33vppma/IgX8GqZ/OsBLNrTC+DQFRaN8jbjBtjZFbVKVfGtg+mZUxwgVjiSHhedx JEwM1UbU8arnhvayONYV+yWeB5FSVbH0mN28LW7y7tH5blJ7WnhqRSfgqyZeqe3VI9WO QngELDGoSrrvJGNJFYKmMam1ONjONDCWi6qe4Oh8ZZWjZVEEiy084wqA0zyyCeZxlccP LqjxccfJY6/xw1mr0evvSYTmNiV/qoBJxbST7bWPtUholNL5UrLoIAfY+U0Zvomht6Vm g+LsMJp0jeJy/c2K5G/nfAu4cDDJjaOL2PXpxx9C5IxvuCOlb3JPssl8GdrHo16RIz3/ xH4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704229149; x=1704833949; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6OrdrWvBDxOQfJ4vcbx726UKsh13Gg6rlqSW8b/m6AQ=; b=Um7VO8irPC5v097I0k969hc4k8d0c5h7rxUpGMREg7NnvwHLk8oqUe7MKGB3YeegFq rX+9eRWNNzed8fGKynzwfuGgebGXhCWkN/EDETLQp2pb9HALnZ357CmLYmfKPZr4dWJf FzNbmFA4emW8dwDVl0GTt6WVFPNj37oLjhpBGB3iGzgQHE5COCZ4xL/nZWVubL7pHMIt feXnXbPz4UkdUImytj0ZGhz9AwnVnMOYu8f6CWa2cJY18ob2dWbOOP8KIeHQdxR+SBsC K7oBpI9rCWZ80/YO2MjJgqJboxVSGpRNqDTLUiGZdQ0Cft+lCf4eLrqrtmQFps94tqUY NyGg== X-Gm-Message-State: AOJu0YwSHFMnGbUCPAD2finqz6KKkGU03WZWfcrgLlpRLeeBC1DkjuFg hiNtGqp6Zuwoib075VPOPCLtbcJ+M9bxtoYUZ1rQ6drE X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:9a04:c262:c978:d762]) (user=almasrymina job=sendgmr) by 2002:a25:b9c1:0:b0:dbd:b7cb:8a6b with SMTP id y1-20020a25b9c1000000b00dbdb7cb8a6bmr513742ybj.1.1704229148829; Tue, 02 Jan 2024 12:59:08 -0800 (PST) Date: Tue, 2 Jan 2024 12:59:04 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20240102205905.793738-1-almasrymina@google.com> Subject: [PATCH net-next v3] vsock/virtio: use skb_frag_*() helpers From: Mina Almasry To: kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mina Almasry , Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni 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. Acked-by: Stefano Garzarella Signed-off-by: Mina Almasry --- v3: - Applied Stefano's Acked-by. - Forked this patch from 'Abstract page from net stack'. 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