netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 v2 0/3] refactor the cmd_exec()
@ 2019-06-11 16:10 Matteo Croce
  2019-06-11 16:10 ` [PATCH iproute2 v2 1/3] netns: switch netns in the child when executing commands Matteo Croce
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Matteo Croce @ 2019-06-11 16:10 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern

Refactor the netns and ipvrf code so less steps are needed to exec commands
in a netns or a VRF context.
Also remove some code which became dead. bloat-o-meter output:

$ bloat-o-meter ip.old ip
add/remove: 1/4 grow/shrink: 3/4 up/down: 174/-312 (-138)
Function                                     old     new   delta
netns_add                                    971    1058     +87
cmd_exec                                     207     256     +49
on_netns_exec                                 32      60     +28
do_switch                                      -      10     +10
netns_restore                                 69      67      -2
do_ipvrf                                     811     802      -9
netns_switch                                 838     822     -16
on_netns_label                                45       -     -45
do_netns                                    1226    1180     -46
do_each_netns                                 57       -     -57
on_netns                                      60       -     -60
netns_save                                    77       -     -77
Total: Before=668234, After=668096, chg -0.02%

Matteo Croce (3):
  netns: switch netns in the child when executing commands
  ip vrf: use hook to change VRF in the child
  netns: make netns_{save,restore} static

 include/namespace.h |  2 --
 include/utils.h     |  6 ++---
 ip/ip.c             |  1 -
 ip/ipnetns.c        | 56 +++++++++++++++++++++++++++++++++------------
 ip/ipvrf.c          | 12 ++++++----
 lib/exec.c          |  7 +++++-
 lib/namespace.c     | 31 -------------------------
 lib/utils.c         | 27 ----------------------
 8 files changed, 58 insertions(+), 84 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH iproute2 v2 0/3] refactor the cmd_exec()
@ 2019-06-18 14:49 Matteo Croce
  2019-06-18 14:49 ` [PATCH iproute2 v2 2/3] ip vrf: use hook to change VRF in the child Matteo Croce
  0 siblings, 1 reply; 10+ messages in thread
From: Matteo Croce @ 2019-06-18 14:49 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Andrea Claudi

Refactor the netns and ipvrf code so less steps are needed to exec commands
in a netns or a VRF context.
Also remove some code which became dead. bloat-o-meter shows a tiny saving.

Matteo Croce (3):
  netns: switch netns in the child when executing commands
  ip vrf: use hook to change VRF in the child
  netns: make netns_{save,restore} static

 include/namespace.h |  2 --
 include/utils.h     |  6 ++---
 ip/ip.c             |  1 -
 ip/ipnetns.c        | 61 ++++++++++++++++++++++++++++++++++-----------
 ip/ipvrf.c          | 12 ++++++---
 lib/exec.c          |  7 +++++-
 lib/namespace.c     | 31 -----------------------
 lib/utils.c         | 27 --------------------
 8 files changed, 63 insertions(+), 84 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-06-18 14:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 16:10 [PATCH iproute2 v2 0/3] refactor the cmd_exec() Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 1/3] netns: switch netns in the child when executing commands Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 2/3] ip vrf: use hook to change VRF in the child Matteo Croce
2019-06-11 16:10 ` [PATCH iproute2 v2 3/3] netns: make netns_{save,restore} static Matteo Croce
2019-06-13 17:07 ` [PATCH iproute2 v2 0/3] refactor the cmd_exec() Andrea Claudi
2019-06-14 14:35 ` David Ahern
2019-06-15 14:06   ` Matteo Croce
2019-06-17 22:20     ` Matteo Croce
2019-06-17 22:24       ` David Ahern
2019-06-18 14:49 Matteo Croce
2019-06-18 14:49 ` [PATCH iproute2 v2 2/3] ip vrf: use hook to change VRF in the child Matteo Croce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).