€••:Œ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/bpf/bpf_licensing”Œ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/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/bpf/bpf_licensing”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/bpf/bpf_licensing”Œ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/bpf/bpf_licensing”Œ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Œ BPF licensing”h]”hŒ BPF licensing”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ?/var/lib/git/docbuild/linux/Documentation/bpf/bpf_licensing.rst”h Kubh¢)”}”(hhh]”(h§)”}”(hŒ Background”h]”hŒ Background”…””}”(hhºhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh·hžhhŸh¶h KubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒClassic BPF was BSD licensed ”h]”hŒ paragraph”“”)”}”(hŒClassic BPF was BSD licensed”h]”hŒClassic BPF was BSD licensed”…””}”(hhÕhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KhhÏubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊhžhhŸh¶h Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1hÈhŸh¶h Khh·hžhubhÔ)”}”(hŒý"BPF" was originally introduced as BSD Packet Filter in http://www.tcpdump.org/papers/bpf-usenix93.pdf. The corresponding instruction set and its implementation came from BSD with BSD license. That original instruction set is now known as "classic BPF".”h]”(hŒ<“BPF†was originally introduced as BSD Packet Filter in ”…””}”(hhñhžhhŸNh NubhŒ reference”“”)”}”(hŒ.http://www.tcpdump.org/papers/bpf-usenix93.pdf”h]”hŒ.http://www.tcpdump.org/papers/bpf-usenix93.pdf”…””}”(hhûhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”hýuh1hùhhñubhŒ›. The corresponding instruction set and its implementation came from BSD with BSD license. That original instruction set is now known as “classic BPFâ€.”…””}”(hhñhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K hh·hžhubhÔ)”}”(hXHowever an instruction set is a specification for machine-language interaction, similar to a programming language. It is not a code. Therefore, the application of a BSD license may be misleading in a certain context, as the instruction set may enjoy no copyright protection.”h]”hXHowever an instruction set is a specification for machine-language interaction, similar to a programming language. It is not a code. Therefore, the application of a BSD license may be misleading in a certain context, as the instruction set may enjoy no copyright protection.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h Khh·hžhubhÉ)”}”(hhh]”hÎ)”}”(hŒ8eBPF (extended BPF) instruction set continues to be BSD ”h]”hÔ)”}”(hŒ7eBPF (extended BPF) instruction set continues to be BSD”h]”hŒ7eBPF (extended BPF) instruction set continues to be BSD”…””}”(hj)hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h Khj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj"hžhhŸh¶h Nubah}”(h]”h ]”h"]”h$]”h&]”hïhðuh1hÈhŸh¶h Khh·hžhubhÔ)”}”(hŒÅIn 2014, the classic BPF instruction set was significantly extended. We typically refer to this instruction set as eBPF to disambiguate it from cBPF. The eBPF instruction set is still BSD licensed.”h]”hŒÅIn 2014, the classic BPF instruction set was significantly extended. We typically refer to this instruction set as eBPF to disambiguate it from cBPF. The eBPF instruction set is still BSD licensed.”…””}”(hjChžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h Khh·hžhubeh}”(h]”Œ background”ah ]”h"]”Œ background”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒImplementations of eBPF”h]”hŒImplementations of eBPF”…””}”(hj\hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjYhžhhŸh¶h KubhÔ)”}”(hŒ^Using the eBPF instruction set requires implementing code in both kernel space and user space.”h]”hŒ^Using the eBPF instruction set requires implementing code in both kernel space and user space.”…””}”(hjjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KhjYhžhubh¢)”}”(hhh]”(h§)”}”(hŒIn Linux Kernel”h]”hŒIn Linux Kernel”…””}”(hj{hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjxhžhhŸh¶h K!ubhÔ)”}”(hX The reference implementations of the eBPF interpreter and various just-in-time compilers are part of Linux and are GPLv2 licensed. The implementation of eBPF helper functions is also GPLv2 licensed. Interpreters, JITs, helpers, and verifiers are called eBPF runtime.”h]”hX The reference implementations of the eBPF interpreter and various just-in-time compilers are part of Linux and are GPLv2 licensed. The implementation of eBPF helper functions is also GPLv2 licensed. Interpreters, JITs, helpers, and verifiers are called eBPF runtime.”…””}”(hj‰hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K#hjxhžhubeh}”(h]”Œin-linux-kernel”ah ]”h"]”Œin linux kernel”ah$]”h&]”uh1h¡hjYhžhhŸh¶h K!ubh¢)”}”(hhh]”(h§)”}”(hŒ In User Space”h]”hŒ In User Space”…””}”(hj¢hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjŸhžhhŸh¶h K)ubhÔ)”}”(hŒíThere are also implementations of eBPF runtime (interpreter, JITs, helper functions) under Apache2 (https://github.com/iovisor/ubpf), MIT (https://github.com/qmonnet/rbpf), and BSD (https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf).”h]”(hŒdThere are also implementations of eBPF runtime (interpreter, JITs, helper functions) under Apache2 (”…””}”(hj°hžhhŸNh Nubhú)”}”(hŒhttps://github.com/iovisor/ubpf”h]”hŒhttps://github.com/iovisor/ubpf”…””}”(hj¸hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jºuh1hùhj°ubhŒ), MIT (”…””}”(hj°hžhhŸNh Nubhú)”}”(hŒhttps://github.com/qmonnet/rbpf”h]”hŒhttps://github.com/qmonnet/rbpf”…””}”(hjËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÍuh1hùhj°ubhŒ ), and BSD (”…””}”(hj°hžhhŸNh Nubhú)”}”(hŒ5https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf”h]”hŒ5https://github.com/DPDK/dpdk/blob/main/lib/librte_bpf”…””}”(hjÞhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jàuh1hùhj°ubhŒ).”…””}”(hj°hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K+hjŸhžhubeh}”(h]”Œ in-user-space”ah ]”h"]”Œ in user space”ah$]”h&]”uh1h¡hjYhžhhŸh¶h K)ubh¢)”}”(hhh]”(h§)”}”(hŒIn HW”h]”hŒIn HW”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÿhžhhŸh¶h K2ubhÔ)”}”(hŒ™The HW can choose to execute eBPF instruction natively and provide eBPF runtime in HW or via the use of implementing firmware with a proprietary license.”h]”hŒ™The HW can choose to execute eBPF instruction natively and provide eBPF runtime in HW or via the use of implementing firmware with a proprietary license.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K4hjÿhžhubeh}”(h]”Œin-hw”ah ]”h"]”Œin hw”ah$]”h&]”uh1h¡hjYhžhhŸh¶h K2ubh¢)”}”(hhh]”(h§)”}”(hŒIn other operating systems”h]”hŒIn other operating systems”…””}”(hj)hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj&hžhhŸh¶h K8ubhÔ)”}”(hŒnOther kernels or user space implementations of eBPF instruction set and runtime can have proprietary licenses.”h]”hŒnOther kernels or user space implementations of eBPF instruction set and runtime can have proprietary licenses.”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K:hj&hžhubeh}”(h]”Œin-other-operating-systems”ah ]”h"]”Œin other operating systems”ah$]”h&]”uh1h¡hjYhžhhŸh¶h K8ubeh}”(h]”Œimplementations-of-ebpf”ah ]”h"]”Œimplementations of ebpf”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ&Using BPF programs in the Linux kernel”h]”hŒ&Using BPF programs in the Linux kernel”…””}”(hjXhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjUhžhhŸh¶h K>ubhÔ)”}”(hŒˆLinux Kernel (while being GPLv2) allows linking of proprietary kernel modules under these rules: Documentation/process/license-rules.rst”h]”hŒˆLinux Kernel (while being GPLv2) allows linking of proprietary kernel modules under these rules: Documentation/process/license-rules.rst”…””}”(hjfhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h K@hjUhžhubhÔ)”}”(hŒËWhen a kernel module is loaded, the linux kernel checks which functions it intends to use. If any function is marked as "GPL only," the corresponding module or program has to have GPL compatible license.”h]”hŒÏWhen a kernel module is loaded, the linux kernel checks which functions it intends to use. If any function is marked as “GPL only,†the corresponding module or program has to have GPL compatible license.”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KDhjUhžhubhÔ)”}”(hX;Loading BPF program into the Linux kernel is similar to loading a kernel module. BPF is loaded at run time and not statically linked to the Linux kernel. BPF program loading follows the same license checking rules as kernel modules. BPF programs can be proprietary if they don't use "GPL only" BPF helper functions.”h]”hXALoading BPF program into the Linux kernel is similar to loading a kernel module. BPF is loaded at run time and not statically linked to the Linux kernel. BPF program loading follows the same license checking rules as kernel modules. BPF programs can be proprietary if they don’t use “GPL only†BPF helper functions.”…””}”(hj‚hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KHhjUhžhubhÔ)”}”(hX9Further, some BPF program types - Linux Security Modules (LSM) and TCP Congestion Control (struct_ops), as of Aug 2021 - are required to be GPL compatible even if they don't use "GPL only" helper functions directly. The registration step of LSM and TCP congestion control modules of the Linux kernel is done through EXPORT_SYMBOL_GPL kernel functions. In that sense LSM and struct_ops BPF programs are implicitly calling "GPL only" functions. The same restriction applies to BPF programs that call kernel functions directly via unstable interface also known as "kfunc".”h]”hXGFurther, some BPF program types - Linux Security Modules (LSM) and TCP Congestion Control (struct_ops), as of Aug 2021 - are required to be GPL compatible even if they don’t use “GPL only†helper functions directly. The registration step of LSM and TCP congestion control modules of the Linux kernel is done through EXPORT_SYMBOL_GPL kernel functions. In that sense LSM and struct_ops BPF programs are implicitly calling “GPL only†functions. The same restriction applies to BPF programs that call kernel functions directly via unstable interface also known as “kfuncâ€.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KNhjUhžhubeh}”(h]”Œ&using-bpf-programs-in-the-linux-kernel”ah ]”h"]”Œ&using bpf programs in the linux kernel”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K>ubh¢)”}”(hhh]”(h§)”}”(hŒ3Packaging BPF programs with user space applications”h]”hŒ3Packaging BPF programs with user space applications”…””}”(hj©hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj¦hžhhŸh¶h KXubhÔ)”}”(hŒåGenerally, proprietary-licensed applications and GPL licensed BPF programs written for the Linux kernel in the same package can co-exist because they are separate executable processes. This applies to both cBPF and eBPF programs.”h]”hŒåGenerally, proprietary-licensed applications and GPL licensed BPF programs written for the Linux kernel in the same package can co-exist because they are separate executable processes. This applies to both cBPF and eBPF programs.”…””}”(hj·hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhŸh¶h KZhj¦hžhubeh}”(h]”Œ3packaging-bpf-programs-with-user-space-applications”ah ]”h"]”Œ3packaging bpf programs with user space applications”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KXubeh}”(h]”Œ bpf-licensing”ah ]”h"]”Œ bpf licensing”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”jøŒ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ÏjVjSjRjOjœj™jüjùj#j jJjGj£j jÊjÇuŒ nametypes”}”(jÒ‰jV‰jR‰jœ‰jü‰j#‰jJ‰j£‰jʉuh}”(jÏh£jSh·jOjYj™jxjùjŸj jÿjGj&j jUjÇ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.