Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp344685lqb; Thu, 29 Feb 2024 02:43:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVla2MiwyRDov8/Kddiffq0/o36Z9O8zq3Nx5VMcFJBoDTaTZp5B+H+zJ1U+mSK0HUtQ380OhYz/JEEodtJthOeNBCA3/qLnkEyAzza4w== X-Google-Smtp-Source: AGHT+IGoO3rC/6dpbclEbT2CNdAEjUcMPpmaMgoEFtIuf2cBq72bip+f5IdM/R3mf2u6PQXjqszT X-Received: by 2002:ac8:7f0c:0:b0:42e:a832:5311 with SMTP id f12-20020ac87f0c000000b0042ea8325311mr1609402qtk.8.1709203410252; Thu, 29 Feb 2024 02:43:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709203410; cv=pass; d=google.com; s=arc-20160816; b=tsJr+k8cBEsEfnTPMcaiit+8Ekp6wGf5B18eaG5ubrHhw6oPnYkgDrHjdn6D7gv92m TUOye4NU3wAYqjfpQ6flIGBffc33tYnqarTyb9AGwBg2bNcAIrxwndgbhrkQ01V/Agu3 A6ov/jG9XaajqX11NDipSOetrQ7Mt8JBLOcUImBnpuDDfNu27/gHsmngpRVjBSC7J6vI BHKw4IOqJF3gjv0wxodePBE3LCoBlK5dZ6+s531IWotPWmWbwYjab7CC4tV2Ifh4o6Vx 5MEC2LwixpChWkwvH5V22imxN2gzxJ8IXVdzWuRPqZpRtgdbjqvo11ufMKmNDwQyU/Ox r4bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=jtYSKVHcGkmiG0WkHJQ0+oofirBnO53PO7FPiruqtKw=; fh=oWmRqbcPeRyvreF3IMTba3aCaF/O824eMMvt5YcNPBU=; b=WZSIv5/dsjfWFclRakJRsyeuNsMaFg18NAiZ9tJJl5600t7S1QaGGdG9N38+yxzX9a 5d4reXrAObiJJ/FbNODhy8coDKCJHZ2p5VTazI+zLcVgq9G8OEy4jzEEb0gh3ltULQZ+ hxtzEjD21c/SueRHnDjna8+0zKEM9Ao+zErhE9QdUXp78E4S8pQgtfe3xgnQTGkCDjst OcmtEGTxx1mFWWU5SEF2kZKTD/7b+/n+WSzNnDphOH1zJqdM2wRu6B3/KZrcjW+w8uEv ibffLyXqbG196Lv2c4cfki4q3mDklvq9xbThljBV/RAkZuz3733eafK7E3s3DPRTI7vD ZNxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AWUcHtuT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-86568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g16-20020ac842d0000000b0042e479175d7si1040669qtm.424.2024.02.29.02.43.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AWUcHtuT; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-86568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 E61CF1C220A5 for ; Thu, 29 Feb 2024 10:43:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55B397A709; Thu, 29 Feb 2024 10:43:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AWUcHtuT" 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 BFE4367C79 for ; Thu, 29 Feb 2024 10:43:16 +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=1709203398; cv=none; b=S4BJ11L+Sc+2El7VAgoiow1JHF0utWwWcVFNLOvrcXZfIPcIK12oU4Ja0VBA5QaC/Or/WWdgS/kliPolrT/UZRS324cBRbSF76Eqy2/OJ3NE22VtqnqggEXryezfQWTZAymt7a3e4bzI/RWwNXAZpXfNY+5+ywPiwiVMUaYEW1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709203398; c=relaxed/simple; bh=G9inbGuH/deCfFlBeCV3+n6+eXPc/sQdW9zyYyvjjYI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=DbQxVO5G+AcXraMrCthImiS1P7A/OenRZEjwoFaTztG9lG9WI0iXpPdcJgyvD214LlkCavLLWyTpf5JNQ+XkX+pcP1dVgzsZTDlmED66kLeVK0ZaYPuwtTjcTxwSlY+BN9SNV/DbCepA45s8PieZmXGPBivs+z7Ny6Ysw5TOLIY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=AWUcHtuT; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709203395; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=jtYSKVHcGkmiG0WkHJQ0+oofirBnO53PO7FPiruqtKw=; b=AWUcHtuTr0TAf8wMKMRlJtVgLe5yJYxgA2tKCYJkaXH0iBzHe2HmKog3a7aF2YQz7R+MXN T9+Fa30KWkYrpgmEg0iZyt7tJ347MZO5ZmTf/Gm1uC2ohCAC7eTCrpKV2H/fm6wTIWcz8M fbZpY0yJJpHKY68Y2Z29J+kocb1f7kg= 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-355-KsXiMqthNGSodoE4FqIEnA-1; Thu, 29 Feb 2024 05:43:14 -0500 X-MC-Unique: KsXiMqthNGSodoE4FqIEnA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-33d827f1e04so119253f8f.0 for ; Thu, 29 Feb 2024 02:43:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709203393; x=1709808193; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jtYSKVHcGkmiG0WkHJQ0+oofirBnO53PO7FPiruqtKw=; b=rHVXveU16JgxOmbfvPF8k4kDv133hLZwM66TzvfvPXGylqGGjcXMmU93HSXBi/h6YJ sF4TJphjRrfRUG5AaoGX5oGCx2tLP3BP73DQtNJo82ttz4/ald+07UVrYp3kVr/y4jGZ LxfittUfLBZ0QYJx9DVDrfe5rz2MejqdsAcVV4SIKX0WI8qFYkIXj8Kh409ZN2D2FtIq M6YTlnXVnmxBMbGQdGBvBkANcYk8Sj4+fvx8kkwDr4SJU2Ft83fjWuGVDsaj5kPba9Fd m1cMGrSrgOuj6ewfKXQ0cpIfLCXsmMHag1zHREnEzFR6zZvzCvKXgiyIIiSNcs3kS5+O fzbg== X-Forwarded-Encrypted: i=1; AJvYcCUtLZdWGN5CNh7T+nwDGUGkNxWB3WaHeQ0N5zeDMrCLn/mE8FUMUZFuZ2zImY5sUdrfIn02dNC9UmIq+Ztl3qfj8ticQpISA5qpiyo+ X-Gm-Message-State: AOJu0YwDcCsKGF/lhBM3ohQaXboz4Q0K0bNfq4aIOHnbaP7b56LHWwgC pp+r2otQRdQ/J6YjZ7Og2WpXs1EQaFA5qjo7kQFImoMBDnzobHH6OX0fjvBdEWNp3PtkOLp5Ei5 6MDZanLfH8ZCA1mT9QACQrg1nX49up30uDerNPsKVHWecTV4tmE1rCJyD9/hDlA== X-Received: by 2002:adf:ff8a:0:b0:33e:1102:8fb8 with SMTP id j10-20020adfff8a000000b0033e11028fb8mr703878wrr.6.1709203392986; Thu, 29 Feb 2024 02:43:12 -0800 (PST) X-Received: by 2002:adf:ff8a:0:b0:33e:1102:8fb8 with SMTP id j10-20020adfff8a000000b0033e11028fb8mr703867wrr.6.1709203392618; Thu, 29 Feb 2024 02:43:12 -0800 (PST) Received: from gerbillo.redhat.com (146-241-250-174.dyn.eolo.it. [146.241.250.174]) by smtp.gmail.com with ESMTPSA id e5-20020adff345000000b0033b278cf5fesm1393832wrp.102.2024.02.29.02.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:43:12 -0800 (PST) Message-ID: <75b6f7686c03519a1aaeb461618070747890143b.camel@redhat.com> Subject: Re: [PATCH net-next v2 1/3] xsk: Remove non-zero 'dma_page' check in xp_assign_dev From: Paolo Abeni To: Yunjian Wang , mst@redhat.com, willemdebruijn.kernel@gmail.com, jasowang@redhat.com, kuba@kernel.org, bjorn@kernel.org, magnus.karlsson@intel.com, maciej.fijalkowski@intel.com, jonathan.lemon@gmail.com, davem@davemloft.net Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev, xudingke@huawei.com, liwei395@huawei.com Date: Thu, 29 Feb 2024 11:43:10 +0100 In-Reply-To: <1709118325-120336-1-git-send-email-wangyunjian@huawei.com> References: <1709118325-120336-1-git-send-email-wangyunjian@huawei.com> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJ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kHD9WF+m7dPlRVY7soqEYXylyCOXr5516upH8vVBmqweCIxXSWqPAhQq8d3hB/Ww2A0H0PBTN1REVw8pRLNApEA7C2nX6RW0XmA53PIQvAP0EAakWsqHoKZ5WdpeOcH9iVlUQhRgemQSkhfNaP9LqR1XKujlTuUTpoyT3xwAzkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-02-28 at 19:05 +0800, Yunjian Wang wrote: > Now dma mappings are used by the physical NICs. However the vNIC > maybe do not need them. So remove non-zero 'dma_page' check in > xp_assign_dev. >=20 > Signed-off-by: Yunjian Wang > --- > net/xdp/xsk_buff_pool.c | 7 ------- > 1 file changed, 7 deletions(-) >=20 > diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c > index ce60ecd48a4d..a5af75b1f43c 100644 > --- a/net/xdp/xsk_buff_pool.c > +++ b/net/xdp/xsk_buff_pool.c > @@ -219,16 +219,9 @@ int xp_assign_dev(struct xsk_buff_pool *pool, > if (err) > goto err_unreg_pool; > =20 > - if (!pool->dma_pages) { > - WARN(1, "Driver did not DMA map zero-copy buffers"); > - err =3D -EINVAL; > - goto err_unreg_xsk; > - } This would unconditionally remove an otherwise valid check for most NIC. What about let the driver declare it wont need DMA map with a (pool?) flag. Cheers, Paolo