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] [thread-next>] [day] [month] [year] [list]
Message-ID: <e45bb504-df59-4f6b-af0f-da7d27ba9ed0@amd.com>
Date: Tue, 19 Dec 2023 17:10:53 -0800
From: "Nelson, Shannon" <shannon.nelson@....com>
To: Tony Nguyen <anthony.l.nguyen@...el.com>, davem@...emloft.net,
 kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
 netdev@...r.kernel.org
Cc: jesse.brandeburg@...el.com
Subject: Re: [PATCH net-next 00/15][pull request] intel: use bitfield
 operations

On 12/18/2023 11:48 AM, Tony Nguyen wrote:
> 
> Jesse Brandeburg says:
> 
> After repeatedly getting review comments on new patches, and sporadic
> patches to fix parts of our drivers, we should just convert the Intel code
> to use FIELD_PREP() and FIELD_GET().  It's then "common" in the code and
> hopefully future change-sets will see the context and do-the-right-thing.
> 
> This conversion was done with a coccinelle script which is mentioned in the
> commit messages. Generally there were only a couple conversions that were
> "undone" after the automatic changes because they tried to convert a
> non-contiguous mask.
> 
> Patch 1 is required at the beginning of this series to fix a "forever"
> issue in the e1000e driver that fails the compilation test after conversion
> because the shift / mask was out of range.
> 
> The second patch just adds all the new #includes in one go.
> 
> The patch titled: "ice: fix pre-shifted bit usage" is needed to allow the
> use of the FIELD_* macros and fix up the unexpected "shifts included"
> defines found while creating this series.
> 
> The rest are the conversion to use FIELD_PREP()/FIELD_GET(), and the
> occasional leXX_{get,set,encode}_bits() call, as suggested by Alex.
> 
> The following are changes since commit 610a689d2a57af3e21993cb6d8c3e5f839a8c89e:
>    Merge branch 'rtnl-rcu'
> and are available in the git repository at:
>    git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 1GbE


Thanks for doing these - this certainly makes it significantly less mind 
numbing to read all those bitfield things.

Is there any plan to remove all those xxx_S and xxx_SHIFT defines now? 
I expect not, but I thought I'd ask.

A couple little things I saw, not really worth messing with at this point:
  - 04/15: unnecessary {} {} on an if block in i40e_mdio_if_number_selection
  - 09/15: unnecessary line removal in 09/15
  - 13/15: ice_get_dcbx_status you could have put the rd32() in the new 
FIELD_GET() and dropped the ‘reg’ variable, as was done in some other 
instances earlier

Otherwise, for the series:

Reviewed-by: Shannon Nelson <shannon.nelson@....com>



> 
> Jesse Brandeburg (15):
>    e1000e: make lost bits explicit
>    intel: add bit macro includes where needed
>    intel: legacy: field prep conversion
>    i40e: field prep conversion
>    iavf: field prep conversion
>    ice: field prep conversion
>    ice: fix pre-shifted bit usage
>    igc: field prep conversion
>    intel: legacy: field get conversion
>    igc: field get conversion
>    i40e: field get conversion
>    iavf: field get conversion
>    ice: field get conversion
>    ice: cleanup inconsistent code
>    idpf: refactor some missing field get/prep conversions
> 
>   drivers/net/ethernet/intel/e1000/e1000_hw.c   |  46 ++-
>   .../net/ethernet/intel/e1000e/80003es2lan.c   |  23 +-
>   drivers/net/ethernet/intel/e1000e/82571.c     |   3 +-
>   drivers/net/ethernet/intel/e1000e/ethtool.c   |   7 +-
>   drivers/net/ethernet/intel/e1000e/ich8lan.c   |  18 +-
>   drivers/net/ethernet/intel/e1000e/mac.c       |   2 +-
>   drivers/net/ethernet/intel/e1000e/netdev.c    |  11 +-
>   drivers/net/ethernet/intel/e1000e/phy.c       |  24 +-
>   drivers/net/ethernet/intel/fm10k/fm10k_pf.c   |   7 +-
>   drivers/net/ethernet/intel/fm10k/fm10k_vf.c   |  10 +-
>   drivers/net/ethernet/intel/i40e/i40e_common.c | 140 ++++-----
>   drivers/net/ethernet/intel/i40e/i40e_dcb.c    | 276 +++++++-----------
>   drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c |   3 +-
>   drivers/net/ethernet/intel/i40e/i40e_ddp.c    |   4 +-
>   .../net/ethernet/intel/i40e/i40e_ethtool.c    |   7 +-
>   drivers/net/ethernet/intel/i40e/i40e_main.c   |  85 +++---
>   drivers/net/ethernet/intel/i40e/i40e_nvm.c    |  14 +-
>   drivers/net/ethernet/intel/i40e/i40e_ptp.c    |   4 +-
>   drivers/net/ethernet/intel/i40e/i40e_txrx.c   |  70 ++---
>   .../ethernet/intel/i40e/i40e_virtchnl_pf.c    |  29 +-
>   drivers/net/ethernet/intel/i40e/i40e_xsk.c    |   3 +-
>   drivers/net/ethernet/intel/iavf/iavf_common.c |  34 +--
>   .../net/ethernet/intel/iavf/iavf_ethtool.c    |   8 +-
>   drivers/net/ethernet/intel/iavf/iavf_fdir.c   |   3 +-
>   drivers/net/ethernet/intel/iavf/iavf_txrx.c   |  21 +-
>   .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  10 +-
>   drivers/net/ethernet/intel/ice/ice_base.c     |  32 +-
>   drivers/net/ethernet/intel/ice/ice_common.c   |  54 ++--
>   drivers/net/ethernet/intel/ice/ice_dcb.c      |  79 ++---
>   drivers/net/ethernet/intel/ice/ice_dcb_lib.c  |   2 +-
>   drivers/net/ethernet/intel/ice/ice_dcb_nl.c   |   2 +-
>   drivers/net/ethernet/intel/ice/ice_eswitch.c  |   4 +-
>   .../net/ethernet/intel/ice/ice_ethtool_fdir.c |   3 +-
>   drivers/net/ethernet/intel/ice/ice_fdir.c     |  69 ++---
>   .../net/ethernet/intel/ice/ice_flex_pipe.c    |   8 +-
>   drivers/net/ethernet/intel/ice/ice_lag.c      |   7 +-
>   drivers/net/ethernet/intel/ice/ice_lib.c      |  54 ++--
>   drivers/net/ethernet/intel/ice/ice_main.c     |  48 ++-
>   drivers/net/ethernet/intel/ice/ice_nvm.c      |  15 +-
>   drivers/net/ethernet/intel/ice/ice_ptp.c      |  13 +-
>   drivers/net/ethernet/intel/ice/ice_sched.c    |   3 +-
>   drivers/net/ethernet/intel/ice/ice_sriov.c    |  41 +--
>   drivers/net/ethernet/intel/ice/ice_switch.c   |  75 +++--
>   drivers/net/ethernet/intel/ice/ice_txrx.c     |   6 +-
>   drivers/net/ethernet/intel/ice/ice_virtchnl.c |   2 +-
>   .../ethernet/intel/ice/ice_virtchnl_fdir.c    |  13 +-
>   .../net/ethernet/intel/ice/ice_vsi_vlan_lib.c |  41 +--
>   .../ethernet/intel/idpf/idpf_singleq_txrx.c   |   7 +-
>   drivers/net/ethernet/intel/idpf/idpf_txrx.c   |  58 ++--
>   drivers/net/ethernet/intel/igb/e1000_82575.c  |  29 +-
>   drivers/net/ethernet/intel/igb/e1000_i210.c   |  19 +-
>   drivers/net/ethernet/intel/igb/e1000_mac.c    |   2 +-
>   drivers/net/ethernet/intel/igb/e1000_nvm.c    |  18 +-
>   drivers/net/ethernet/intel/igb/e1000_phy.c    |  17 +-
>   drivers/net/ethernet/intel/igb/igb_ethtool.c  |  11 +-
>   drivers/net/ethernet/intel/igb/igb_main.c     |  13 +-
>   drivers/net/ethernet/intel/igbvf/mbx.c        |   1 +
>   drivers/net/ethernet/intel/igbvf/netdev.c     |  33 +--
>   drivers/net/ethernet/intel/igc/igc_base.c     |   6 +-
>   drivers/net/ethernet/intel/igc/igc_i225.c     |   6 +-
>   drivers/net/ethernet/intel/igc/igc_main.c     |  10 +-
>   drivers/net/ethernet/intel/igc/igc_phy.c      |   5 +-
>   .../net/ethernet/intel/ixgbe/ixgbe_82598.c    |   2 +-
>   .../net/ethernet/intel/ixgbe/ixgbe_common.c   |  30 +-
>   drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c |   4 +-
>   drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   2 +-
>   drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |   8 +-
>   .../net/ethernet/intel/ixgbe/ixgbe_sriov.c    |   8 +-
>   drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c |   8 +-
>   drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |  19 +-
>   include/linux/avf/virtchnl.h                  |   1 +
>   71 files changed, 734 insertions(+), 1016 deletions(-)
> 
> --
> 2.41.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ