netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	Julia Lawall <Julia.Lawall@inria.fr>,
	Marcin Szycik <marcin.szycik@linux.intel.com>
Subject: Re: [PATCH iwl-next v1 13/13] ice: field get conversion
Date: Thu, 30 Nov 2023 16:26:38 +0000	[thread overview]
Message-ID: <20231130162638.GB32077@kernel.org> (raw)
In-Reply-To: <7f2f2eaa-ab5b-461f-80ae-fce4133a2c1d@intel.com>

On Wed, Nov 29, 2023 at 02:31:53PM -0800, Jesse Brandeburg wrote:
> On 11/24/2023 3:03 AM, Simon Horman wrote:
> > On Tue, Nov 21, 2023 at 01:19:21PM -0800, Jesse Brandeburg wrote:
> >> Refactor the ice driver to use FIELD_GET() for mask and shift reads,
> >> which reduces lines of code and adds clarity of intent.
> >>
> >> This code was generated by the following coccinelle/spatch script and
> >> then manually repaired.
> >>
> >> @get@
> >> constant shift,mask;
> >> type T;
> >> expression a;
> >> @@
> >> -(((T)(a) & mask) >> shift)
> >> +FIELD_GET(mask, a)
> >>
> >> and applied via:
> >> spatch --sp-file field_prep.cocci --in-place --dir \
> >>  drivers/net/ethernet/intel/
> >>
> >> Cc: Julia Lawall <Julia.Lawall@inria.fr>
> >> Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> >> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> > 
> > Reviewed-by: Simon Horman <horms@kernel.org>
> > 
> 
> thanks for the review Simon! I wanted to note here, I found a small fix
> was needed to the code while doing further review and testing on this patch.
> 
> <pasted as quote below>
> 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c
> > index 7f3e00c187b4..74418c445cc4 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_dcb.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_dcb.c
> > @@ -967,7 +967,7 @@ void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi,
> > 
> >         mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;
> > 
> > -       change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M,  mib->type);
> > +       change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M, mib->type);
> >         if (change_type == ICE_AQ_LLDP_MIB_REMOTE)
> >                 dcbx_cfg = &pi->qos_cfg.remote_dcbx_cfg;
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> > index 8cdd53412748..d1c1e53fe15c 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> > @@ -974,8 +974,8 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw, struct ice_vsi_ctx *ctxt)
> >         /* Traffic from VSI can be sent to LAN */
> >         ctxt->info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;
> >         /* allow all untagged/tagged packets by default on Tx */
> > -       ctxt->info.inner_vlan_flags = FIELD_GET(ICE_AQ_VSI_INNER_VLAN_TX_MODE_M,
> > -                                               ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL);
> > +       ctxt->info.inner_vlan_flags = FIELD_PREP(ICE_AQ_VSI_INNER_VLAN_TX_MODE_M,
> > +                                                ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL);
> >         /* SVM - by default bits 3 and 4 in inner_vlan_flags are 0's which
> >          * results in legacy behavior (show VLAN, DEI, and UP) in descriptor.
> >          *
> 
> I'll work with Tony to get the fixes above applied before he relays the
> patch upstream as a pull request.

Thanks Jesse,

for the record this is fine by me.

  reply	other threads:[~2023-11-30 16:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21 21:19 [PATCH iwl-next v1 00/13] intel: use FIELD_PREP and FIELD_GET Jesse Brandeburg
2023-11-21 21:19 ` [PATCH iwl-next v1 01/13] e1000e: make lost bits explicit Jesse Brandeburg
2023-11-24 10:59   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 02/13] intel: add bit macro includes where needed Jesse Brandeburg
2023-11-24 10:59   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 03/13] intel: legacy: field prep conversion Jesse Brandeburg
2023-11-24 10:59   ` Simon Horman
2023-12-05  6:15   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-11-21 21:19 ` [PATCH iwl-next v1 04/13] i40e: " Jesse Brandeburg
2023-11-24 11:00   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 05/13] iavf: " Jesse Brandeburg
2023-11-24 11:00   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 06/13] ice: " Jesse Brandeburg
2023-11-24 11:00   ` Simon Horman
2023-12-05  6:29   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-11-21 21:19 ` [PATCH iwl-next v1 07/13] ice: fix pre-shifted bit usage Jesse Brandeburg
2023-11-24 11:00   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 08/13] igc: field prep conversion Jesse Brandeburg
2023-11-24 11:01   ` Simon Horman
2023-12-05 11:16   ` [Intel-wired-lan] " naamax.meir
2023-11-21 21:19 ` [PATCH iwl-next v1 09/13] intel: legacy: field get conversion Jesse Brandeburg
2023-11-24 11:01   ` Simon Horman
2023-12-05  6:33   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-11-21 21:19 ` [PATCH iwl-next v1 10/13] igc: " Jesse Brandeburg
2023-11-24 11:01   ` Simon Horman
2023-12-06  8:22   ` [Intel-wired-lan] " naamax.meir
2023-11-21 21:19 ` [PATCH iwl-next v1 11/13] i40e: " Jesse Brandeburg
2023-11-24 11:02   ` Simon Horman
2023-11-27  8:38   ` Loktionov, Aleksandr
2023-12-05  6:38   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-11-21 21:19 ` [PATCH iwl-next v1 12/13] iavf: " Jesse Brandeburg
2023-11-24 11:02   ` Simon Horman
2023-11-21 21:19 ` [PATCH iwl-next v1 13/13] ice: " Jesse Brandeburg
2023-11-24 11:03   ` Simon Horman
2023-11-29 22:31     ` Jesse Brandeburg
2023-11-30 16:26       ` Simon Horman [this message]
2023-12-05  6:41   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy

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=20231130162638.GB32077@kernel.org \
    --to=horms@kernel.org \
    --cc=Julia.Lawall@inria.fr \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=marcin.szycik@linux.intel.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).