From patchwork Fri Apr 26 09:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13644454 X-Patchwork-Delegate: kvalo@adurom.com Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 1B8471C02; Fri, 26 Apr 2024 09:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123926; cv=none; b=GQ7DSHDZQGXpHk5kwZyuuOvVEUpXFIqf/boL2kS7RjKEnfyVs8lu9ZVyIqudCIbUA5ruPZcsN0PwUsSOBo6D6Rcg4Gf7KX+9cckuvP+BtJz6iQti5ikXY7TLswPP9RscQlxTK8EDGO9nR9KsR0edC+wriOPiNuoFaRRN4cnJRSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123926; c=relaxed/simple; bh=rWF4T1ptwSPqA7KfHBNu5E0FUQmnrOyU/QxzFxfeU0E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rgh1OQXlJaWmBKrc3RL60algPvEtfnDCLhj9TVWV0MrJZ3cxHxtsVaP/37hlTvH5tm9qpdS9+zRPch4DvRouNtF2DA9uYh+N5OzK4fVYnrhH/dbxICw5MMYeAnBcTFTLoqFZssvYjRhjl/hUe4rDtC99qjLaHjuUgcwGqnGx6Xg= 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.208.51 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-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-572229f196cso2268297a12.2; Fri, 26 Apr 2024 02:32:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714123923; x=1714728723; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8gBPNnUV2Yn9Is2h8W1Y2Sei5FTqscCR/HpPNQnVetk=; b=Y02dI7QcjHStm87Ep2hhhx9VrV+rf6qAPitzHCNTBmt+WuXTPOQxAUDb//sdgyzTEF UnsDERmnQa+ZJRaqiC3wLIvvtA2OvAWLsYwitYjO9wAWTbnqC49pzxb71d0ooLEqreJc IfmwmIOMzbr4nQrwJ92eiGtoOWKWrEqU36ZXmr/sMDyK5zVOC41B/bOZv3O+EEET70Ck JB9OcAwTWVMHEb+Egtf1Tbp4C+6LQqWwz5UMofkw5yL0X+JMrhwRwKnBg/xNPwsFj/w3 i/TNS8VrYLWgx7bwabdqiNfDC+/y//+Vr8AhE+H0dfch3Sd+WkrJs82rUf5u6fjb8Cbz VpPw== X-Forwarded-Encrypted: i=1; AJvYcCVFHKA4jMDKmeLcKDN/c0UVSYc5BTGgwPULNbiTljYtt5+GzMzxeU88Mb6SEz9tzadRdvfgqQN3em/4iKuySZCZz3PVSzie1hOfAVhV X-Gm-Message-State: AOJu0YzrYCJPLoXtwWB5FSfJoZgPNA9M2nUh9aAONXm3fEpYmzke8iFh Mt8RfY/4gsdy6zc16VB1t20xZvRylMdPwCKvHwP7eKA3VQfcJ+fK X-Google-Smtp-Source: AGHT+IGjErk/3ApxpRPSTqyt/IYR+02NI5iRozuFmjFtbV2BdHu34uBHIEzirvS3Cd+uFy76rSRa8w== X-Received: by 2002:a05:6402:229a:b0:572:5f53:816f with SMTP id cw26-20020a056402229a00b005725f53816fmr18669edb.37.1714123923193; Fri, 26 Apr 2024 02:32:03 -0700 (PDT) Received: from localhost (fwdproxy-lla-008.fbsv.net. [2a03:2880:30ff:8::face:b00c]) by smtp.gmail.com with ESMTPSA id cn18-20020a0564020cb200b00571bfc97b79sm9535631edb.55.2024.04.26.02.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:32:02 -0700 (PDT) From: Breno Leitao To: kvalo@kernel.org, Igor Mitsyanko , Sergey Matyukevich Cc: linux-wireless@vger.kernel.org, kuba@kernel.org, Johannes Berg , linux-kernel@vger.kernel.org (open list) Subject: [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Date: Fri, 26 Apr 2024 02:31:48 -0700 Message-ID: <20240426093156.2002258-1-leitao@debian.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With commit 34d21de99cea9 ("net: Move {l,t,d}stats allocation to core and convert veth & vrf"), stats allocation could be done on net core instead of this driver. With this new approach, the driver doesn't have to bother with error handling (allocation failure checking, making sure free happens in the right spot, etc). This is core responsibility now. Move qtnfmac driver to leverage the core allocation. Signed-off-by: Breno Leitao --- drivers/net/wireless/quantenna/qtnfmac/core.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) PS: This is compile-tested only due to lack of hardware. diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 677bac835330..0aa4b1d14809 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -196,22 +196,8 @@ static int qtnf_netdev_port_parent_id(struct net_device *ndev, return 0; } -static int qtnf_netdev_alloc_pcpu_stats(struct net_device *dev) -{ - dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); - - return dev->tstats ? 0 : -ENOMEM; -} - -static void qtnf_netdev_free_pcpu_stats(struct net_device *dev) -{ - free_percpu(dev->tstats); -} - /* Network device ops handlers */ const struct net_device_ops qtnf_netdev_ops = { - .ndo_init = qtnf_netdev_alloc_pcpu_stats, - .ndo_uninit = qtnf_netdev_free_pcpu_stats, .ndo_open = qtnf_netdev_open, .ndo_stop = qtnf_netdev_close, .ndo_start_xmit = qtnf_netdev_hard_start_xmit, @@ -483,6 +469,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT; dev->tx_queue_len = 100; dev->ethtool_ops = &qtnf_ethtool_ops; + dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; if (qtnf_hwcap_is_set(&mac->bus->hw_info, QLINK_HW_CAPAB_HW_BRIDGE)) dev->needed_tailroom = sizeof(struct qtnf_frame_meta_info); From patchwork Fri Apr 26 09:31:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 13644455 X-Patchwork-Delegate: kvalo@adurom.com Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 8634B13F45D; Fri, 26 Apr 2024 09:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123930; cv=none; b=BwswTP3G8o/H0kmNlx7F6kb6gxZha1gPb8H68ZRJs4XIMqPmRRUMC6w/lkDmPO9M7nTKhxo8Xke42pK6lrTlMhpLP6jte6kEsDazOq2YxAg9A4T/6NC9GKtlN/hQkk6fnpvSfbv5X5npCk1PblpMyhPOVstHm2IK856C3speCKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714123930; c=relaxed/simple; bh=lrNuWaHK5BdyB8pVP8kuJCm68c1uOozItiB7SfFwPIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N0hLe9uZCPOZCJ2cNcknzQKmD6DBgFjpPSJfK/JcOUmvzlWx1Z0gL9/Ljt/la5Kc3gGbpb/bXYRohggcjkvrH5npheT9qsFb7C2HBARCcUmal9PhAIMi6G3JRz7G2q2jO4uwnZYSmLubqvydyYtM8y97/04JR3s20mE5/5Zasd0= 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.46 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-f46.google.com with SMTP id a640c23a62f3a-a55ab922260so262259266b.3; Fri, 26 Apr 2024 02:32:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714123927; x=1714728727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KB47YEskg0YsuvufIWkNOdLy1BfCNPRDkJhRY5gUXJc=; b=iPOnWxxuSlPgCS/PaJSkO8d6TJCc2emkhnJ3PfRlMJZfdmldfbjkIvoktQnT72lONP 7cR3DV3wDXuGIczdYxkjallA+u4xPSJsdDtuf7XQ5kMRYXeJmN6RLwH1p1WiWcjufD5d uq9mpRtvi7ce7WY2fHDqo34CdkRmebDT0a2wF7dWxoA1xS4CFquEnWE9heqac7ncypbe 84wmudoyhksFQ++tXSDpOIgB2iOkGTZGKfcKE6Y43Oft0xFysAtKqfgni9QDcnBR97nR DirHrj7R99hb0L8wAru+YVlMoU9+5jPs86HrN7tDUVF4ZSFQSirnBrhOk/DdGGYxs0a9 qUkw== X-Forwarded-Encrypted: i=1; AJvYcCX9x43ccFexcW/+UoDTK5DrJYvcP1QftmtpjXosAIQyZjUXyueHHGj/9unduu2WFeOcyZlmZstCTEgXlX4t5Ns7xSaIs9SKrObxrfes X-Gm-Message-State: AOJu0YzaFRLWs5QbiuoOgdZd5m6F3udSbYiZKFyQkqZlghvCDhXzKQyv lc6QUfgpsG38fidYCf5GPmgionG2NakUIGDI1wCJej9ix2M+Vidr X-Google-Smtp-Source: AGHT+IFRY4i8ripmmRgmZcMA4dCbq+M0SBXKAURjKWqCOr/9ZZ0ocBXIuwONrHVrNX7KKn7K4WqV8A== X-Received: by 2002:a17:906:c12:b0:a58:9e89:7d91 with SMTP id s18-20020a1709060c1200b00a589e897d91mr1406081ejf.42.1714123926789; Fri, 26 Apr 2024 02:32:06 -0700 (PDT) Received: from localhost (fwdproxy-lla-009.fbsv.net. [2a03:2880:30ff:9::face:b00c]) by smtp.gmail.com with ESMTPSA id z12-20020a170906270c00b00a55895c7f50sm8897398ejc.151.2024.04.26.02.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:32:06 -0700 (PDT) From: Breno Leitao To: kvalo@kernel.org, Igor Mitsyanko , Sergey Matyukevich Cc: linux-wireless@vger.kernel.org, kuba@kernel.org, Johannes Berg , linux-kernel@vger.kernel.org (open list) Subject: [PATCH wireless 2/2] wifi: qtnfmac: Remove generic .ndo_get_stats64 Date: Fri, 26 Apr 2024 02:31:49 -0700 Message-ID: <20240426093156.2002258-2-leitao@debian.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240426093156.2002258-1-leitao@debian.org> References: <20240426093156.2002258-1-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit 3e2f544dd8a33 ("net: get stats64 if device if driver is configured") moved the callback to dev_get_tstats64() to net core, so, unless the driver is doing some custom stats collection, it does not need to set .ndo_get_stats64. Since this driver is now relying in NETDEV_PCPU_STAT_TSTATS, then, it doesn't need to set the dev_get_tstats64() generic .ndo_get_stats64 function pointer. Signed-off-by: Breno Leitao --- drivers/net/wireless/quantenna/qtnfmac/core.c | 1 - 1 file changed, 1 deletion(-) PS: This is compile-tested only due to lack of hardware. diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 0aa4b1d14809..825b05dd3271 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -202,7 +202,6 @@ const struct net_device_ops qtnf_netdev_ops = { .ndo_stop = qtnf_netdev_close, .ndo_start_xmit = qtnf_netdev_hard_start_xmit, .ndo_tx_timeout = qtnf_netdev_tx_timeout, - .ndo_get_stats64 = dev_get_tstats64, .ndo_set_mac_address = qtnf_netdev_set_mac_address, .ndo_get_port_parent_id = qtnf_netdev_port_parent_id, };