Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp478161rdb; Thu, 21 Dec 2023 15:29:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSl3mNzA8ipIMwiQNm5paosQBr1GTHqoS5q++coV0zzVCtP+mqFDe7LXlPLRIKEQdX0gMR X-Received: by 2002:a17:902:900b:b0:1d3:c3f0:463a with SMTP id a11-20020a170902900b00b001d3c3f0463amr375602plp.137.1703201385830; Thu, 21 Dec 2023 15:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703201385; cv=none; d=google.com; s=arc-20160816; b=Gyn/LU6W63p/C4O7HnZdBqM275jXUq5wthssERcPTkISy9WSmBHKEhIdAvOL2hG3Bv IGiW04oJC0VTtLi+cQy7fWQZw0LQlG01AfJK5kLStbIIZX1uchRlnUB5lCeFcxlDy3ZE UD9HKY7RlVS/f8FUHowUtKFWj2VGjUujj0ViLHnx+XYfD6j39ArCBgcRfx5yUUeqdaR3 yJ/sxmU1RZLMLLTJihKXNKP4XuUyWzPlr4MyPzB+cEf1eElo/5kOl6J1it1DAdrYUkCq s8i87njpR80UqrRwZ1DKNVyhCsJArK6oB7CVT+ELlABfDEz3Rkw5hgpM0eXrDVd8GhqD MYJw== 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=TQBK3S+cxkss8EKQd6OTegL/cKtMcOEpQ7fU5gL2SH4=; fh=aWoMOscFk7066fEteaA7W7jw4uMzEMvrTVK/xY4P8WY=; b=SLO6M9Y8pqxWIpcFxPqSb8zd951C4NwxPz6ROjalyd3MKcVjSkJ4fCx1RpP4y3+liN 3mAGhCN4Qv1TQkgRJbb1MhDVocwRBeUswQwHv5pYc7D7fWXfNL2u0T6c0TFBt65983LP Gt5Av9Y8Vn/TJs5g8mWpO4mExgpYQoA1xHil6HC4J0dETU2kPJgBgF3tAJG+0J1QhYEg w/KT+SyWnovsp6jsgSmaTB/JfOqlzJgMZ5XgY6MLyIIg0dVnaLQGVDBhfLGCuETmyp3K f9IDq3LaS6CTxcx3NRSlmQhajL8kCmHpKgpa9Y8rtZC2bmUCRqr5+daQZZlph572eDiH 0MOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="nJrlg1/9"; spf=pass (google.com: domain of linux-kernel+bounces-9179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h1-20020a170902704100b001d3a2b682b1si2209975plt.199.2023.12.21.15.29.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 15:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="nJrlg1/9"; spf=pass (google.com: domain of linux-kernel+bounces-9179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9179-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B66EBB25E89 for ; Thu, 21 Dec 2023 23:27:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EDE77994E; Thu, 21 Dec 2023 23:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nJrlg1/9" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 336A279463 for ; Thu, 21 Dec 2023 23:27:19 +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--shakeelb.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dbdca3685aeso1151496276.0 for ; Thu, 21 Dec 2023 15:27:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703201238; x=1703806038; 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=TQBK3S+cxkss8EKQd6OTegL/cKtMcOEpQ7fU5gL2SH4=; b=nJrlg1/9MsnYkYSlpCdysaWME5jsY7BOeIB6SURa0FBW520SU7TwqQJNMse0oWSVuN 0oUGTCxGmN+I351T6b2HvFRJD2QYJfPBtfdd6r+qdMLQXUoimHxvsqKBenyfl+/weepN WWd4WHTz63z3kvqzzULHw5lyYmElT7c1LjKP0oBqTz+sHWIkdDibsU/6dZQhnGHwHxcP IgA7H+DKZPpHcCostzbnAOY8j1IlA158aWRTXkH4Xf+x962B9nWRCPmBxBxV5Pmc4nVr Q6FK0AXYtSsiGWT2wUoYKYHadAt5+R3+d1GSmj923qoG7zXpSPawlUK1rlCO4yqUyxnJ e1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703201238; x=1703806038; 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=TQBK3S+cxkss8EKQd6OTegL/cKtMcOEpQ7fU5gL2SH4=; b=eHA3v/8C4g2x3yp9LWJUKkK25x/btB5MmPJIcf6mR9B3dRUosbN0yqcl/nPlaXKjo9 2rPJRYBIIJei2gVFvViOYnf7EfnkeH9NDCq2gyu+nxAh7oRburi9/uqWoiit5ZXUuphy iTkxKvNfadW4KZygqplSQAGvqyrTNNsFqpVdbK909Fs+9AosMkCIORZ/kVb/FQFPooeR ipsq7mg5VtJNB89Tn7oex4FkEUqjClY3a5PbFfW0T/tqGp8mzgwasSBsOyYjzwZWeEKh Nfd48Bc0p6bRh+ScrPQznAngPgzWVtaFSnS+KupezxFnCXMiywfaQEQHDq1g8N1+qba6 zX4g== X-Gm-Message-State: AOJu0YxWiBUIKHk0mtvx9HYVDE1HYDZ4tSqLgwY2cp69KEv2K5nBU5t+ OXJZTyJD4fdN7iRwdWq9MRu0tkXFl2ReGyhoOjkA X-Received: from shakeelb.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:262e]) (user=shakeelb job=sendgmr) by 2002:a25:844e:0:b0:dbd:2c5a:6c53 with SMTP id r14-20020a25844e000000b00dbd2c5a6c53mr188580ybm.6.1703201238254; Thu, 21 Dec 2023 15:27:18 -0800 (PST) Date: Thu, 21 Dec 2023 23:27:16 +0000 In-Reply-To: <20231220214505.2303297-4-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> <20231220214505.2303297-4-almasrymina@google.com> Message-ID: <20231221232716.4fspnvngfuqhaycu@google.com> Subject: Re: [PATCH net-next v3 3/3] net: add netmem_ref to skb_frag_t From: Shakeel Butt To: Mina Almasry Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Stefan Hajnoczi , Stefano Garzarella , David Howells , Jason Gunthorpe , "Christian =?utf-8?B?S8O2bmln?=" , Yunsheng Lin , Willem de Bruijn Content-Type: text/plain; charset="us-ascii" On Wed, Dec 20, 2023 at 01:45:02PM -0800, Mina Almasry wrote: > diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c > index 65d1f6755f98..3180a54b2c68 100644 > --- a/net/kcm/kcmsock.c > +++ b/net/kcm/kcmsock.c > @@ -636,9 +636,15 @@ static int kcm_write_msgs(struct kcm_sock *kcm) > for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) > msize += skb_shinfo(skb)->frags[i].bv_len; Don't you need the above to cast to bio_vec to get bv_len? skb_frag_t does not have bv_len anymore. > > + /* The cast to struct bio_vec* here assumes the frags are > + * struct page based. WARN if there is no page in this skb. > + */ > + DEBUG_NET_WARN_ON_ONCE( > + !skb_frag_page(&skb_shinfo(skb)->frags[0])); > + > iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, > - skb_shinfo(skb)->frags, skb_shinfo(skb)->nr_frags, > - msize); > + (const struct bio_vec *)skb_shinfo(skb)->frags, > + skb_shinfo(skb)->nr_frags, msize); > iov_iter_advance(&msg.msg_iter, txm->frag_offset); > > do { > -- > 2.43.0.472.g3155946c3a-goog >