€•°<Œ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/devlink/index”Œ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/devlink/index”Œ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/devlink/index”Œ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/devlink/index”Œ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/devlink/index”Œ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/devlink/index”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒLinux Devlink Documentation”h]”hŒLinux Devlink Documentation”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒF/var/lib/git/docbuild/linux/Documentation/networking/devlink/index.rst”h KubhŒ paragraph”“”)”}”(hŒ˜devlink is an API to expose device information and resources not directly related to any device class, such as chip-wide/switch-ASIC-wide configuration.”h]”hŒ˜devlink is an API to expose device information and resources not directly related to any device class, such as chip-wide/switch-ASIC-wide configuration.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒLocking”h]”hŒLocking”…””}”(hhÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhÇhžhhŸh¶h Kubh¸)”}”(hX Driver facing APIs are currently transitioning to allow more explicit locking. Drivers can use the existing ``devlink_*`` set of APIs, or new APIs prefixed by ``devl_*``. The older APIs handle all the locking in devlink core, but don't allow registration of most sub-objects once the main devlink object is itself registered. The newer ``devl_*`` APIs assume the devlink instance lock is already held. Drivers can take the instance lock by calling ``devl_lock()``. It is also held all callbacks of devlink netlink commands.”h]”(hŒlDriver facing APIs are currently transitioning to allow more explicit locking. Drivers can use the existing ”…””}”(hhØhžhhŸNh NubhŒliteral”“”)”}”(hŒ ``devlink_*``”h]”hŒ devlink_*”…””}”(hhâhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhhØubhŒ& set of APIs, or new APIs prefixed by ”…””}”(hhØhžhhŸNh Nubhá)”}”(hŒ ``devl_*``”h]”hŒdevl_*”…””}”(hhôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhhØubhŒ©. The older APIs handle all the locking in devlink core, but don’t allow registration of most sub-objects once the main devlink object is itself registered. The newer ”…””}”(hhØhžhhŸNh Nubhá)”}”(hŒ ``devl_*``”h]”hŒdevl_*”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhhØubhŒf APIs assume the devlink instance lock is already held. Drivers can take the instance lock by calling ”…””}”(hhØhžhhŸNh Nubhá)”}”(hŒ``devl_lock()``”h]”hŒ devl_lock()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhhØubhŒ<. It is also held all callbacks of devlink netlink commands.”…””}”(hhØhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhÇhžhubh¸)”}”(hŒLDrivers are encouraged to use the devlink instance lock for their own needs.”h]”hŒLDrivers are encouraged to use the devlink instance lock for their own needs.”…””}”(hj0hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhÇhžhubh¸)”}”(hŒ½Drivers need to be cautious when taking devlink instance lock and taking RTNL lock at the same time. Devlink instance lock needs to be taken first, only after that RTNL lock could be taken.”h]”hŒ½Drivers need to be cautious when taking devlink instance lock and taking RTNL lock at the same time. Devlink instance lock needs to be taken first, only after that RTNL lock could be taken.”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhÇhžhubeh}”(h]”Œlocking”ah ]”h"]”Œlocking”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒNested instances”h]”hŒNested instances”…””}”(hjWhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjThžhhŸh¶h Kubh¸)”}”(hŒ«Some objects, like linecards or port functions, could have another devlink instances created underneath. In that case, drivers should make sure to respect following rules:”h]”hŒ«Some objects, like linecards or port functions, could have another devlink instances created underneath. In that case, drivers should make sure to respect following rules:”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhjThžhubhŒ block_quote”“”)”}”(hX¸- Lock ordering should be maintained. If driver needs to take instance lock of both nested and parent instances at the same time, devlink instance lock of the parent instance should be taken first, only then instance lock of the nested instance could be taken. - Driver should use object-specific helpers to setup the nested relationship: - ``devl_nested_devlink_set()`` - called to setup devlink -> nested devlink relationship (could be user for multiple nested instances. - ``devl_port_fn_devlink_set()`` - called to setup port function -> nested devlink relationship. - ``devlink_linecard_nested_dl_set()`` - called to setup linecard -> nested devlink relationship. ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hXLock ordering should be maintained. If driver needs to take instance lock of both nested and parent instances at the same time, devlink instance lock of the parent instance should be taken first, only then instance lock of the nested instance could be taken.”h]”h¸)”}”(hXLock ordering should be maintained. If driver needs to take instance lock of both nested and parent instances at the same time, devlink instance lock of the parent instance should be taken first, only then instance lock of the nested instance could be taken.”h]”hXLock ordering should be maintained. If driver needs to take instance lock of both nested and parent instances at the same time, devlink instance lock of the parent instance should be taken first, only then instance lock of the nested instance could be taken.”…””}”(hj„hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{ubj)”}”(hXDriver should use object-specific helpers to setup the nested relationship: - ``devl_nested_devlink_set()`` - called to setup devlink -> nested devlink relationship (could be user for multiple nested instances. - ``devl_port_fn_devlink_set()`` - called to setup port function -> nested devlink relationship. - ``devlink_linecard_nested_dl_set()`` - called to setup linecard -> nested devlink relationship. ”h]”(h¸)”}”(hŒKDriver should use object-specific helpers to setup the nested relationship:”h]”hŒKDriver should use object-specific helpers to setup the nested relationship:”…””}”(hjœhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K$hj˜ubjz)”}”(hhh]”(j)”}”(hŒ„``devl_nested_devlink_set()`` - called to setup devlink -> nested devlink relationship (could be user for multiple nested instances.”h]”h¸)”}”(hŒ„``devl_nested_devlink_set()`` - called to setup devlink -> nested devlink relationship (could be user for multiple nested instances.”h]”(há)”}”(hŒ``devl_nested_devlink_set()``”h]”hŒdevl_nested_devlink_set()”…””}”(hjµhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhj±ubhŒg - called to setup devlink -> nested devlink relationship (could be user for multiple nested instances.”…””}”(hj±hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K'hj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1j~hjªubj)”}”(hŒ^``devl_port_fn_devlink_set()`` - called to setup port function -> nested devlink relationship.”h]”h¸)”}”(hŒ^``devl_port_fn_devlink_set()`` - called to setup port function -> nested devlink relationship.”h]”(há)”}”(hŒ``devl_port_fn_devlink_set()``”h]”hŒdevl_port_fn_devlink_set()”…””}”(hjÛhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhj×ubhŒ@ - called to setup port function -> nested devlink relationship.”…””}”(hj×hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K)hjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1j~hjªubj)”}”(hŒ```devlink_linecard_nested_dl_set()`` - called to setup linecard -> nested devlink relationship. ”h]”h¸)”}”(hŒ_``devlink_linecard_nested_dl_set()`` - called to setup linecard -> nested devlink relationship.”h]”(há)”}”(hŒ$``devlink_linecard_nested_dl_set()``”h]”hŒ devlink_linecard_nested_dl_set()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhjýubhŒ; - called to setup linecard -> nested devlink relationship.”…””}”(hjýhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K+hjùubah}”(h]”h ]”h"]”h$]”h&]”uh1j~hjªubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jyhŸh¶h K'hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{ubeh}”(h]”h ]”h"]”h$]”h&]”j%j&uh1jyhŸh¶h K hjuubah}”(h]”h ]”h"]”h$]”h&]”uh1jshŸh¶h K hjThžhubh¸)”}”(hŒgThe nested devlink info is exposed to the userspace over object-specific attributes of devlink netlink.”h]”hŒgThe nested devlink info is exposed to the userspace over object-specific attributes of devlink netlink.”…””}”(hj9hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K.hjThžhubeh}”(h]”Œnested-instances”ah ]”h"]”Œnested instances”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒInterface documentation”h]”hŒInterface documentation”…””}”(hjRhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjOhžhhŸh¶h K2ubh¸)”}”(hŒUThe following pages describe various interfaces available through devlink in general.”h]”hŒUThe following pages describe various interfaces available through devlink in general.”…””}”(hj`hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K4hjOhžhubhŒcompound”“”)”}”(hhh]”hŒtoctree”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”hŒnetworking/devlink/index”Œentries”]”(NŒ networking/devlink/devlink-dpipe”†”NŒ!networking/devlink/devlink-health”†”NŒnetworking/devlink/devlink-info”†”NŒ networking/devlink/devlink-flash”†”NŒ!networking/devlink/devlink-params”†”NŒnetworking/devlink/devlink-port”†”NŒ!networking/devlink/devlink-region”†”NŒ#networking/devlink/devlink-resource”†”NŒ!networking/devlink/devlink-reload”†”NŒ$networking/devlink/devlink-selftests”†”NŒnetworking/devlink/devlink-trap”†”NŒ#networking/devlink/devlink-linecard”†”NŒ'networking/devlink/devlink-eswitch-attr”†”eŒ includefiles”]”(jjƒj…j‡j‰j‹jjj‘j“j•j—j™eŒmaxdepth”KŒcaption”NŒglob”‰Œhidden”‰Œ includehidden”‰Œnumbered”KŒ titlesonly”‰Œ rawentries”]”uh1jshŸh¶h K7hjpubah}”(h]”h ]”Œtoctree-wrapper”ah"]”h$]”h&]”uh1jnhjOhžhhŸh¶h Nubeh}”(h]”Œinterface-documentation”ah ]”h"]”Œinterface documentation”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K2ubh¢)”}”(hhh]”(h§)”}”(hŒDriver-specific documentation”h]”hŒDriver-specific documentation”…””}”(hj¸hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjµhžhhŸh¶h KIubh¸)”}”(hŒEach driver that implements ``devlink`` is expected to document what parameters, info versions, and other features it supports.”h]”(hŒEach driver that implements ”…””}”(hjÆhžhhŸNh Nubhá)”}”(hŒ ``devlink``”h]”hŒdevlink”…””}”(hjÎhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhjÆubhŒX is expected to document what parameters, info versions, and other features it supports.”…””}”(hjÆhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KKhjµhžhubjo)”}”(hhh]”jt)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”hj~j]”(NŒnetworking/devlink/bnxt”†”NŒnetworking/devlink/etas_es58x”†”NŒnetworking/devlink/hns3”†”NŒnetworking/devlink/i40e”†”NŒnetworking/devlink/ionic”†”NŒnetworking/devlink/ice”†”NŒnetworking/devlink/mlx4”†”NŒnetworking/devlink/mlx5”†”NŒnetworking/devlink/mlxsw”†”NŒnetworking/devlink/mv88e6xxx”†”NŒnetworking/devlink/netdevsim”†”NŒnetworking/devlink/nfp”†”NŒnetworking/devlink/qed”†”NŒ!networking/devlink/ti-cpsw-switch”†”NŒ(networking/devlink/am65-nuss-cpsw-switch”†”NŒnetworking/devlink/prestera”†”NŒnetworking/devlink/iosm”†”NŒnetworking/devlink/octeontx2”†”NŒnetworking/devlink/sfc”†”ej›]”(jójõj÷jùjûjýjÿjjjjj j j jjjjjejKjžNjŸ‰j ‰j¡‰j¢Kj£‰j¤]”uh1jshŸh¶h KNhjæubah}”(h]”h ]”j©ah"]”h$]”h&]”uh1jnhjµhžhhŸh¶h Nubeh}”(h]”Œdriver-specific-documentation”ah ]”h"]”Œdriver-specific documentation”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KIubeh}”(h]”Œlinux-devlink-documentation”ah ]”h"]”Œlinux devlink documentation”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”jTŒ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+jQjNjLjIj²j¯j&j#uŒ nametypes”}”(j.‰jQ‰jL‰j²‰j&‰uh}”(j+h£jNhÇjIjTj¯jOj#jµ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.