* [PATCH net-next 1/2] openvswitch: Move stats allocation to core
@ 2024-05-31 11:15 Breno Leitao
2024-05-31 11:15 ` [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64 Breno Leitao
2024-06-04 14:10 ` [PATCH net-next 1/2] openvswitch: Move stats allocation to core patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Breno Leitao @ 2024-05-31 11:15 UTC (permalink / raw)
To: Pravin B Shelar, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: netdev, horms, open list:OPENVSWITCH, 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 openvswitch driver to leverage the core allocation.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
net/openvswitch/vport-internal_dev.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 74c88a6baa43..7daba6ac6912 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -140,11 +140,7 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
err = -ENOMEM;
goto error_free_vport;
}
- vport->dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
- if (!vport->dev->tstats) {
- err = -ENOMEM;
- goto error_free_netdev;
- }
+ dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
dev_net_set(vport->dev, ovs_dp_get_net(vport->dp));
dev->ifindex = parms->desired_ifindex;
@@ -169,8 +165,6 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
error_unlock:
rtnl_unlock();
- free_percpu(dev->tstats);
-error_free_netdev:
free_netdev(dev);
error_free_vport:
ovs_vport_free(vport);
@@ -186,7 +180,6 @@ static void internal_dev_destroy(struct vport *vport)
/* unregister_netdevice() waits for an RCU grace period. */
unregister_netdevice(vport->dev);
- free_percpu(vport->dev->tstats);
rtnl_unlock();
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64
2024-05-31 11:15 [PATCH net-next 1/2] openvswitch: Move stats allocation to core Breno Leitao
@ 2024-05-31 11:15 ` Breno Leitao
2024-05-31 13:07 ` [EXTERNAL] " Subbaraya Sundeep Bhatta
2024-06-04 14:10 ` [PATCH net-next 1/2] openvswitch: Move stats allocation to core patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Breno Leitao @ 2024-05-31 11:15 UTC (permalink / raw)
To: Pravin B Shelar, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: netdev, horms, open list:OPENVSWITCH, 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>
---
net/openvswitch/vport-internal_dev.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 7daba6ac6912..4b33133cbdff 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -85,7 +85,6 @@ static const struct net_device_ops internal_dev_netdev_ops = {
.ndo_stop = internal_dev_stop,
.ndo_start_xmit = internal_dev_xmit,
.ndo_set_mac_address = eth_mac_addr,
- .ndo_get_stats64 = dev_get_tstats64,
};
static struct rtnl_link_ops internal_dev_link_ops __read_mostly = {
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [EXTERNAL] [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64
2024-05-31 11:15 ` [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64 Breno Leitao
@ 2024-05-31 13:07 ` Subbaraya Sundeep Bhatta
0 siblings, 0 replies; 4+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2024-05-31 13:07 UTC (permalink / raw)
To: Breno Leitao, Pravin B Shelar, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev@vger.kernel.org, horms@kernel.org, open list:OPENVSWITCH,
open list
Hi,
>-----Original Message-----
>From: Breno Leitao <leitao@debian.org>
>Sent: Friday, May 31, 2024 4:46 PM
>To: Pravin B Shelar <pshelar@ovn.org>; David S. Miller <davem@davemloft.net>;
>Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
>Abeni <pabeni@redhat.com>
>Cc: netdev@vger.kernel.org; horms@kernel.org; open list:OPENVSWITCH
><dev@openvswitch.org>; open list <linux-kernel@vger.kernel.org>
>Subject: [EXTERNAL] [PATCH net-next 2/2] openvswitch: Remove generic
>.ndo_get_stats64
>
>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>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Thanks,
Sundeep
>---
> net/openvswitch/vport-internal_dev.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-
>internal_dev.c
>index 7daba6ac6912..4b33133cbdff 100644
>--- a/net/openvswitch/vport-internal_dev.c
>+++ b/net/openvswitch/vport-internal_dev.c
>@@ -85,7 +85,6 @@ static const struct net_device_ops internal_dev_netdev_ops
>= {
> .ndo_stop = internal_dev_stop,
> .ndo_start_xmit = internal_dev_xmit,
> .ndo_set_mac_address = eth_mac_addr,
>- .ndo_get_stats64 = dev_get_tstats64,
> };
>
> static struct rtnl_link_ops internal_dev_link_ops __read_mostly = {
>--
>2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 1/2] openvswitch: Move stats allocation to core
2024-05-31 11:15 [PATCH net-next 1/2] openvswitch: Move stats allocation to core Breno Leitao
2024-05-31 11:15 ` [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64 Breno Leitao
@ 2024-06-04 14:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-04 14:10 UTC (permalink / raw)
To: Breno Leitao
Cc: pshelar, davem, edumazet, kuba, pabeni, netdev, horms, dev,
linux-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 31 May 2024 04:15:49 -0700 you 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.
>
> [...]
Here is the summary with links:
- [net-next,1/2] openvswitch: Move stats allocation to core
https://git.kernel.org/netdev/net-next/c/8c3fdff2171c
- [net-next,2/2] openvswitch: Remove generic .ndo_get_stats64
https://git.kernel.org/netdev/net-next/c/2b438c5774cc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-04 14:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 11:15 [PATCH net-next 1/2] openvswitch: Move stats allocation to core Breno Leitao
2024-05-31 11:15 ` [PATCH net-next 2/2] openvswitch: Remove generic .ndo_get_stats64 Breno Leitao
2024-05-31 13:07 ` [EXTERNAL] " Subbaraya Sundeep Bhatta
2024-06-04 14:10 ` [PATCH net-next 1/2] openvswitch: Move stats allocation to core patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox