netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] ice: switch: debloat packet templates code
@ 2022-01-24 17:31 Alexander Lobakin
  2022-01-24 17:31 ` [PATCH net-next 1/4] ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h,m}_u Alexander Lobakin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alexander Lobakin @ 2022-01-24 17:31 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: Alexander Lobakin, Jesse Brandeburg, Maciej Fijalkowski,
	Michal Swiatkowski, Martyna Szapar-Mudlaw, David S. Miller,
	Jakub Kicinski, netdev, linux-kernel

Applies on top of
commit 1ed7aede32fd ("ice: Add support for inner etype in switchdev")
(here: [0]) to exclude non-trivial conflicts and cover the code added
there as well.

This hunts down several places around packet templates/dummies for
switch rules which are either repetitive, fragile or just not
really readable code.
It's a common need to add new packet templates and to review such
changes as well, try to simplify both with the help of a pair
macros and aliases.

bloat-o-meter is happy about that (built w/ LLVM 13):

add/remove: 0/1 grow/shrink: 2/0 up/down: 148/-202 (-54)
Function                                     old     new   delta
ice_add_adv_rule                            2383    2529    +146
ice_fill_adv_dummy_packet                    289     291      +2
ice_adv_add_update_vsi_list                  202       -    -202
Total: Before=395813, After=395759, chg -0.01%

Diffstat also looks nice, and adding new packet templates now takes
less lines.

We'll probably come out with dynamic template crafting in a while,
but for now let's improve what we have currently.

[0] https://lists.osuosl.org/pipermail/intel-wired-lan/Week-of-Mon-20220110/027399.html

Alexander Lobakin (4):
  ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h,m}_u
  ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet()
  ice: switch: use a struct to pass packet template params
  ice: switch: use convenience macros to declare dummy pkt templates

 drivers/net/ethernet/intel/ice/ice_switch.c | 264 ++++++++------------
 drivers/net/ethernet/intel/ice/ice_switch.h |  12 +-
 2 files changed, 120 insertions(+), 156 deletions(-)

base-commit: 1ed7aede32fd46f0fac72cef138c9d5e36326c98
-- 
2.34.1


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

end of thread, other threads:[~2022-01-27 15:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24 17:31 [PATCH net-next 0/4] ice: switch: debloat packet templates code Alexander Lobakin
2022-01-24 17:31 ` [PATCH net-next 1/4] ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h,m}_u Alexander Lobakin
2022-01-24 17:31 ` [PATCH net-next 2/4] ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet() Alexander Lobakin
2022-01-24 17:31 ` [PATCH net-next 3/4] ice: switch: use a struct to pass packet template params Alexander Lobakin
2022-01-26 21:39   ` Nguyen, Anthony L
2022-01-27 15:43     ` Alexander Lobakin
2022-01-24 17:31 ` [PATCH net-next 4/4] ice: switch: use convenience macros to declare dummy pkt templates Alexander Lobakin
2022-01-24 17:31 ` ice: Add support for inner etype in switchdev Alexander Lobakin
2022-01-24 17:35   ` Alexander Lobakin

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).