From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next 3/4] ice: switch: use a struct to pass packet template params
Date: Wed, 26 Jan 2022 21:39:38 +0000 [thread overview]
Message-ID: <6375d82b976f18eb085859082c548b35b168cf14.camel@intel.com> (raw)
In-Reply-To: <20220124173116.739083-4-alexandr.lobakin@intel.com>
On Mon, 2022-01-24 at 18:31 +0100, Alexander Lobakin wrote:
> ice_find_dummy_packet() contains a lot of boilerplate code and a
> nice room for copy-paste mistakes.
> Instead of passing 3 separate pointers back and forth to get packet
> template (dummy) params, directly return a structure containing
> them. Then, use a macro to compose compound literals and avoid code
> duplication on return path.
> Now, dummy packet type/name is needed only once to return a full
> correct triple pkt-pkt_len-offsets, and those are all one-liners.
>
> Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
This isn't applying to next-queue.
<snip>
> @@ -4960,11 +4974,9 @@ ice_add_adv_recipe(struct ice_hw *hw, struct
> ice_adv_lkup_elem *lkups,
> ? * @pkt_len: packet length of dummy packet
> ? * @offsets: pointer to receive the pointer to the offsets for the
> packet
> ? */
> -static void
> +static struct ice_dummy_pkt_profile
> ?ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16
> lkups_cnt,
> -???????????????????? enum ice_sw_tunnel_type tun_type,
> -???????????????????? const u8 **pkt, u16 *pkt_len,
> -???????????????????? const struct ice_dummy_pkt_offsets **offsets)
> +???????????????????? enum ice_sw_tunnel_type tun_type)
kdoc needs to be updated here.
<snip>
> ?/**
> @@ -5104,8 +5065,7 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem
> *lkups, u16 lkups_cnt,
> ?static int
> ?ice_fill_adv_dummy_packet(struct ice_adv_lkup_elem *lkups, u16
> lkups_cnt,
> ????????????????????????? struct ice_aqc_sw_rules_elem *s_rule,
> -???????????????????????? const u8 *dummy_pkt, u16 pkt_len,
> -???????????????????????? const struct ice_dummy_pkt_offsets
> *offsets)
> +???????????????????????? const struct ice_dummy_pkt_profile
> *profile)
Here as well.
Thanks,
Tony
next prev parent reply other threads:[~2022-01-26 21:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 17:31 [Intel-wired-lan] [PATCH net-next 0/4] ice: switch: debloat packet templates code Alexander Lobakin
2022-01-24 17:31 ` [Intel-wired-lan] [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 ` [Intel-wired-lan] [PATCH net-next 2/4] ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet() Alexander Lobakin
2022-01-24 17:31 ` [Intel-wired-lan] [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 [this message]
2022-01-27 15:43 ` Alexander Lobakin
2022-01-24 17:31 ` [Intel-wired-lan] [PATCH net-next 4/4] ice: switch: use convenience macros to declare dummy pkt templates Alexander Lobakin
2022-01-24 17:31 ` [Intel-wired-lan] ice: Add support for inner etype in switchdev Alexander Lobakin
2022-01-24 17:35 ` Alexander Lobakin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6375d82b976f18eb085859082c548b35b168cf14.camel@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox