<div dir="ltr"><div>Thanks Stefan for comments, I mostly agree.</div><div>Problem with upstream 4d50fcdc2476eef94c14c6761073af5667bb43b6 is that it doesn't really fix bb52f42acef6 (even though the commit message says so).</div><div>Proper commit should be Fixes: df006dd (this is the patch which introduced LAG handler without NVM caps check)<br></div><div>That's why I approached the path set this way but I understand that it was not clearly clarified.</div><div><br></div><div>I'll properly backport all patches required for <span class="gmail-LI gmail-ng gmail-Vs">4d50fcdc.</span></div><div><span class="gmail-LI gmail-ng gmail-Vs"><br></span></div><div><span class="gmail-LI gmail-ng gmail-Vs">Regards,</span></div><div><span class="gmail-LI gmail-ng gmail-Vs">Robert<br></span></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 10, 2024 at 9:38 AM Stefan Bader <<a href="mailto:stefan.bader@canonical.com">stefan.bader@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 04.01.24 13:19, Robert Malz wrote:<br>
> From: Dave Ertman <<a href="mailto:david.m.ertman@intel.com" target="_blank">david.m.ertman@intel.com</a>><br>
> <br>
> BugLink: <a href="https://bugs.launchpad.net/bugs/2036239" rel="noreferrer" target="_blank">https://bugs.launchpad.net/bugs/2036239</a><br>
> <br>
> Previously, the ice driver had support for using a handler for bonding<br>
> netdev events to ensure that conflicting features were not allowed to be<br>
> activated at the same time.  While this was still in place, additional<br>
> support was added to specifically support SRIOV and LAG together.  These<br>
> both utilized the netdev event handler, but the SRIOV and LAG feature was<br>
> behind a capabilities feature check to make sure the current NVM has<br>
> support.<br>
> <br>
> The exclusion part of the event handler should be removed since there are<br>
> users who have custom made solutions that depend on the non-exclusion of<br>
> features.<br>
> <br>
> Wrap the creation/registration and cleanup of the event handler and<br>
> associated structs in the probe flow with a feature check so that the<br>
> only systems that support the full implementation of LAG features will<br>
> initialize support.  This will leave other systems unhindered with<br>
> functionality as it existed before any LAG code was added.<br>
> <br>
> Fixes: bb52f42acef6 ("ice: Add driver support for firmware changes for LAG")<br>
<br>
Rejected for the following reasons:<br>
- As this stands this would be totally confusing. The patch claims to <br>
fix some<br>
   change which is not present in Jammy right now.<br>
- If I read this right you try to fix some problem which needs the <br>
driver support<br>
   added and that has to be fixed. We rather prefer to use the proper <br>
upstream<br>
   sequence of things. So this should be a 2 patch set (at least).<br>
   This is important also because various processes check for certain <br>
patches<br>
   being applied to decide whether a fix is needed. This would break <br>
badly when<br>
   mushing patches together.<br>
<br>
-Stefan<br>
> Reviewed-by: Jesse Brandeburg <<a href="mailto:jesse.brandeburg@intel.com" target="_blank">jesse.brandeburg@intel.com</a>><br>
> Signed-off-by: Dave Ertman <<a href="mailto:david.m.ertman@intel.com" target="_blank">david.m.ertman@intel.com</a>><br>
> Reviewed-by: Simon Horman <<a href="mailto:horms@kernel.org" target="_blank">horms@kernel.org</a>><br>
> Tested-by: Pucha Himasekhar Reddy <<a href="mailto:himasekharx.reddy.pucha@intel.com" target="_blank">himasekharx.reddy.pucha@intel.com</a>> (A Contingent worker at Intel)<br>
> Signed-off-by: Tony Nguyen <<a href="mailto:anthony.l.nguyen@intel.com" target="_blank">anthony.l.nguyen@intel.com</a>><br>
> <br>
> (backported from commit 4d50fcdc2476eef94c14c6761073af5667bb43b6)<br>
> [rmalz: additionally backported necessary changes from bb52f42]<br>
> Signed-off-by: Robert Malz <<a href="mailto:robert.malz@canonical.com" target="_blank">robert.malz@canonical.com</a>><br>
> ---<br>
>   drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 3 +++<br>
>   drivers/net/ethernet/intel/ice/ice_common.c     | 8 ++++++++<br>
>   drivers/net/ethernet/intel/ice/ice_lag.c        | 3 +++<br>
>   drivers/net/ethernet/intel/ice/ice_type.h       | 2 ++<br>
>   4 files changed, 16 insertions(+)<br>
> <br>
> diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h<br>
> index 21b4c7cd6f05..9a721f9d38ee 100644<br>
> --- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h<br>
> +++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h<br>
> @@ -118,6 +118,9 @@ struct ice_aqc_list_caps_elem {<br>
>   #define ICE_AQC_CAPS_PENDING_NET_VER                        0x004D<br>
>   #define ICE_AQC_CAPS_RDMA                           0x0051<br>
>   #define ICE_AQC_CAPS_NVM_MGMT                               0x0080<br>
> +#define ICE_AQC_CAPS_FW_LAG_SUPPORT                  0x0092<br>
> +#define ICE_AQC_BIT_ROCEV2_LAG                               0x01<br>
> +#define ICE_AQC_BIT_SRIOV_LAG                                0x02<br>
>   <br>
>       u8 major_ver;<br>
>       u8 minor_ver;<br>
> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c<br>
> index 3de6f16f985a..f8d9b2be26c8 100644<br>
> --- a/drivers/net/ethernet/intel/ice/ice_common.c<br>
> +++ b/drivers/net/ethernet/intel/ice/ice_common.c<br>
> @@ -2022,6 +2022,14 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,<br>
>               ice_debug(hw, ICE_DBG_INIT, "%s: max_mtu = %d\n",<br>
>                         prefix, caps->max_mtu);<br>
>               break;<br>
> +     case ICE_AQC_CAPS_FW_LAG_SUPPORT:<br>
> +             caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG);<br>
> +             ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %u\n",<br>
> +                       prefix, caps->roce_lag);<br>
> +             caps->sriov_lag = !!(number & ICE_AQC_BIT_SRIOV_LAG);<br>
> +             ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n",<br>
> +                       prefix, caps->sriov_lag);<br>
> +             break;<br>
>       default:<br>
>               /* Not one of the recognized common capabilities */<br>
>               found = false;<br>
> diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c<br>
> index 4f954db01b92..01030346398d 100644<br>
> --- a/drivers/net/ethernet/intel/ice/ice_lag.c<br>
> +++ b/drivers/net/ethernet/intel/ice/ice_lag.c<br>
> @@ -391,6 +391,9 @@ int ice_init_lag(struct ice_pf *pf)<br>
>       struct ice_vsi *vsi;<br>
>       int err;<br>
>   <br>
> +     if (!pf->hw.dev_caps.common_cap.sriov_lag)<br>
> +             return 0;<br>
> +<br>
>       pf->lag = kzalloc(sizeof(*lag), GFP_KERNEL);<br>
>       if (!pf->lag)<br>
>               return -ENOMEM;<br>
> diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h<br>
> index d33d1906103c..fcee84c6fa6e 100644<br>
> --- a/drivers/net/ethernet/intel/ice/ice_type.h<br>
> +++ b/drivers/net/ethernet/intel/ice/ice_type.h<br>
> @@ -268,6 +268,8 @@ struct ice_hw_common_caps {<br>
>       u8 dcb;<br>
>       u8 ieee_1588;<br>
>       u8 rdma;<br>
> +     u8 roce_lag;<br>
> +     u8 sriov_lag;<br>
>   <br>
>       bool nvm_update_pending_nvm;<br>
>       bool nvm_update_pending_orom;<br>
<br>
-- <br>
- Stefan<br>
<br>
</blockquote></div>