Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
To: <intel-wired-lan@osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next v2] ice: Allow 100M speeds for some devices
Date: Mon, 8 Aug 2022 10:44:51 -0700	[thread overview]
Message-ID: <b7b6c6b8-58d3-2aed-7124-44ce585ef783@intel.com> (raw)
In-Reply-To: <f55dc242-eaa1-fa58-38d7-1b48f3d00394@molgen.mpg.de>

> Am 28.07.22 um 21:23 schrieb Mikael Barsehyan:
>> From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
>>
>> For certain devices, 100M speeds are supported. Do not mask off
>> 100M speed for these devices.
> 
> Please list the devices in the commit message.

So you're asking that device IDs be listed in the commit message? Seems 
a bit redundant seeing as they can be inferred from the code quite 
easily. Let me know if you feel otherwise.

> 
> Please also describe the implementation in the commit message.

My understanding is that commit messages should list the what and the 
why, not the how.

> 
> How did you test this?

For ethtool <ethX>, 100M will not be listed as a link mode for devices 
that don't support it.

> 
>> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
>> Co-developed-by: Chinh T Cao <chinh.t.cao@intel.com>
>> Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
>> Signed-off-by: Mikael Barsehyan <mikael.barsehyan@intel.com>
>> ---
>>   drivers/net/ethernet/intel/ice/ice_common.c  | 20 ++++++++++++++++++++
>>   drivers/net/ethernet/intel/ice/ice_common.h  |  1 +
>>   drivers/net/ethernet/intel/ice/ice_ethtool.c | 11 +++++++----
>>   3 files changed, 28 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_common.c 
>> b/drivers/net/ethernet/intel/ice/ice_common.c
>> index 05a4acfbdd1d..010385e67665 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_common.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_common.c
>> @@ -2775,6 +2775,26 @@ ice_aq_set_port_params(struct ice_port_info 
>> *pi, bool double_vlan,
>>       return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
>>   }
>> +/**
>> + * ice_is_100m_speed_supported
>> + * @hw: pointer to the HW struct
>> + *
>> + * returns true if 100M speeds are supported by the device,
>> + * false otherwise.
>> + */
>> +bool ice_is_100m_speed_supported(struct ice_hw *hw)
>> +{
>> +    switch (hw->device_id) {
>> +    case ICE_DEV_ID_E822C_SGMII:
>> +    case ICE_DEV_ID_E822L_SGMII:
>> +    case ICE_DEV_ID_E823L_1GBE:
>> +    case ICE_DEV_ID_E823C_SGMII:
>> +        return true;
>> +    default:
>> +        return false;
>> +    }
> 
> Is there no way to determine this during run-time without maintaining a 
> list?

No.

> 
>> +}
>> +
>>   /**
>>    * ice_get_link_speed_based_on_phy_type - returns link speed
>>    * @phy_type_low: lower part of phy_type
>> diff --git a/drivers/net/ethernet/intel/ice/ice_common.h 
>> b/drivers/net/ethernet/intel/ice/ice_common.h
>> index a74df1d3a002..2734296bdd3b 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_common.h
>> +++ b/drivers/net/ethernet/intel/ice/ice_common.h
>> @@ -205,6 +205,7 @@ ice_aq_set_gpio(struct ice_hw *hw, u16 
>> gpio_ctrl_handle, u8 pin_idx, bool value,
>>   int
>>   ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,
>>           bool *value, struct ice_sq_cd *cd);
>> +bool ice_is_100m_speed_supported(struct ice_hw *hw);
> 
> I’d name it `is_100mbits_supported`.

Naming is a bit subjective I suppose. As long as the function name is 
sensible and readable, it's fine.

To each their own I suppose. :-)

Ani
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2022-08-08 17:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 19:23 [Intel-wired-lan] [PATCH net-next v2] ice: Allow 100M speeds for some devices Mikael Barsehyan
2022-07-29 17:51 ` Tony Nguyen
2022-08-02  6:48 ` Paul Menzel
2022-08-08 17:44   ` Anirudh Venkataramanan [this message]
2022-08-11  0:10     ` Rustad, Mark D
2022-08-12  8:12       ` Paul Menzel

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=b7b6c6b8-58d3-2aed-7124-44ce585ef783@intel.com \
    --to=anirudh.venkataramanan@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