From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F22F438E5DE for ; Mon, 16 Mar 2026 10:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773657848; cv=none; b=jh7uJDJpe6ankEwXk2+JXATBTThWU3a7/WgNTJYFVY7mBYeV3/yG8cYoJhdjwOGV4nMCNBp6QUSbH2bJpO8TausiHleIayo3cL2nOszM01L5/8dG9HD1K/wDkhVRnwzIly06Ssvwh+HMPHR34Fxz1SmASPjkyW4bEgupxf1Axrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773657848; c=relaxed/simple; bh=Sfai54yGfVswX06wKRJbvlx+Ae5w4/tFvgMB8FyVF0w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qYb9KTWGplINyCJOB7RStvpnVe8LH7GgHO3NgR3ZQ+BbygWLMjExPR8bONYY1BTJl90/n2+3trDCqmHGXM/gYHa2AG2FMaDQSeYNme15K04y+u5ysl/gKper8rCOUH4qK+pCR5MQdUXCWoB7+3aEK43EIiUnuWVbSd8KGFfqE5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=G848RMsI; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=uLuI/13o; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G848RMsI"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="uLuI/13o" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773657846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=N/gyi8r2QqrmKNfnuildAwIe3Wu8jqbPwSPfbNMez1o=; b=G848RMsIykfGvEzrRxY+2+Ez7Sc7my0bZqfvakOq16UZT8IgiyQbbk/SM5WBSuYzuA5JtS TxAqz43MRUsp61Du0qrXvfKK7Qd4gTxwFTuNbT7rI4WEV9DLOo2i+CkDWP+R1JoaRvsvja hlazSUMepqzlAbK/+Ntj2/M/SdJcCDI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-ViHCtpLYO12SCPYpOSylag-1; Mon, 16 Mar 2026 06:44:04 -0400 X-MC-Unique: ViHCtpLYO12SCPYpOSylag-1 X-Mimecast-MFC-AGG-ID: ViHCtpLYO12SCPYpOSylag_1773657844 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-43b3da235dbso1291602f8f.1 for ; Mon, 16 Mar 2026 03:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1773657843; x=1774262643; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=N/gyi8r2QqrmKNfnuildAwIe3Wu8jqbPwSPfbNMez1o=; b=uLuI/13oe4sif2ofwTZvB8fNufqkvPnefy1nmZnOsEdwVaNHzyRfqNQKk7cQgGQbxd jLBzjKsbguZ4UXPxr+6U4ZqD7ziXbH15f1q1hl1vNuHzcFgcdTzdftdITzbcazDKRx/V mCCNqalZFEgO22aVHUycXwOEzRPHy9MltoqYrAiTvdRnH8qCviYGQWagABYli6P8I8OJ Iec393l7Kemhh2TtaAvxXN862zmjgfi1wsg+PUKyRstHUUbco9LN+fFPfD+GWna1o0ic USeiCCzcxdHx1j3V3T8V+eR0X0lY+hAzzZPeSmtk7WRwZUmD19AoaLbeX8j+n6o2Ypp2 hJ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773657843; x=1774262643; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N/gyi8r2QqrmKNfnuildAwIe3Wu8jqbPwSPfbNMez1o=; b=nJHzCW7eZ4QXEEkdYXvXqLOh7l4XJwARSQpJvKpCrgRYwIR42+a35fXvFH68K9KZIh P6+GQEQClQRjzYB3dThwuaGEJU/b0bTucQXGIgd+Dkxu2dS/39iPQkzHucHXGMboS929 LZt/ipgHzre0cDCb2mik6SFYjx82TALLOnB4uw57eKi3S0wwFQQhIBXaHjlyhZG69bW7 g7zEoWFdkcM6qIa46eNkClywcNCkMF7FxWSzy1t7AIuFbi+/fWk6ya2dAoDLJRFCicOO bmd6NWGVgSJaBbalUsgsCmgfPMqnE/5Xu4adE3uBylvqDQucnyyGkrZn8hY8uBkeCtGE 7+Sg== X-Forwarded-Encrypted: i=1; AJvYcCUmEvPIk8lFKcsnCLLNpNBA27a9zvbOHCC3loPWJ03KBDEjopmUpUklnC3IFYu4Oon78RvJZitiBbNxiLs=@vger.kernel.org X-Gm-Message-State: AOJu0YzGH8AKTUeHCLJeHL0hWzIVJaDjef/vBTdh7DPrvnbxkliEbx1O To/PmKbl70kbAucBJPgZcxteAYSK5aCd5zZhfAaw2PdBRPzLFXsevPP/drnxfZ0jLVnw7UEHUsG QH3ANP0FOhMZUq4AuGkqzLqSjT/NgXP2/QrDMdPrqwkyfItxV31Gx7pUUrSqth2uEXg== X-Gm-Gg: ATEYQzwNwl7HMjiQ2SzdbEWZZLg8tgYqGy4XeYzhMzUNnG0c+Dq4gBNVm89YXDcxRjW KpZl0owGG1wfl6nntPAeWCRjCv7GlarzVRbPnUjWLf7VqWoRrm/twLvYs9gz8RoNa5a+/rhTH9Z IgKamlk19eBZTAuTAd9O+MOvwbFtCc0Fbn3NK40GGjJwf8ZuX180IXbzVZpasl7EPxWZH2ub7ao p6jvgoJClO6iwhUhOoR0SomuIkr+aeJVjIdSkFXnpPqM6nwzx6R7lQmv8mlNuxD3cS6E9BJDmIR /kQjrrtp/zeUUPSZpP/XbOHDh8RX4YKRD9Jo94g5P6Dh01MEA+k5CF1VQ3diriUw8YrO7EJCFDl BMXnJXJ5TT15C/vjlZj6uQVrKzkjlxVY1LGznrvKSA2mryw== X-Received: by 2002:a05:6000:381:b0:439:d8cb:1392 with SMTP id ffacd0b85a97d-43a04d91a43mr23683341f8f.26.1773657843207; Mon, 16 Mar 2026 03:44:03 -0700 (PDT) X-Received: by 2002:a05:6000:381:b0:439:d8cb:1392 with SMTP id ffacd0b85a97d-43a04d91a43mr23683282f8f.26.1773657842675; Mon, 16 Mar 2026 03:44:02 -0700 (PDT) Received: from redhat.com (IGLD-80-230-79-166.inter.net.il. [80.230.79.166]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b45e51681sm3730121f8f.25.2026.03.16.03.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 03:44:02 -0700 (PDT) Date: Mon, 16 Mar 2026 06:43:58 -0400 From: "Michael S. Tsirkin" To: Vishwanath Seshagiri Cc: Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Wei , Matteo Croce , Ilias Apalodimas , netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH net-next v11] virtio_net: add page_pool support for buffer allocation Message-ID: <20260316064256-mutt-send-email-mst@kernel.org> References: <20260310183107.2822016-1-vishs@meta.com> <20260316054232-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260316054232-mutt-send-email-mst@kernel.org> On Mon, Mar 16, 2026 at 05:56:20AM -0400, Michael S. Tsirkin wrote: > On Tue, Mar 10, 2026 at 11:31:04AM -0700, Vishwanath Seshagiri wrote: > > @@ -5857,7 +5863,7 @@ static int virtnet_xsk_pool_enable(struct net_device *dev, > > /* In big_packets mode, xdp cannot work, so there is no need to > > * initialize xsk of rq. > > */ > > - if (vi->big_packets && !vi->mergeable_rx_bufs) > > + if (!vi->rq[qid].page_pool) > > return -ENOENT; > > > > if (qid >= vi->curr_queue_pairs) > > > > It seems that a qid that exceeds curr_queue_pairs would previously get > -EINVAL and now gets -ENOENT. Or maybe this if (qid >= vi->curr_queue_pairs) is dead code? I looked at it some more and I can't find a path where this triggers. > Maybe reorder the checks: > > if (qid >= vi->curr_queue_pairs) > return -EINVAL; > > /* In big_packets mode, xdp cannot work, so there is no need to > * initialize xsk of rq. > */ > if (!vi->rq[qid].page_pool) > return -ENOENT; > > > Alternatively I think we can completely drop this chunk: we already seem > to init page_pull at all times except for big packets mode, so the > current code is fine I think. > > > -- > MST