€•Á�Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ./translations/zh_CN/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/zh_TW/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/it_IT/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ja_JP/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ko_KR/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/pt_BR/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/sp_SP/networking/netdev-features”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒH/var/lib/git/docbuild/linux/Documentation/networking/netdev-features.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ5Netdev features mess and how to get out from it alive”h]”hŒ5Netdev features mess and how to get out from it alive”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hŒ6Author: MichaÅ‚ MirosÅ‚aw ”h]”(hŒterm”“”)�”}”(hŒAuthor:”h]”hŒAuthor:”…”�”}”(hhêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hèh³hÇh´K hhäubhŒ definition”“”)�”}”(hhh]”hŒ paragraph”“”)�”}”(hŒ+MichaÅ‚ MirosÅ‚aw ”h]”(hŒMichaÅ‚ MirosÅ‚aw <”…”�”}”(hhÿh²hh³Nh´NubhŒ reference”“”)�”}”(hŒmirq-linux@rere.qmqm.pl”h]”hŒmirq-linux@rere.qmqm.pl”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:mirq-linux@rere.qmqm.pl”uh1jhhÿubhŒ>”…”�”}”(hhÿh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khhúubah}”(h]”h ]”h"]”h$]”h&]”uh1høhhäubeh}”(h]”h ]”h"]”h$]”h&]”uh1hâh³hÇh´K hhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhhÊh²hh³hÇh´NubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPart I: Feature sets”h]”hŒPart I: Feature sets”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj5h²hh³hÇh´K ubhþ)�”}”(hXnLong gone are the days when a network card would just take and give packets verbatim. Today's devices add multiple features and bugs (read: offloads) that relieve an OS of various tasks like generating and checking checksums, splitting packets, classifying them. Those capabilities and their state are commonly referred to as netdev features in Linux kernel world.”h]”hXpLong gone are the days when a network card would just take and give packets verbatim. Today’s devices add multiple features and bugs (read: offloads) that relieve an OS of various tasks like generating and checking checksums, splitting packets, classifying them. Those capabilities and their state are commonly referred to as netdev features in Linux kernel world.”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khj5h²hubhþ)�”}”(hŒrThere are currently three main sets of features on each netdevice, first and second are initialized by the driver:”h]”hŒrThere are currently three main sets of features on each netdevice, first and second are initialized by the driver:”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khj5h²hubhŒ block_quote”“”)�”}”(hX´1. netdev->hw_features set contains features whose state may possibly be changed (enabled or disabled) for a particular device by user's request. Drivers normally initialize this set before registration or in the ndo_init callback. Changes after registration should be made very carefully as other parts of the code may assume hw_features are static. At the very least changes must be made under rtnl_lock and the netdev instance lock, and followed by netdev_update_features(). 2. netdev->features set contains features which are currently enabled for a device. This should be changed only by network core or in error paths of ndo_set_features callback. 3. netdev->wanted_features set contains feature set requested by user. This set is filtered by ndo_fix_features callback whenever it or some device-specific conditions change. This set is internal to networking core and should not be referenced in drivers. ”h]”hŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hXÜnetdev->hw_features set contains features whose state may possibly be changed (enabled or disabled) for a particular device by user's request. Drivers normally initialize this set before registration or in the ndo_init callback. Changes after registration should be made very carefully as other parts of the code may assume hw_features are static. At the very least changes must be made under rtnl_lock and the netdev instance lock, and followed by netdev_update_features(). ”h]”hþ)�”}”(hXÛnetdev->hw_features set contains features whose state may possibly be changed (enabled or disabled) for a particular device by user's request. Drivers normally initialize this set before registration or in the ndo_init callback. Changes after registration should be made very carefully as other parts of the code may assume hw_features are static. At the very least changes must be made under rtnl_lock and the netdev instance lock, and followed by netdev_update_features().”h]”hXÝnetdev->hw_features set contains features whose state may possibly be changed (enabled or disabled) for a particular device by user’s request. Drivers normally initialize this set before registration or in the ndo_init callback. Changes after registration should be made very carefully as other parts of the code may assume hw_features are static. At the very least changes must be made under rtnl_lock and the netdev instance lock, and followed by netdev_update_features().”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubjn)�”}”(hŒ®netdev->features set contains features which are currently enabled for a device. This should be changed only by network core or in error paths of ndo_set_features callback. ”h]”hþ)�”}”(hŒ­netdev->features set contains features which are currently enabled for a device. This should be changed only by network core or in error paths of ndo_set_features callback.”h]”hŒ­netdev->features set contains features which are currently enabled for a device. This should be changed only by network core or in error paths of ndo_set_features callback.”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K hj‡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubjn)�”}”(hŒþnetdev->wanted_features set contains feature set requested by user. This set is filtered by ndo_fix_features callback whenever it or some device-specific conditions change. This set is internal to networking core and should not be referenced in drivers. ”h]”hþ)�”}”(hŒýnetdev->wanted_features set contains feature set requested by user. This set is filtered by ndo_fix_features callback whenever it or some device-specific conditions change. This set is internal to networking core and should not be referenced in drivers.”h]”hŒýnetdev->wanted_features set contains feature set requested by user. This set is filtered by ndo_fix_features callback whenever it or some device-specific conditions change. This set is internal to networking core and should not be referenced in drivers.”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K$hjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjjubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jhhjdubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´Khj5h²hubhþ)�”}”(hŒ1On top of those three main sets, each netdev has:”h]”hŒ1On top of those three main sets, each netdev has:”…”�”}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K)hj5h²hubjc)�”}”(hX1. Sets which control features inherited by child devices (VLAN, MPLS, hw_enc for L3/L4 tunnels). These sets allow the driver to limit which netdev->features are propagated, in case HW cannot perform the offloads with the extra headers present. 2. netdev->mangleid_features, TSO features which are supported only when IP ID field can be mangled (constant instead of incrementing) during TSO. 3. netdev->gso_partial_features, additional TSO features which HW can support via NETIF_F_GSO_PARTIAL. ”h]”ji)�”}”(hhh]”(jn)�”}”(hŒòSets which control features inherited by child devices (VLAN, MPLS, hw_enc for L3/L4 tunnels). These sets allow the driver to limit which netdev->features are propagated, in case HW cannot perform the offloads with the extra headers present. ”h]”hþ)�”}”(hŒñSets which control features inherited by child devices (VLAN, MPLS, hw_enc for L3/L4 tunnels). These sets allow the driver to limit which netdev->features are propagated, in case HW cannot perform the offloads with the extra headers present.”h]”hŒñSets which control features inherited by child devices (VLAN, MPLS, hw_enc for L3/L4 tunnels). These sets allow the driver to limit which netdev->features are propagated, in case HW cannot perform the offloads with the extra headers present.”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K+hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjÚubjn)�”}”(hŒ�netdev->mangleid_features, TSO features which are supported only when IP ID field can be mangled (constant instead of incrementing) during TSO. ”h]”hþ)�”}”(hŒ�netdev->mangleid_features, TSO features which are supported only when IP ID field can be mangled (constant instead of incrementing) during TSO.”h]”hŒ�netdev->mangleid_features, TSO features which are supported only when IP ID field can be mangled (constant instead of incrementing) during TSO.”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K0hjõubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjÚubjn)�”}”(hŒdnetdev->gso_partial_features, additional TSO features which HW can support via NETIF_F_GSO_PARTIAL. ”h]”hþ)�”}”(hŒcnetdev->gso_partial_features, additional TSO features which HW can support via NETIF_F_GSO_PARTIAL.”h]”hŒcnetdev->gso_partial_features, additional TSO features which HW can support via NETIF_F_GSO_PARTIAL.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K3hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjÚubeh}”(h]”h ]”h"]”h$]”h&]”j½j¾j¿hjÀjÁuh1jhhjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K+hj5h²hubeh}”(h]”Œpart-i-feature-sets”ah ]”h"]”Œpart i: feature sets”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ%Part II: Controlling enabled features”h]”hŒ%Part II: Controlling enabled features”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj9h²hh³hÇh´K7ubhþ)�”}”(hX¨When current feature set (netdev->features) is to be changed, new set is calculated and filtered by calling ndo_fix_features callback and netdev_fix_features(). If the resulting set differs from current set, it is passed to ndo_set_features callback and (if the callback returns success) replaces value stored in netdev->features. NETDEV_FEAT_CHANGE notification is issued after that whenever current set might have changed.”h]”hX¨When current feature set (netdev->features) is to be changed, new set is calculated and filtered by calling ndo_fix_features callback and netdev_fix_features(). If the resulting set differs from current set, it is passed to ndo_set_features callback and (if the callback returns success) replaces value stored in netdev->features. NETDEV_FEAT_CHANGE notification is issued after that whenever current set might have changed.”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K9hj9h²hubhÞ)�”}”(hhh]”hã)�”}”(hŒ¸The following events trigger recalculation: 1. device's registration, after ndo_init returned success 2. user requested changes in features state 3. netdev_update_features() is called ”h]”(hé)�”}”(hŒ+The following events trigger recalculation:”h]”hŒ+The following events trigger recalculation:”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hèh³hÇh´KDhj[ubhù)�”}”(hhh]”ji)�”}”(hhh]”(jn)�”}”(hŒ6device's registration, after ndo_init returned success”h]”hþ)�”}”(hjuh]”hŒ8device’s registration, after ndo_init returned success”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KBhjsubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjpubjn)�”}”(hŒ(user requested changes in features state”h]”hþ)�”}”(hjŒh]”hŒ(user requested changes in features state”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KChjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjpubjn)�”}”(hŒ#netdev_update_features() is called ”h]”hþ)�”}”(hŒ"netdev_update_features() is called”h]”hŒ"netdev_update_features() is called”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KDhj¡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjpubeh}”(h]”h ]”h"]”h$]”h&]”j½j¾j¿hjÀjÁuh1jhhjmubah}”(h]”h ]”h"]”h$]”h&]”uh1høhj[ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hâh³hÇh´KDhjXubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj9h²hh³Nh´Nubhþ)�”}”(hŒsndo_*_features callbacks are called with rtnl_lock held. Missing callbacks are treated as always returning success.”h]”hŒsndo_*_features callbacks are called with rtnl_lock held. Missing callbacks are treated as always returning success.”…”�”}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KFhj9h²hubhþ)�”}”(hXXA driver that wants to trigger recalculation must do so by calling netdev_update_features() while holding rtnl_lock. If the device uses the netdev instance lock, that lock must be held as well. This should not be done from ndo_*_features callbacks. netdev->features should not be modified by driver except by means of ndo_fix_features callback.”h]”hXXA driver that wants to trigger recalculation must do so by calling netdev_update_features() while holding rtnl_lock. If the device uses the netdev instance lock, that lock must be held as well. This should not be done from ndo_*_features callbacks. netdev->features should not be modified by driver except by means of ndo_fix_features callback.”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KIhj9h²hubhþ)�”}”(hXhFor "ops locked" drivers (see Documentation/networking/netdevices.rst), ethtool callbacks that may end up invoking netdev_update_features() must opt back into rtnl_lock by setting the matching ETHTOOL_OP_NEEDS_RTNL_* bit in ``ethtool_ops::op_needs_rtnl``. The ethtool core then keeps rtnl_lock held across those SET callbacks so the contract above still holds.”h]”(hŒäFor “ops lockedâ€� drivers (see Documentation/networking/netdevices.rst), ethtool callbacks that may end up invoking netdev_update_features() must opt back into rtnl_lock by setting the matching ETHTOOL_OP_NEEDS_RTNL_* bit in ”…”�”}”(hjíh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``ethtool_ops::op_needs_rtnl``”h]”hŒethtool_ops::op_needs_rtnl”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjíubhŒj. The ethtool core then keeps rtnl_lock held across those SET callbacks so the contract above still holds.”…”�”}”(hjíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KOhj9h²hubhþ)�”}”(hXndo_features_check is called for each skb before that skb is passed to ndo_start_xmit. Driver may perform any non-trivial checks (e.g. exact header geometry / length) and withdraw features like HW_CSUM or TSO, requesting the networking stack to fall back to the software implementation.”h]”hXndo_features_check is called for each skb before that skb is passed to ndo_start_xmit. Driver may perform any non-trivial checks (e.g. exact header geometry / length) and withdraw features like HW_CSUM or TSO, requesting the networking stack to fall back to the software implementation.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KVhj9h²hubeh}”(h]”Œ$part-ii-controlling-enabled-features”ah ]”h"]”Œ%part ii: controlling enabled features”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K7ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPart III: Implementation hints”h]”hŒPart III: Implementation hints”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj%h²hh³hÇh´K\ubjc)�”}”(hŒ* ndo_fix_features: ”h]”hŒ bullet_list”“”)�”}”(hhh]”jn)�”}”(hŒndo_fix_features: ”h]”hþ)�”}”(hŒndo_fix_features:”h]”hŒndo_fix_features:”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K^hj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj<ubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1j:h³hÇh´K^hj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K^hj%h²hubhþ)�”}”(hX(All dependencies between features should be resolved here. The resulting set can be reduced further by networking core imposed limitations (as coded in netdev_fix_features()). For this reason it is safer to disable a feature when its dependencies are not met instead of forcing the dependency on.”h]”hX(All dependencies between features should be resolved here. The resulting set can be reduced further by networking core imposed limitations (as coded in netdev_fix_features()). For this reason it is safer to disable a feature when its dependencies are not met instead of forcing the dependency on.”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K`hj%h²hubhþ)�”}”(hŒœThis callback should not modify hardware nor driver state (should be stateless). It can be called multiple times between successive ndo_set_features calls.”h]”hŒœThis callback should not modify hardware nor driver state (should be stateless). It can be called multiple times between successive ndo_set_features calls.”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kehj%h²hubhþ)�”}”(hŒðCallback must not alter features contained in NETIF_F_SOFT_FEATURES or NETIF_F_NEVER_CHANGE, except that NETIF_F_VLAN_CHALLENGED may be changed. Care must be taken as changes to NETIF_F_VLAN_CHALLENGED won't affect already configured VLANs.”h]”hŒòCallback must not alter features contained in NETIF_F_SOFT_FEATURES or NETIF_F_NEVER_CHANGE, except that NETIF_F_VLAN_CHALLENGED may be changed. Care must be taken as changes to NETIF_F_VLAN_CHALLENGED won’t affect already configured VLANs.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kihj%h²hubjc)�”}”(hŒ* ndo_set_features: ”h]”j;)�”}”(hhh]”jn)�”}”(hŒndo_set_features: ”h]”hþ)�”}”(hŒndo_set_features:”h]”hŒndo_set_features:”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Knhj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj“ubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´Knhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´Knhj%h²hubhþ)�”}”(hX”Hardware should be reconfigured to match passed feature set. The set should not be altered unless some error condition happens that can't be reliably detected in ndo_fix_features. In this case, the callback should update netdev->features to match resulting hardware state. Errors returned are not (and cannot be) propagated anywhere except dmesg. (Note: successful return is zero, >0 means silent error.)”h]”hX–Hardware should be reconfigured to match passed feature set. The set should not be altered unless some error condition happens that can’t be reliably detected in ndo_fix_features. In this case, the callback should update netdev->features to match resulting hardware state. Errors returned are not (and cannot be) propagated anywhere except dmesg. (Note: successful return is zero, >0 means silent error.)”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kphj%h²hubeh}”(h]”Œpart-iii-implementation-hints”ah ]”h"]”Œpart iii: implementation hints”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K\ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPart IV: Features”h]”hŒPart IV: Features”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÐh²hh³hÇh´Kzubhþ)�”}”(hŒtFor current list of features, see include/linux/netdev_features.h. This section describes semantics of some of them.”h]”hŒtFor current list of features, see include/linux/netdev_features.h. This section describes semantics of some of them.”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K|hjÐh²hubjc)�”}”(hŒ* Transmit checksumming ”h]”j;)�”}”(hhh]”jn)�”}”(hŒTransmit checksumming ”h]”hþ)�”}”(hŒTransmit checksumming”h]”hŒTransmit checksumming”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khjöubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjóubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´Khjïubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´KhjÐh²hubhþ)�”}”(hŒNFor complete description, see comments near the top of include/linux/skbuff.h.”h]”hŒNFor complete description, see comments near the top of include/linux/skbuff.h.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K�hjÐh²hubhþ)�”}”(hŒ¸Note: NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM + NETIF_F_IPV6_CSUM. It means that device can fill TCP/UDP-like checksum anywhere in the packets whatever headers there might be.”h]”hŒ¸Note: NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM + NETIF_F_IPV6_CSUM. It means that device can fill TCP/UDP-like checksum anywhere in the packets whatever headers there might be.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KƒhjÐh²hubjc)�”}”(hŒ$* Transmit TCP segmentation offload ”h]”j;)�”}”(hhh]”jn)�”}”(hŒ"Transmit TCP segmentation offload ”h]”hþ)�”}”(hŒ!Transmit TCP segmentation offload”h]”hŒ!Transmit TCP segmentation offload”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K‡hj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj:ubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K‡hj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K‡hjÐh²hubhþ)�”}”(hŒ“NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6).”h]”hŒ“NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6).”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K‰hjÐh²hubjc)�”}”(hŒ$* Transmit UDP segmentation offload ”h]”j;)�”}”(hhh]”jn)�”}”(hŒ"Transmit UDP segmentation offload ”h]”hþ)�”}”(hŒ!Transmit UDP segmentation offload”h]”hŒ!Transmit UDP segmentation offload”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KŒhjvubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjsubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KŒhjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´KŒhjÐh²hubhþ)�”}”(hŒïNETIF_F_GSO_UDP_L4 accepts a single UDP header with a payload that exceeds gso_size. On segmentation, it segments the payload on gso_size boundaries and replicates the network and UDP headers (fixing up the last one if less than gso_size).”h]”hŒïNETIF_F_GSO_UDP_L4 accepts a single UDP header with a payload that exceeds gso_size. On segmentation, it segments the payload on gso_size boundaries and replicates the network and UDP headers (fixing up the last one if less than gso_size).”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KŽhjÐh²hubjc)�”}”(hŒ * Transmit DMA from high memory ”h]”j;)�”}”(hhh]”jn)�”}”(hŒTransmit DMA from high memory ”h]”hþ)�”}”(hŒTransmit DMA from high memory”h]”hŒTransmit DMA from high memory”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K“hj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj¬ubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K“hj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K“hjÐh²hubhþ)�”}”(hŒ{On platforms where this is relevant, NETIF_F_HIGHDMA signals that ndo_start_xmit can handle skbs with frags in high memory.”h]”hŒ{On platforms where this is relevant, NETIF_F_HIGHDMA signals that ndo_start_xmit can handle skbs with frags in high memory.”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K•hjÐh²hubjc)�”}”(hŒ* Transmit scatter-gather ”h]”j;)�”}”(hhh]”jn)�”}”(hŒTransmit scatter-gather ”h]”hþ)�”}”(hŒTransmit scatter-gather”h]”hŒTransmit scatter-gather”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K˜hjèubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjåubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K˜hjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K˜hjÐh²hubhþ)�”}”(hŒ¬Those features say that ndo_start_xmit can handle fragmented skbs: NETIF_F_SG --- paged skbs (skb_shinfo()->frags), NETIF_F_FRAGLIST --- chained skbs (skb->next/prev list).”h]”hŒ¬Those features say that ndo_start_xmit can handle fragmented skbs: NETIF_F_SG --- paged skbs (skb_shinfo()->frags), NETIF_F_FRAGLIST --- chained skbs (skb->next/prev list).”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KšhjÐh²hubjc)�”}”(hŒ* Software features ”h]”j;)�”}”(hhh]”jn)�”}”(hŒSoftware features ”h]”hþ)�”}”(hŒSoftware features”h]”hŒSoftware features”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kžhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´Kžhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´KžhjÐh²hubhþ)�”}”(hŒFeatures contained in NETIF_F_SOFT_FEATURES are features of networking stack. Driver should not change behaviour based on them.”h]”hŒFeatures contained in NETIF_F_SOFT_FEATURES are features of networking stack. Driver should not change behaviour based on them.”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K hjÐh²hubjc)�”}”(hŒ* VLAN challenged ”h]”j;)�”}”(hhh]”jn)�”}”(hŒVLAN challenged ”h]”hþ)�”}”(hŒVLAN challenged”h]”hŒVLAN challenged”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K£hjZubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjWubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K£hjSubah}”(h]”h ]”h"]”h$]”h&]”uh1jbh³hÇh´K£hjÐh²hubhþ)�”}”(hXNETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN headers. Some drivers set this because the cards can't handle the bigger MTU. [FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU VLANs. This may be not useful, though.]”h]”hXNETIF_F_VLAN_CHALLENGED should be set for devices which can’t cope with VLAN headers. Some drivers set this because the cards can’t handle the bigger MTU. [FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU VLANs. This may be not useful, though.]”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¥hjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒrx-fcs ”h]”hþ)�”}”(hŒrx-fcs”h]”hŒrx-fcs”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kªhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjŒh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KªhjÐh²hubhþ)�”}”(hŒÃThis requests that the NIC append the Ethernet Frame Checksum (FCS) to the end of the skb data. This allows sniffers and other tools to read the CRC recorded by the NIC on receipt of the packet.”h]”hŒÃThis requests that the NIC append the Ethernet Frame Checksum (FCS) to the end of the skb data. This allows sniffers and other tools to read the CRC recorded by the NIC on receipt of the packet.”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¬hjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒrx-all ”h]”hþ)�”}”(hŒrx-all”h]”hŒrx-all”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K°hj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj»h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K°hjÐh²hubhþ)�”}”(hŒôThis requests that the NIC receive all possible frames, including errored frames (such as bad FCS, etc). This can be helpful when sniffing a link with bad packets on it. Some NICs may receive more packets if also put into normal PROMISC mode.”h]”hŒôThis requests that the NIC receive all possible frames, including errored frames (such as bad FCS, etc). This can be helpful when sniffing a link with bad packets on it. Some NICs may receive more packets if also put into normal PROMISC mode.”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K²hjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒ rx-gro-hw ”h]”hþ)�”}”(hŒ rx-gro-hw”h]”hŒ rx-gro-hw”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K·hjíubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjêh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´K·hjÐh²hubhþ)�”}”(hX«This requests that the NIC enables Hardware GRO (generic receive offload). Hardware GRO is basically the exact reverse of TSO, and is generally stricter than Hardware LRO. A packet stream merged by Hardware GRO must be re-segmentable by GSO or TSO back to the exact original packet stream. Hardware GRO is dependent on RXCSUM since every packet successfully merged by hardware must also have the checksum verified by hardware.”h]”hX«This requests that the NIC enables Hardware GRO (generic receive offload). Hardware GRO is basically the exact reverse of TSO, and is generally stricter than Hardware LRO. A packet stream merged by Hardware GRO must be re-segmentable by GSO or TSO back to the exact original packet stream. Hardware GRO is dependent on RXCSUM since every packet successfully merged by hardware must also have the checksum verified by hardware.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¹hjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒhsr-tag-ins-offload ”h]”hþ)�”}”(hŒhsr-tag-ins-offload”h]”hŒhsr-tag-ins-offload”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÀhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KÀhjÐh²hubhþ)�”}”(hŒ“This should be set for devices which insert an HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) tag automatically.”h]”hŒ“This should be set for devices which insert an HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) tag automatically.”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÂhjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒhsr-tag-rm-offload ”h]”hþ)�”}”(hŒhsr-tag-rm-offload”h]”hŒhsr-tag-rm-offload”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÅhjKubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjHh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KÅhjÐh²hubhþ)�”}”(hŒ‘This should be set for devices which remove HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) tags automatically.”h]”hŒ‘This should be set for devices which remove HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) tags automatically.”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÇhjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒhsr-fwd-offload ”h]”hþ)�”}”(hŒhsr-fwd-offload”h]”hŒhsr-fwd-offload”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÊhjzubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjwh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KÊhjÐh²hubhþ)�”}”(hŒ…This should be set for devices which forward HSR (High-availability Seamless Redundancy) frames from one port to another in hardware.”h]”hŒ…This should be set for devices which forward HSR (High-availability Seamless Redundancy) frames from one port to another in hardware.”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÌhjÐh²hubj;)�”}”(hhh]”jn)�”}”(hŒhsr-dup-offload ”h]”hþ)�”}”(hŒhsr-dup-offload”h]”hŒhsr-dup-offload”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÏhj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhj¦h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KÏhjÐh²hubhþ)�”}”(hŒ«This should be set for devices which duplicate outgoing HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) frames automatically in hardware.”h]”hŒ«This should be set for devices which duplicate outgoing HSR (High-availability Seamless Redundancy) or PRP (Parallel Redundancy Protocol) frames automatically in hardware.”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÑhjÐh²hubeh}”(h]”Œpart-iv-features”ah ]”h"]”Œpart iv: features”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KzubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPart V: Related device flags”h]”hŒPart V: Related device flags”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÝh²hh³hÇh´KÖubj;)�”}”(hhh]”jn)�”}”(hŒnetdev->netmem_tx ”h]”hþ)�”}”(hŒnetdev->netmem_tx”h]”hŒnetdev->netmem_tx”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KØhjñubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjîh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j]j^uh1j:h³hÇh´KØhjÝh²hubhþ)�”}”(hŒ®This is not a netdev feature bit. Drivers support netmem TX by setting netdev->netmem_tx to one of the values in enum netmem_tx_mode. See Documentation/networking/netmem.rst.”h]”hŒ®This is not a netdev feature bit. Drivers support netmem TX by setting netdev->netmem_tx to one of the values in enum netmem_tx_mode. See Documentation/networking/netmem.rst.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÚhjÝh²hubeh}”(h]”Œpart-v-related-device-flags”ah ]”h"]”Œpart v: related device flags”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÖubeh}”(h]”Œ5netdev-features-mess-and-how-to-get-out-from-it-alive”ah ]”h"]”Œ5netdev features mess and how to get out from it alive”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jPŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j*j'j6j3j"jjÍjÊjÚj×j"juŒ nametypes”}”(j*‰j6‰j"‰j͉jÚ‰j"‰uh}”(j'hÊj3j5jj9jÊj%j×jÐjjÝuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.