SlideShare a Scribd company logo
New ifnet(9) KPI
Gleb Smirnoff
glebius@FreeBSD.org
BSDCan 2015
Ottawa
June 11, 2015
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 1 / 24
Introduction
project wiki page and code
https://wiki.freebsd.org/projects/ifnet
svn+ssh://svn.freebsd.org/base/projects/ifnet
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 2 / 24
Introduction
struct ifnet
Glue between a driver and the stack
Used to be embedded into driver softc, now softc and
ifnet has pointers to each other
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 3 / 24
Introduction
struct ifnet
Glue between a driver and the stack
Used to be embedded into driver softc, now softc and
ifnet has pointers to each other
At attach time driver and stack fill in the structure
At run time driver changes different flags
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 3 / 24
Introduction
Why changes are needed
Extension of the struct ifnet could require
recompilation of all drivers
Editing struct ifnet could require patching all drivers
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 4 / 24
opaque ifnet
The opaque ifnet
Code snippet 1: net/if.h:
typedef struct i f n e t ∗ if_t ;
Code snippet 2: net/if_var.h:
struct i f n e t {
/∗ actual s t r u c t u r e d e f i n i t i o n ∗/
};
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 5 / 24
opaque ifnet
The opaque ifnet
Easy way: substitute any access to struct ifnet fields
with a function
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 6 / 24
opaque ifnet
The opaque ifnet
Easy way: substitute any access to struct ifnet fields
with a function
Hard way: design new KPI
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 6 / 24
new KPI what’s in struct ifnet?
what’s in struct ifnet?
driver
access
instance
specific
if_flags, if_capenable, if_mtu R y
link state, baudrate RW y
counters W y
if_capabilities, if_tso* W once y/n
address lists R y
driver name, if_clone W once n
methods W once n
if_type, dlt_type, header len W once n
if_media W once * y/n
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 7 / 24
new KPI what’s in struct ifnet?
what’s else in struct ifnet?
The stuff the driver shouldn’t be interested at
Layer 2 softc: if_l2com
Address family softcs: if_afdata[AF_MAX]
Bunch of other softcs: if_lagg, if_carp, if_netmap,
etc
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 8 / 24
new KPI what’s in struct ifnet?
what’s else in struct ifnet?
The stuff the driver shouldn’t be interested at
Layer 2 softc: if_l2com
Address family softcs: if_afdata[AF_MAX]
Bunch of other softcs: if_lagg, if_carp, if_netmap,
etc
This all can be generalized!
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 8 / 24
new KPI allocation and attachment
new if_attach()
if_alloc() if_attach(if_attach_args *args)
sleeps, doesn’t fail (save name conflict)
if_attach_args is versioned
if_attach_args contains all the “W once” stuff
ifdriver pointer
softc pointer
lladdr
supported media list
capabilities, TSO limits
initial values: MTU, capenable, baudrate, etc
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 9 / 24
new KPI allocation and attachment
ifdriver, ifops
struct ifdriver is static in the driver, storing all
non-instance specific stuff
Interface methods in special structure ifops
Name, type, DLT, headerlength
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 10 / 24
new KPI allocation and attachment
ifmedia
Code snippet 3: net/if_media.h:
typedef int if_media_t ;
Drivers declare static/dynamic array of if_media_t,
pointed to from if_attach_args
Drivers declare if_media_change_t,
if_media_status_t in ifops
Implementation opaque and private to if_media.c
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 11 / 24
new KPI allocation and attachment
ifmedia + miibus
miibus(4) is completely ifnet(9) agnostic
mii_attach() allocates pointer to if_media_t array,
to be used later in if_attach_args
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 12 / 24
new KPI method changes
if_init is no longer a method, becomes static function
if_poll for polling(4)
if_start
if_transmit doesn’t m_freem() in case of error
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 13 / 24
new KPI runtime modified data
if_flags, if_capenable, if_mtu (R,
instance specific)
if_ioctl method is the only channel to modify the
values
stack does sanity checking
driver may refuse new value
if driver accepts value, it may cache it
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 14 / 24
new KPI runtime modified data
if_drv_flags
IFF_DRV_OACTIVE goes away together with
if_start and generic queue
IFF_DRV_RUNNING goes to driver softc, protected
by driver lock
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 15 / 24
new KPI runtime modified data
link state, baudrate
void if_setbaudrate ( if_t , uint64_t ) ;
void if_link_state_change ( if_t , int ) ;
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 16 / 24
new KPI runtime modified data
counters
if_inc_counter() is already in head
Driver is 100% resposible for the counters
TX counters are updated on TX completion, not on
enqueue
Use if_inc_txcounters() for TX update
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 17 / 24
new KPI runtime modified data
traversing address lists
typedef void
ifaddr_cb_t ( void ∗ , struct sockaddr ∗ ,
struct sockaddr ∗ , struct sockaddr ∗);
typedef void
ifmaddr_cb_t ( void ∗ , struct sockaddr ∗);
void if_foreach_addr ( if_t , ifaddr_cb_t ,
void ∗);
void if_foreach_maddr ( if_t , ifmaddr_cb_t ,
void ∗);
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 18 / 24
new KPI special considerations
net80211 drivers
No ifnet layer in the driver
Task is 50% done
Will be committed to head separately
https://wiki.freebsd.org/projects/ifnet/net80211
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 19 / 24
new KPI special considerations
drivers that do if_start
That’s 80-90% of all legacy drivers
if_start and struct ifqueue go away
driver opts-in for a generic queue in if_attach
stack provides: if_snd_len(), if_snd_enqueue(),
if_snd_dequeue() and if_snd_prepend()
driver’s if_transmit is a short copy&paste
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 20 / 24
new KPI special considerations
lagg(4)
now lagg(4) hijacks if_transmit of an interface
it will hijack ifops
ifops can be stacked, like VOPs
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 21 / 24
new KPI special considerations
ALTQ
now ALTQ works on top of ifqueue
it will hijack ifops
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 22 / 24
new KPI scope of work
scope of work
There are > 200 drivers to be converted
Only 16 has been converted so far
Conversion of typical 100Mbit driver takes 1 hour
Usually driver is reduced by 100 LOC
https://wiki.freebsd.org/projects/ifnet/progress
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 23 / 24
new KPI scope of work
open tasks
Better generic queueing/transmit code?
ALTQ
lagg(4)
VIMAGE
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 24 / 24
Conclusion
Your feedback & help is needed!
Reviewing
Criticizing, proposing better KPIs
Converting drivers
Testing
Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 25 / 24

More Related Content

What's hot

Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動するStargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
Kohei Tokunaga
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
Yunong Xiao
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
Tzung-Bi Shih
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance InconsistenciesTracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Shane McIntosh
 
Go 1.8 Release Party
Go 1.8 Release PartyGo 1.8 Release Party
Go 1.8 Release Party
Rodolfo Carvalho
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
Tzung-Bi Shih
 
Streams for the Web
Streams for the WebStreams for the Web
Streams for the Web
Domenic Denicola
 
Lopug docker end_of_distro
Lopug docker end_of_distroLopug docker end_of_distro
Lopug docker end_of_distro
Chris Swan
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
P4, EPBF, and Linux TC Offload
P4, EPBF, and Linux TC OffloadP4, EPBF, and Linux TC Offload
P4, EPBF, and Linux TC Offload
Open-NFP
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
Ting-Li Chou
 
p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4
Kentaro Ebisawa
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
Tommaso Visconti
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-by
Jeff Squyres
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
Douglas Chen
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
Badoo Development
 
HCQC : HPC Compiler Quality Checker
HCQC : HPC Compiler Quality CheckerHCQC : HPC Compiler Quality Checker
HCQC : HPC Compiler Quality Checker
Linaro
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftest
SeongJae Park
 

What's hot (20)

Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動するStargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
Stargz Snapshotter: イメージのpullを省略してcontainerdでコンテナを高速に起動する
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
Global Interpreter Lock: Episode III - cat < /dev/zero > GIL;
 
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance InconsistenciesTracing Software Build Processes to Uncover License Compliance Inconsistencies
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
 
Go 1.8 Release Party
Go 1.8 Release PartyGo 1.8 Release Party
Go 1.8 Release Party
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
Streams for the Web
Streams for the WebStreams for the Web
Streams for the Web
 
Lopug docker end_of_distro
Lopug docker end_of_distroLopug docker end_of_distro
Lopug docker end_of_distro
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
P4, EPBF, and Linux TC Offload
P4, EPBF, and Linux TC OffloadP4, EPBF, and Linux TC Offload
P4, EPBF, and Linux TC Offload
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
 
p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-by
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
 
Profiling and optimizing go programs
Profiling and optimizing go programsProfiling and optimizing go programs
Profiling and optimizing go programs
 
HCQC : HPC Compiler Quality Checker
HCQC : HPC Compiler Quality CheckerHCQC : HPC Compiler Quality Checker
HCQC : HPC Compiler Quality Checker
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftest
 

Similar to new ifnet(9) KPI for FreeBSD network stack

Flink Apachecon Presentation
Flink Apachecon PresentationFlink Apachecon Presentation
Flink Apachecon Presentation
Gyula Fóra
 
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
Morten Wittrock
 
Modern Web Applications with Sightly
Modern Web Applications with SightlyModern Web Applications with Sightly
Modern Web Applications with Sightly
Radu Cotescu
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Alexandre Gouaillard
 
Getting Started with Apache Geode
Getting Started with Apache GeodeGetting Started with Apache Geode
Getting Started with Apache Geode
John Blum
 
Automate Your Integration Governance with Open Source Software
Automate Your Integration Governance with Open Source SoftwareAutomate Your Integration Governance with Open Source Software
Automate Your Integration Governance with Open Source Software
Morten Wittrock
 
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
Anil Sharma
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
Walter Liu
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in Depth
OPNFV
 
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
mohammedabomashowrms
 
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
Stephen Thair
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group Replication
Shivji Kumar Jha
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
Kelly Robinson
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
VMware Tanzu
 
Building an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable ScaleBuilding an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable Scale
Merelda
 
TechEvent OpenShift for Developers
TechEvent OpenShift for DevelopersTechEvent OpenShift for Developers
TechEvent OpenShift for Developers
Trivadis
 
Marcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL WorkbenchMarcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL Workbench
Women in Technology Poland
 
DevOps by examples - Azure Meetup Frankfurt 06-2017
DevOps by examples - Azure Meetup Frankfurt 06-2017DevOps by examples - Azure Meetup Frankfurt 06-2017
DevOps by examples - Azure Meetup Frankfurt 06-2017
Giulio Vian
 
Spring Boot with Kotlin, Kofu and Coroutines
 Spring Boot with Kotlin, Kofu and Coroutines Spring Boot with Kotlin, Kofu and Coroutines
Spring Boot with Kotlin, Kofu and Coroutines
VMware Tanzu
 
Kube cfg-mgmt
Kube cfg-mgmtKube cfg-mgmt
Kube cfg-mgmt
Lee Briggs
 

Similar to new ifnet(9) KPI for FreeBSD network stack (20)

Flink Apachecon Presentation
Flink Apachecon PresentationFlink Apachecon Presentation
Flink Apachecon Presentation
 
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
Automate your Cloud Integration governance with CPILint @ SIT Netherlands 2022
 
Modern Web Applications with Sightly
Modern Web Applications with SightlyModern Web Applications with Sightly
Modern Web Applications with Sightly
 
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlantaPlugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
Plugin for other browsers - webRTC Conference and Expo June 2014 @ atlanta
 
Getting Started with Apache Geode
Getting Started with Apache GeodeGetting Started with Apache Geode
Getting Started with Apache Geode
 
Automate Your Integration Governance with Open Source Software
Automate Your Integration Governance with Open Source SoftwareAutomate Your Integration Governance with Open Source Software
Automate Your Integration Governance with Open Source Software
 
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
tutorials-visual-studio_visual-studio-2015-preview-comes-with-emulator-for-an...
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in Depth
 
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
Lecture 9.pdfLecture 9.pdfLecture 9.pdfLecture 9.pdf
 
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
7 lessons from velocity 2011 (Meetup feedback session for London Web Performa...
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group Replication
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
 
Building an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable ScaleBuilding an MLOps Stack for Companies at Reasonable Scale
Building an MLOps Stack for Companies at Reasonable Scale
 
TechEvent OpenShift for Developers
TechEvent OpenShift for DevelopersTechEvent OpenShift for Developers
TechEvent OpenShift for Developers
 
Marcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL WorkbenchMarcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL Workbench
 
DevOps by examples - Azure Meetup Frankfurt 06-2017
DevOps by examples - Azure Meetup Frankfurt 06-2017DevOps by examples - Azure Meetup Frankfurt 06-2017
DevOps by examples - Azure Meetup Frankfurt 06-2017
 
Spring Boot with Kotlin, Kofu and Coroutines
 Spring Boot with Kotlin, Kofu and Coroutines Spring Boot with Kotlin, Kofu and Coroutines
Spring Boot with Kotlin, Kofu and Coroutines
 
Kube cfg-mgmt
Kube cfg-mgmtKube cfg-mgmt
Kube cfg-mgmt
 

Recently uploaded

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 

Recently uploaded (20)

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 

new ifnet(9) KPI for FreeBSD network stack

  • 1. New ifnet(9) KPI Gleb Smirnoff glebius@FreeBSD.org BSDCan 2015 Ottawa June 11, 2015 Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 1 / 24
  • 2. Introduction project wiki page and code https://wiki.freebsd.org/projects/ifnet svn+ssh://svn.freebsd.org/base/projects/ifnet Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 2 / 24
  • 3. Introduction struct ifnet Glue between a driver and the stack Used to be embedded into driver softc, now softc and ifnet has pointers to each other Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 3 / 24
  • 4. Introduction struct ifnet Glue between a driver and the stack Used to be embedded into driver softc, now softc and ifnet has pointers to each other At attach time driver and stack fill in the structure At run time driver changes different flags Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 3 / 24
  • 5. Introduction Why changes are needed Extension of the struct ifnet could require recompilation of all drivers Editing struct ifnet could require patching all drivers Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 4 / 24
  • 6. opaque ifnet The opaque ifnet Code snippet 1: net/if.h: typedef struct i f n e t ∗ if_t ; Code snippet 2: net/if_var.h: struct i f n e t { /∗ actual s t r u c t u r e d e f i n i t i o n ∗/ }; Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 5 / 24
  • 7. opaque ifnet The opaque ifnet Easy way: substitute any access to struct ifnet fields with a function Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 6 / 24
  • 8. opaque ifnet The opaque ifnet Easy way: substitute any access to struct ifnet fields with a function Hard way: design new KPI Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 6 / 24
  • 9. new KPI what’s in struct ifnet? what’s in struct ifnet? driver access instance specific if_flags, if_capenable, if_mtu R y link state, baudrate RW y counters W y if_capabilities, if_tso* W once y/n address lists R y driver name, if_clone W once n methods W once n if_type, dlt_type, header len W once n if_media W once * y/n Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 7 / 24
  • 10. new KPI what’s in struct ifnet? what’s else in struct ifnet? The stuff the driver shouldn’t be interested at Layer 2 softc: if_l2com Address family softcs: if_afdata[AF_MAX] Bunch of other softcs: if_lagg, if_carp, if_netmap, etc Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 8 / 24
  • 11. new KPI what’s in struct ifnet? what’s else in struct ifnet? The stuff the driver shouldn’t be interested at Layer 2 softc: if_l2com Address family softcs: if_afdata[AF_MAX] Bunch of other softcs: if_lagg, if_carp, if_netmap, etc This all can be generalized! Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 8 / 24
  • 12. new KPI allocation and attachment new if_attach() if_alloc() if_attach(if_attach_args *args) sleeps, doesn’t fail (save name conflict) if_attach_args is versioned if_attach_args contains all the “W once” stuff ifdriver pointer softc pointer lladdr supported media list capabilities, TSO limits initial values: MTU, capenable, baudrate, etc Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 9 / 24
  • 13. new KPI allocation and attachment ifdriver, ifops struct ifdriver is static in the driver, storing all non-instance specific stuff Interface methods in special structure ifops Name, type, DLT, headerlength Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 10 / 24
  • 14. new KPI allocation and attachment ifmedia Code snippet 3: net/if_media.h: typedef int if_media_t ; Drivers declare static/dynamic array of if_media_t, pointed to from if_attach_args Drivers declare if_media_change_t, if_media_status_t in ifops Implementation opaque and private to if_media.c Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 11 / 24
  • 15. new KPI allocation and attachment ifmedia + miibus miibus(4) is completely ifnet(9) agnostic mii_attach() allocates pointer to if_media_t array, to be used later in if_attach_args Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 12 / 24
  • 16. new KPI method changes if_init is no longer a method, becomes static function if_poll for polling(4) if_start if_transmit doesn’t m_freem() in case of error Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 13 / 24
  • 17. new KPI runtime modified data if_flags, if_capenable, if_mtu (R, instance specific) if_ioctl method is the only channel to modify the values stack does sanity checking driver may refuse new value if driver accepts value, it may cache it Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 14 / 24
  • 18. new KPI runtime modified data if_drv_flags IFF_DRV_OACTIVE goes away together with if_start and generic queue IFF_DRV_RUNNING goes to driver softc, protected by driver lock Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 15 / 24
  • 19. new KPI runtime modified data link state, baudrate void if_setbaudrate ( if_t , uint64_t ) ; void if_link_state_change ( if_t , int ) ; Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 16 / 24
  • 20. new KPI runtime modified data counters if_inc_counter() is already in head Driver is 100% resposible for the counters TX counters are updated on TX completion, not on enqueue Use if_inc_txcounters() for TX update Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 17 / 24
  • 21. new KPI runtime modified data traversing address lists typedef void ifaddr_cb_t ( void ∗ , struct sockaddr ∗ , struct sockaddr ∗ , struct sockaddr ∗); typedef void ifmaddr_cb_t ( void ∗ , struct sockaddr ∗); void if_foreach_addr ( if_t , ifaddr_cb_t , void ∗); void if_foreach_maddr ( if_t , ifmaddr_cb_t , void ∗); Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 18 / 24
  • 22. new KPI special considerations net80211 drivers No ifnet layer in the driver Task is 50% done Will be committed to head separately https://wiki.freebsd.org/projects/ifnet/net80211 Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 19 / 24
  • 23. new KPI special considerations drivers that do if_start That’s 80-90% of all legacy drivers if_start and struct ifqueue go away driver opts-in for a generic queue in if_attach stack provides: if_snd_len(), if_snd_enqueue(), if_snd_dequeue() and if_snd_prepend() driver’s if_transmit is a short copy&paste Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 20 / 24
  • 24. new KPI special considerations lagg(4) now lagg(4) hijacks if_transmit of an interface it will hijack ifops ifops can be stacked, like VOPs Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 21 / 24
  • 25. new KPI special considerations ALTQ now ALTQ works on top of ifqueue it will hijack ifops Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 22 / 24
  • 26. new KPI scope of work scope of work There are > 200 drivers to be converted Only 16 has been converted so far Conversion of typical 100Mbit driver takes 1 hour Usually driver is reduced by 100 LOC https://wiki.freebsd.org/projects/ifnet/progress Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 23 / 24
  • 27. new KPI scope of work open tasks Better generic queueing/transmit code? ALTQ lagg(4) VIMAGE Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 24 / 24
  • 28. Conclusion Your feedback & help is needed! Reviewing Criticizing, proposing better KPIs Converting drivers Testing Gleb Smirnoff glebius@FreeBSD.org New ifnet(9) KPI June 11, 2015 25 / 24