From: "Greenwalt, Paul" <paul.greenwalt@intel.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>,
<anthony.l.nguyen@intel.com>
Cc: Eric Joyner <eric.joyner@intel.com>,
Alice Michael <alice.michael@intel.com>,
intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1] ice: Add E830 checksum support
Date: Wed, 4 Sep 2024 19:24:17 -0700 [thread overview]
Message-ID: <fccd53ed-a331-a398-17b0-d8c42f694748@intel.com> (raw)
In-Reply-To: <a2a7f63c-69ca-d7cb-8a1a-935403cb3d8e@intel.com>
On 9/3/2024 8:29 PM, Greenwalt, Paul wrote:
>>>
>>> @@ -6237,6 +6243,7 @@ ice_fix_features(struct net_device *netdev, netdev_features_t features)
>>> struct ice_netdev_priv *np = netdev_priv(netdev);
>>> netdev_features_t req_vlan_fltr, cur_vlan_fltr;
>>> bool cur_ctag, cur_stag, req_ctag, req_stag;
>>> + netdev_features_t changed;
>>>
>>> cur_vlan_fltr = netdev->features & NETIF_VLAN_FILTERING_FEATURES;
>>> cur_ctag = cur_vlan_fltr & NETIF_F_HW_VLAN_CTAG_FILTER;
>>> @@ -6285,6 +6292,29 @@ ice_fix_features(struct net_device *netdev, netdev_features_t features)
>>> features &= ~NETIF_VLAN_STRIPPING_FEATURES;
>>> }
>>>
>>> + if (!ice_is_feature_supported(np->vsi->back, ICE_F_GCS) ||
>>> + !(features & NETIF_F_HW_CSUM))
>>> + return features;
>>> +
>>> + changed = netdev->features ^ features;
>>> +
>>> + /* HW checksum feature is supported and set, so enforce mutual
>>> + * exclusivity of TSO and GCS.
>>> + */
>>> + if (features & NETIF_F_ALL_TSO) {
>>
>> if (!(features & ALL_TSO))
>> return features;
>>
>> to reduce indent level and avoid huge `if` blocks.
>>
Hi Olek and Tony, you both had feedback related to the change to
ice_fix_features().
Olek: to reduce indent level and avoid huge `if` blocks.
Tony: This prevents adding any other feature checks below this in the
future.
Seems like we should rework this into the feature being checked so that
we don't have this restriction.
Would using two helper functions for fixing DVM, and another for GCS and
TSO address your feedback? By adding feature checks are the top of the
helper functions and returning early, this could reduce the indent level
and avoid the huge 'if' block, while removing the restriction of adding
feature checks below these in the future.
Thanks,
Paul
>>> + if (changed & NETIF_F_HW_CSUM && changed & NETIF_F_ALL_TSO) {
>>> + netdev_warn(netdev, "Dropping TSO and HW checksum. TSO and HW checksum are mutually exclusive.\n");
>>> + features &= ~NETIF_F_HW_CSUM;
>>> + features &= ~((features & changed) & NETIF_F_ALL_TSO);
prev parent reply other threads:[~2024-09-05 2:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 17:39 [Intel-wired-lan] [PATCH iwl-next v1] ice: Add E830 checksum support Paul Greenwalt
2024-08-29 21:03 ` Tony Nguyen
2024-08-30 13:30 ` Alexander Lobakin
2024-09-04 3:29 ` Greenwalt, Paul
2024-09-05 2:24 ` Greenwalt, Paul [this message]
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=fccd53ed-a331-a398-17b0-d8c42f694748@intel.com \
--to=paul.greenwalt@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=alice.michael@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=eric.joyner@intel.com \
--cc=intel-wired-lan@lists.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