Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp109642lqj; Wed, 10 Apr 2024 05:45:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNpiOykY211WxmLKhQOnTt+qbAfjzvDnrKmxD8W8TrNPU5bM9YHL1h9Hmrf1dACziFQwGkGTZhxJuFMQKhkfW/pV4jyT+C/FSs/JU/jw== X-Google-Smtp-Source: AGHT+IGZ1CbqxQFAQ+vXGDWHHoywV71NGRzpBkWdgnf4V4j4cPetklBs67zdK9KRsQyRPu6Zem9x X-Received: by 2002:a17:907:7292:b0:a52:e61:ace5 with SMTP id dt18-20020a170907729200b00a520e61ace5mr1341883ejc.8.1712753154176; Wed, 10 Apr 2024 05:45:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712753154; cv=pass; d=google.com; s=arc-20160816; b=DkEiziz9Q/gaTytN5NMP1aDt2Ri3zcnstJuugJUDjUtvcC7hvWJeV/Ds45dLifJTIw BCIW5JW68VDCOtYcPp7xkV1dN9kFxR1DQEGliEUMcZUWoYiC5Ri9epH0waFJehSn26xH BAPl7EATl99kKp0yCX2GOzCWxWrx+vMGkB0maMH5mz+HK5AhuQG6HWmMR/yik2wlMG7A VWE8TOm8/jyA5s0Nf2V36KpU6hnxu6hr9qRvhTykCVTkkhXAKeFwQQkTIDxeVCoeKteb 8V4nYekgNHJBtuOsy4wqDwtBPTl13u4V22LWcDKxAmQx3ZNWnjItAgis2DOmHAMjTAdk Gsmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=0v050svZEeKX6xCxDWehqmojLYZEjuvnVFUXjaedZaw=; fh=nVOUpWk4i9IaiM8attFGhknIUNj+kyogA8/76Wc2qLU=; b=Hkam8NbITtR7XpS4CN1r4SJW45AOa1rt4RHc5j9czReoKCwvDzMtHtagGKUEby5LNB p7OwZN6s7o0mY8cUbE40WaeQb7QvmZNqHdqI7aTdyPONa9wIEY5Bdk17Wrxbb1gWHAke H9bt6MBLOYT2gn6rgVufkN+208M7A0PY8CoGhXyTRwCH1eXaN71DK5Jmo9tpEWwWKryE XtSnHvG1vEI1ePwu7Vz4r2cxaoeVh0Ao70DHSYG7nZiGkVRi5QuW8L0VSBcwB62oE/UV QoWN6LUbG1q3y5eTnfrAK0YDLqA4USXZtjF6LnB50Lr93TUFk8yzeCv+27y4jRzyJy2i lo6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6089-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g11-20020a1709063b0b00b00a4e7e177696si5768050ejf.725.2024.04.10.05.45.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6089-linux.lists.archive=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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6089-linux.lists.archive=gmail.com@vger.kernel.org" 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 E156D1F214B1 for ; Wed, 10 Apr 2024 12:45:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C49C15B0E9; Wed, 10 Apr 2024 12:45:49 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 B67CF158DB9; Wed, 10 Apr 2024 12:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712753149; cv=none; b=pwFcqdp/TPgbLmtge9pfcY7DyR25sUImWc4GSLRcK7jpIFtKZW4Twoue0w8p81TxKc6EN+5tBIrss4QgPM6TH8GFKFfd1zD79Ah4kJ5P7h4i8hmYYEEu6TbgnLWFYSAOZzY3AoqZikHdndly7Nt+4eRb0dc2eGiGhGVqDdx+Pd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712753149; c=relaxed/simple; bh=tD4QkZOAj61aCZGjCPwk6wEvCiQTwcMYYHOPnCN8QvY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=caLjvBYQF2gG3KQLDtNgX6WwWMt01kt1OgJZjkCueVgqJ+Hzi2qgyPubdIwSXUpOXUgmJZqmMxqY4GJam2GHX37zvw0hXNbk7zLRPd/F0/LOWtXLx/6kx265ISAtQtHl24xL6t6M8x5L+UPdLEekUrc5crJ+3gXJPXVcEQOP7Zw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a51beae2f13so478433466b.1; Wed, 10 Apr 2024 05:45:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712753146; x=1713357946; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0v050svZEeKX6xCxDWehqmojLYZEjuvnVFUXjaedZaw=; b=oM4wLB39UtR0jl7LNNK73uySSZsDUcXqjMr08JwAQt6iA5zVWcmCEQ7AuUwNbHul51 fQ1yoIGjLgCKmo7oFhqLj1YoRCHm87qmCyN0KBfYLBmx63QT6ckzbzTwJgkYizU1MdgZ xtXdvlSsOEsPEOz9F6Vjk7fG4kkUdePf34+jeQ90vINYOLzn4qB0MG3ndybCijEaotFp rRiP9dMFzp+iEHPyO2UgJyaJ5wIisRqAIjVJwpwlURkl777dUfDr7WySAMpmZ+tNRpaV qmdP+afNTN1QIE5bDvOG9thW/L2uHyTFg15YbEs5s5UcbkdVtpCQP5Icf3uN+4XFFT2+ AQ2Q== X-Forwarded-Encrypted: i=1; AJvYcCWqEHAnxPxseS6ZbAWYAiPOsM5ePTbpU97taATHRGZEoK8MWtko540Y93K2Yo+D7lN1/aMGyHxjL5+bNS8pcZzVwrxe5vahnog6sz7bYnrUkHWZyHkNmCNX59gn66+8KZXEtjmwbreaMRDkMY7FSPvQpq3WeMJekiwUQf8jcfoN8TTx2OMxCdTtWQIC0D9GzwsWSQrgPWGkUfg= X-Gm-Message-State: AOJu0YwWsSuTyF+03FPZ9BsTbv2sKbxotTbpw1eVBw4NrVLTgSGu3bBn 3zTC4U73YTorMM/g1IaewTfAA2SK22WXk96VqNzcs67e0qEBlfKn X-Received: by 2002:a17:907:7da8:b0:a51:dd50:6a with SMTP id oz40-20020a1709077da800b00a51dd50006amr2008839ejc.66.1712753145630; Wed, 10 Apr 2024 05:45:45 -0700 (PDT) Received: from gmail.com (fwdproxy-lla-007.fbsv.net. [2a03:2880:30ff:7::face:b00c]) by smtp.gmail.com with ESMTPSA id jg18-20020a170907971200b00a51a60bf400sm6765658ejc.76.2024.04.10.05.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:45:45 -0700 (PDT) Date: Wed, 10 Apr 2024 05:45:41 -0700 From: Breno Leitao To: Ido Schimmel Cc: aleksander.lobakin@intel.com, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, elder@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, nbd@nbd.name, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo@kernel.org, taras.chornyi@plvision.eu, ath11k@lists.infradead.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, geomatsi@gmail.com, kvalo@kernel.org, quic_jjohnson@quicinc.com, leon@kernel.org, dennis.dalessandro@cornelisnetworks.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Jiri Pirko , Simon Horman , Daniel Borkmann , Sebastian Andrzej Siewior , amcohen@nvidia.com Subject: Re: [PATCH net-next v4 2/9] net: create a dummy net_device allocator Message-ID: References: <20240409125738.1824983-1-leitao@debian.org> <20240409125738.1824983-3-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-wireless@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: On Wed, Apr 10, 2024 at 02:10:04PM +0300, Ido Schimmel wrote: > On Tue, Apr 09, 2024 at 05:57:16AM -0700, Breno Leitao wrote: > > It is impossible to use init_dummy_netdev together with alloc_netdev() > > as the 'setup' argument. > > > > This is because alloc_netdev() initializes some fields in the net_device > > structure, and later init_dummy_netdev() memzero them all. This causes > > some problems as reported here: > > > > https://lore.kernel.org/all/20240322082336.49f110cc@kernel.org/ > > > > Split the init_dummy_netdev() function in two. Create a new function called > > init_dummy_netdev_core() that does not memzero the net_device structure. > > Then have init_dummy_netdev() memzero-ing and calling > > init_dummy_netdev_core(), keeping the old behaviour. > > > > init_dummy_netdev_core() is the new function that could be called as an > > argument for alloc_netdev(). > > > > Also, create a helper to allocate and initialize dummy net devices, > > leveraging init_dummy_netdev_core() as the setup argument. This function > > basically simplify the allocation of dummy devices, by allocating and > > initializing it. Freeing the device continue to be done through > > free_netdev() > > > > Suggested-by: Jakub Kicinski > > Signed-off-by: Breno Leitao > > Reviewed-by: Ido Schimmel > > We were about to submit another user of init_dummy_netdev() when I > noticed this patch. Converted the code to use alloc_netdev_dummy() [1] > and it seems to be working fine. Will submit after your patch is > accepted. Thanks. It seems that this patch is close to get accepted. Let's see... > See a few minor comments below. > > [...] > > > +/** > > + * init_dummy_netdev - init a dummy network device for NAPI > > + * @dev: device to init > > + * > > + * This takes a network device structure and initialize the minimum > > s/initialize/initializes/ > > > + * amount of fields so it can be used to schedule NAPI polls without > > + * registering a full blown interface. This is to be used by drivers > > + * that need to tie several hardware interfaces to a single NAPI > > + * poll scheduler due to HW limitations. > > + */ > > +void init_dummy_netdev(struct net_device *dev) > > +{ > > + /* Clear everything. Note we don't initialize spinlocks > > + * are they aren't supposed to be taken by any of the > > I assume you meant s/are/as/ ? Thanks for the feedback, I agree with all of them. Since these lines were not introduced by this patch, and this patch is just moving code (and comments) around, I would add a new patch to the patch series fixing the grammar errors.