* [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core
@ 2024-04-26 9:31 Breno Leitao
2024-04-26 9:31 ` [PATCH wireless 2/2] wifi: qtnfmac: Remove generic .ndo_get_stats64 Breno Leitao
2024-05-02 7:20 ` [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2024-04-26 9:31 UTC (permalink / raw)
To: kvalo, Igor Mitsyanko, Sergey Matyukevich
Cc: linux-wireless, kuba, Johannes Berg, open list
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 <leitao@debian.org>
---
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);
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH wireless 2/2] wifi: qtnfmac: Remove generic .ndo_get_stats64
2024-04-26 9:31 [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Breno Leitao
@ 2024-04-26 9:31 ` Breno Leitao
2024-05-02 7:20 ` [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Breno Leitao @ 2024-04-26 9:31 UTC (permalink / raw)
To: kvalo, Igor Mitsyanko, Sergey Matyukevich
Cc: linux-wireless, kuba, Johannes Berg, open list
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 <leitao@debian.org>
---
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,
};
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core
2024-04-26 9:31 [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Breno Leitao
2024-04-26 9:31 ` [PATCH wireless 2/2] wifi: qtnfmac: Remove generic .ndo_get_stats64 Breno Leitao
@ 2024-05-02 7:20 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-05-02 7:20 UTC (permalink / raw)
To: Breno Leitao
Cc: Igor Mitsyanko, Sergey Matyukevich, linux-wireless, kuba,
Johannes Berg, open list
Breno Leitao <leitao@debian.org> wrote:
> 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 <leitao@debian.org>
2 patches applied to wireless-next.git, thanks.
3d1a6e573bb1 wifi: qtnfmac: Move stats allocation to core
8886b6d681f2 wifi: qtnfmac: Remove generic .ndo_get_stats64
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240426093156.2002258-1-leitao@debian.org/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-02 7:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 9:31 [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Breno Leitao
2024-04-26 9:31 ` [PATCH wireless 2/2] wifi: qtnfmac: Remove generic .ndo_get_stats64 Breno Leitao
2024-05-02 7:20 ` [PATCH wireless 1/2] wifi: qtnfmac: Move stats allocation to core Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®