Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp768562lqp; Thu, 21 Mar 2024 15:18:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLPU5jl9ekZEj0+TvosFC3WsXczun6ukhS1Sq2LzmJDEpxMVmu3CRD+Xl4C63ELj4Ke5Or+R5YostCEV4HLmWzDBV7i2Mf2THPT85m9Q== X-Google-Smtp-Source: AGHT+IE+3qevbZxtE/YoigeQClPATCulmBkrHdgFvQjXux/VK7220FPag19eUmbqXSLJD37FQ7f+ X-Received: by 2002:a50:9557:0:b0:56b:bfa5:4b44 with SMTP id v23-20020a509557000000b0056bbfa54b44mr356191eda.33.1711059496392; Thu, 21 Mar 2024 15:18:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711059496; cv=pass; d=google.com; s=arc-20160816; b=RZP4GfAXfXH34t2X/S58NbuW3SUkwP3sJtTa59u+rY/nPTj266UP1TDqN1HEFR+9DN Z1+a60a1/kuOSiuWFm/oL5yCv/qKuqDUy9HMTI5YXKpt8WH81SkAfP+DvP8VkRb+mQ63 1JshIMkH0pOZQQuQRWACJdwQ4i8RAonYz30JUoqMH3742uJSE04lhK9bQvn4tp9NiklY 8eISBQplczXnPwLEBO/tveV17aHpoElD8JkT2J757LagZXJD/Ossyz0f6geuD93nYaF1 f9HSNZtBHFxj10rfSx8aJnp5dpCa0OF43Y2G/IEPSlQjMfZ1vChEwHeJVGZwchntqE8V 5r2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=kbuSOUvqWDsjyU4fjFA8El1Gew11D8TvfCnpljOHrBk=; fh=78aS6OSbQca+AmLri7x7TjGL6CS3tiUzr5vx0S9bN/A=; b=0ahwjdQHyK/qBMRqDyWwC7jbZdNVEfjDCVt75hRlo+GIDWgPOXI+iFTcVWbsP5AsTo oulD9PzSMqWX9qSzTsG6DzmpHnO1hUQoTuP1k6vGSB6rPewYXoIm+qC5Kzt74z6R1NhU L/AwHQiEPcz9rbAW3SRnP5Kj1EgrkqogBHTwGnawytzLDVntFsMpdgWqYCECHwJ/UImX tK7A6zK06Nc/B6Oa3ky5hYXEAtFkvOcZTGITT0rOuCTvEJPjoaOc8snkpIK+w8pux+HB SJb/erOlpmlp0r2PfInSXtFZhiahGDXokwoi2xsDg01E/jMpDVkReyiTZitiooXMz2xt z9IQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=isCQZVOh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ds5-20020a0564021cc500b005689f73497asi315592edb.0.2024.03.21.15.18.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 15:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5124-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=isCQZVOh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-5124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 255B01F229B2 for ; Thu, 21 Mar 2024 22:18:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16E33136669; Thu, 21 Mar 2024 22:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="isCQZVOh" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E2ADF132C37; Thu, 21 Mar 2024 22:17:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711059466; cv=none; b=HRq34bpG6qwHhKvw3dxUDDc4eXwxww94KrYjAtZaoX/rMDEJLnCtxjKHOneTLLmORoeOVZY33ag0uwrw2pLycMQjxlTJ8Y5LG/lAA8FAFdlmJX6PECwveGGZ47PMAb7QES0MR+La86NCE1lwhZkKSdf+0Fk4HL+ekeo2uhElGIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711059466; c=relaxed/simple; bh=DjmJQ+78BPWvsjUAWnoJZsxc2vrITxo9QPDsDLcM/+A=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S3FOqmqD/1CuB9Vlf4KespfrMQsxiY8CHGWLB/rJYaRZL6G3CU6m3B26AbjcS+BxiK8t/oXBWLXQxHSmHDgaHb6leTL3XR6aBWcRZ6RuqwDIEbA9FiqmCJr3JLXnjyytRYAulvQjN3+rybB2LTcCcficcU5/4VCpEK3cK1WAFsY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=isCQZVOh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14B46C433F1; Thu, 21 Mar 2024 22:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711059465; bh=DjmJQ+78BPWvsjUAWnoJZsxc2vrITxo9QPDsDLcM/+A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=isCQZVOhwUx8IUng+hpByG45djv/aCqomgiN+lAwM5SalgcrXR7MaOtV2Zt74d93C YudbDwv62+18fgCECgChIwHqRhV87r8NcvRpIaVLKDrNERRTZ+oj1OieZkEKkLW6+Z LnhbP2lo/8rA5gZxp7cWjKHhsPFU5QyZuX2V2PZLuT4dkY0tizZHaTkSEeeEIdsJDc h9WwM8BWDJlqKsBIybLuL2itFunpzZDy39TqGa1uU02PG8NDRryw50SKwi50xI0q+B DZVvn+42IkzVniLvO72AfemDh22BFgA0BrFa7gwUq0joXHx7xixrko8chSvKetl5tH cVg+ONEfm192g== Date: Thu, 21 Mar 2024 15:17:44 -0700 From: Jakub Kicinski To: Jeff Johnson Cc: Breno Leitao , Kalle Valo , Jeff Johnson , , "open list:NETWORKING DRIVERS (WIRELESS)" , "open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER" , open list Subject: Re: [PATCH] ath10k: allocate dummy net_device dynamically Message-ID: <20240321151744.246ce2d0@kernel.org> In-Reply-To: <5039256c-03eb-4cda-8d11-49e4561cf1ef@quicinc.com> References: <20240319104754.2535294-1-leitao@debian.org> <9fcdb857-da62-4832-ae11-043fe993e4ad@quicinc.com> <20240321072821.59f56757@kernel.org> <5039256c-03eb-4cda-8d11-49e4561cf1ef@quicinc.com> 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-Transfer-Encoding: 7bit On Thu, 21 Mar 2024 15:02:39 -0700 Jeff Johnson wrote: > >> As suggested there we should just use kmalloc/kfree to match the existing logic. > > > > Please no. There is no magic here. alloc + free must match whether > > you're using magic object alloc wrapper (alloc_netdev()) or straight > > up kzalloc(). > > Based upon the ath11k patch there must be something going on with > alloc_netdev()/free_netdev() that doesn't occur when these aren't used. Looks like init_dummy_netdev wipes the netdev structure clean, so I don't think we can use it directly as the setup function, Breno :( Maybe we should add a new helper to "alloc dummy netdev" which can call alloc_netdev() with right arguments and do necessary init? > So I'm just suggesting that instead we use kmalloc() and kfree(), which are > matching functions, and which, like the existing code, are not subject to > whatever is happening in alloc_netdev()/free_netdev(). > > I don't understand your objection. Using subsystem APIs to allocate its objects is preferable to ad hoc kmalloc(). We're working upstream, basic alloc/free of an object should work. Took me 5 min to realize what the problem is.