lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220127154335.623551-1-alexandr.lobakin@intel.com>
Date:   Thu, 27 Jan 2022 16:43:35 +0100
From:   Alexander Lobakin <alexandr.lobakin@...el.com>
To:     Tony Nguyen <anthony.l.nguyen@...el.com>
Cc:     Alexander Lobakin <alexandr.lobakin@...el.com>,
        "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "michal.swiatkowski@...ux.intel.com" 
        <michal.swiatkowski@...ux.intel.com>,
        Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@...el.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 3/4] ice: switch: use a struct to pass packet template params

From: Tony Nguyen <anthony.l.nguyen@...el.com>
Date: Wed, 26 Jan 2022 22:39:38 +0100

> 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@...el.com>
> 
> This isn't applying to next-queue.

Ah, right, there's a small non-semantic conflict. I've just sent v2.

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

Right, I somehow missed that (usually I build kernels with W=1),
sorry >_< Fixed in v2.

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

Thanks,
Al

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ