SlideShare a Scribd company logo
Linux Kernel Networking Stack
진입 장벽 허물기
강주희
claudiajkang@gmail.com
Speaker
강주희 (Juhee Kang, claudiajkang@gmail.com)
- 오픈 소스 파트 프런티어 개발자
- 프로젝트: Linux Kernel Networking Stack, Kubernetes i18n
- 주력 분야 : 클라우드, 네트워크, 백엔드
- 강연 활동 : 연세대, 숭실대 등 5개 대학 Git/GitHub 교육 진행
2
Linux Kernel
Networking Stack
1
Kernel 기여하기
3
목차
3
Kernel 생태계
2
한번쯤은?
4
리눅스 커널 개발을 해볼까?
5
Linux Kernel 컨트리뷰션?
어떻게 시작하지?
다른 오픈소스처럼 컨트리뷰션 하면 될까?
6
리눅스 커널도 오픈소스이니까 다른 오픈 소스처럼 github에서 하겠지?
오픈소스 원본 저장소
7
github으로 관리되는 오픈소스에 컨트리뷰션을 한다면?
오픈소스 원본 저장소 <나의 github id>/fork된 저장소
8
github으로 관리되는 오픈소스에 컨트리뷰션을 한다면?
fork
Issue 생성 브랜치 생성 커밋
PR
(PullRequest)
최신 remote
repo 내용
업데이트(pull)
merge
오픈소스 원본 저장소 <나의 github id>/fork된 저장소
review
9
github으로 관리되는 오픈소스에 컨트리뷰션을 한다면?
fork clone
타 오픈소스처럼 github에서 컨트리뷰션 하면 될까?
10
Github 내 kernel 소스코드 관리하는 repository로 이동
타 오픈소스처럼 github에서 컨트리뷰션 하면 될까?
11
Pull Request 존재 확인
타 오픈소스처럼 github에서 컨트리뷰션 하면 될까?
12
KernelPRBot 댓글 확인
타 오픈소스처럼 컨트리뷰션 하면 될까?
13
Github 은 read-only mirror
타 오픈소스처럼 컨트리뷰션 하면 될까?
14
KernelPRBot이 안내하는 Contribution 방법
Linux Kernel 컨트리뷰션?
15
- Linux Kernel
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
Linux Kernel은 GitHub을 사용하지 않는
오픈 소스 프로젝트
로컬 브랜치
생성
커밋 Patch 생성
Patch
메일 전송
최신 remote
repo 내용
업데이트(pull)
merge
linux.git
review
16
Linux Kernel 컨트리뷰션 과정?
clone
로컬 브랜치
생성
커밋 Patch 생성
Patch
메일 전송
최신 remote
repo 내용
업데이트(pull)
merge
linux.git
review
17
Linux Kernel 컨트리뷰션 과정?
clone
18
Linux Kernel 컨트리뷰션?
소스 코드 다운 경로?
빌드 환경 구성?
패치란 무엇인가?
메일로 커밋한다고?
시작하기도 전에 마주한 무수히 많은 장벽들...
19
이번 세션의 목표
리눅스 커널 컨트리뷰션을 위한 장벽을 허물어 봅시다.
1
Linux Kernel
Networking Stack
20
21
Packet Path
22
Packet
📦
Ethernet
Frame
Preamble
Ethernet Frame
Inter
Frame Gap
MAC.
Destination
MAC.
Source
Type PAYLOAD
(IP/IPv6/ARP…)
CRC
8 Bytes 6 Bytes 6 Bytes
2
Bytes 46-1500 Bytes 4 Bytes 12 Bytes
8 64 12
Linux Kernel Networking Stack
23
NIC
Network
Hardware
Packet
📦
Ethernet
Frame
Linux Kernel Networking Stack
24
Kernel
Linux Kernel
Network Stack
Packet
📦
Ethernet
Frame
NIC
Network
Hardware
Linux Kernel Networking Stack
25
Kernel
Linux Kernel
Network Stack
Packet
📦
Ethernet
Frame
NIC
Network
Hardware
Userspace Program
Userspace Software
Linux Kernel Networking Stack
26
Kernel
Linux Kernel
Network Stack
Packet
📦
Ethernet
Frame
NIC
Network
Hardware
Userspace Program
Userspace Software
Linux Kernel Networking Stack
27
Kernel
Linux Kernel
Network Stack
Blackbox???
Packet
📦
Ethernet
Frame
NIC
Network
Hardware
Userspace Program
Userspace Software
Linux Kernel Networking Stack
28
Basic Packet Rx/Tx Path
29
① Receiving Path ② Forwarding Path ③ Sending Path
🖥️
⚡ 🖥️ 🖥️⚡
📦 📦 📦
⚡
⚡
Packet Path
30
Packet Kernel
Linux Kernel
Network Stack
Userspace Program
Userspace Software
📦
NIC
Network
Hardware
Packet Receiving Path
31
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet
Packet Receiving Path
32
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet NIC Hardware
Packet Receiving Path
네트워크 인터페이스 카드 하드웨어에서 패킷를 수신하고
33
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet NIC Driver
Rx/Tx
Queue
Packet Receiving Path
디바이스 드라이버단에서 NIC의 하드웨어(RX) 큐에서 패킷을 빼 내와서
34
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Data Link (L2)
Rx/Tx
Queue
📄 struct sk_buff
Packet Receiving Path
이를 sk_buff 구조체로 만들고
35
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Network (L3)
Rx/Tx
Queue
📄 struct sk_buff
IP ARP
Protocol Handler
ICMP
Packet Receiving Path
해당 패킷이 어떤 프로토콜인지 확인하여 해당하는 프로토콜의 핸들러 함수 호출
36
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Transport (L4)
Rx/Tx
Queue
📄 struct sk_buff
IP ARP
UDP
TCP
Protocol Handler
ICMP
QUIC
Packet Receiving Path
상위 프로토콜에 따른 적절한 함수를 호출
37
🖥️
Host A
192.168.0.1
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Application
Rx/Tx
Queue
📄 struct sk_buff
IP ARP
UDP
TCP
Protocol Handler
ICMP
QUIC
Packet Receiving Path 처리된 패킷을 사용자 어플리케이션에 넘겨줌
38
Packet Kernel
Linux Kernel
Network Stack
Packet
📦 📦
NIC
Network
Hardware
NIC
Network
Hardware
Packet Forwarding Path
39
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet
🖥️
Host C
192.168.0.4
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Forwarding Path
40
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
Packet
🖥️
Host C
192.168.0.4
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Forwarding Path
41
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Hardware
Packet Forwarding Path
42
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Driver
Packet Forwarding Path
43
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Data Link (L2)
Packet Forwarding Path
44
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
Packet Forwarding Path
45
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0
192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21
192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23
_gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0
Packet Forwarding Path
46
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX/TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0
192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21
192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23
_gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0
Packet Forwarding Path
47
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
Packet Forwarding Path
48
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Data Link (L2)
Packet Forwarding Path
49
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Driver
Packet Forwarding Path
50
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Hardware
Packet Forwarding Path
51
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Forwarding Path
52
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware NIC Hardware
Packet Forwarding Path
53
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Driver
Packet Forwarding Path
54
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Data Link (L2)
Packet Forwarding Path
55
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
Packet Forwarding Path
56
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Transport (L4)
Packet Forwarding Path
57
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2/192.168.0.3
🖥️
Host C
192.168.0.4
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Application
Packet Forwarding Path
58
Userspace Program
Userspace Software
Kernel
Linux Kernel
Network Stack
Packet
📦
NIC
Network
Hardware
Packet Sending Path
59
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet
Packet Sending Path
60
🖥️
Host A
192.168.0.1
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Sending Path
61
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Application
Packet Sending Path
62
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Transport (L4)
Packet Sending Path
63
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Network (L3)
Packet Sending Path
64
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Data Link (L2)
Packet Sending Path
65
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Driver
Packet Sending Path
66
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
NIC Hardware
Packet Sending Path
67
🖥️
Host A
192.168.0.1
Packet
🖥️
Host B
192.168.0.2
RX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
TX
Application
Transport (L4)
Network (L3)
Data Link (L2)
NIC Driver
NIC Hardware
Packet Sending Path
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
68
Packet Path in Kernel
69
Packet Kernel
Linux Kernel
Network Stack
Userspace Program
Userspace Software
📦
NIC
Network
Hardware
Packet Receiving Path
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
70
Packet Receiving Path
네트워크 인터페이스 카드 하드웨어에서 이를 수신하고
디바이스 드라이버단에서 NIC의 하드웨어(RX) 큐에서 패킷을 빼 내와서
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
71
Packet Receiving Path
빼온 패킷을 sk_buff 구조체로 생성하고
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
72
Packet Receiving Path
해당 패킷이 어떤 프로토콜인지를 확인하여
해당하는 핸들러 함수를 호출해 프로토콜을 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
73
Packet Receiving Path
ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
74
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0
192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21
192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23
_gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0
Packet Receiving Path
ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
75
Packet Receiving Path
L4 함수 호출 전 전처리 진행
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
76
Packet Receiving Path
패킷을 상위 계층으로 넘겨줌
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
77
Packet Receiving Path
78
Packet Kernel
Linux Kernel
Network Stack
Packet
📦 📦
NIC
Network
Hardware
NIC
Network
Hardware
Packet Forwarding Path
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
79
Packet Forwarding Path
ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
80
Packet Forwarding Path
FORWARDING 인 경우 라우팅 테이블에 따른 인터페이스로 이동
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
81
Packet Forwarding Path
전송할 목적지의 MAC 주소 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
82
Packet Forwarding Path
sk_buff를 패킷으로 만듬
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
83
Packet Forwarding Path
네트워크 인터페이스를 통해 패킷을 전송
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
84
Packet Forwarding Path
85
Userspace Program
Userspace Software
Kernel
Linux Kernel
Network Stack
Packet
📦
NIC
Network
Hardware
Packet Sending Path
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
86
Packet Sending Path
상위 레이어에서 패킷 전송
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
87
Packet Sending Path
ROUTING TABLE을 확인해서 어떤 인터페이스로 전송해야 되는지 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
88
Packet Sending Path
패킷 전송을 위한 전처리 진행
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
89
Packet Sending Path
전송할 목적지의 MAC 주소 확인
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
90
Packet Sending Path
sk_buff를 패킷으로 만듬
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
91
Packet Sending Path
네트워크 인터페이스를 통해 패킷을 전송
DEVICE DRIVER
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
92
Packet Sending Path
93
① Receiving Path ② Forwarding Path ③ Sending Path
🖥️
⚡ 🖥️ 🖥️⚡
📦 📦 📦
⚡
⚡
Linux Kernel Networking Stack Packet Processing
94
Linux Kernel Networking Stack
Packet Receiving
Packet Sending
Packet Forwarding
95
Linux Kernel Networking Stack
Packet Receiving
Packet Sending
Packet Forwarding
Packet Filtering
Packet Mangling
Packet Tunneling
Routing
NAT
TCP
HSR
UDP
AMT
96
Packet Processing
Packet Receiving
Packet Forwarding
Packet Sending
Packet Filtering
Routing
NAT
Packet Mangling
TCP
HSR
UDP
AMT
Packet Tunneling
97
Packet Processing
Packet Filtering
Routing
NAT
Packet Mangling
Packet Receiving
Packet Forwarding
Packet Sending
TCP
HSR
UDP
AMT
Packet Tunneling
98
Packet Filtering Path
99
Netfilter
Linux Firewall Framework
Packet Filtering
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
100
Device Driver Rx Device Driver Tx
Basic Packet Rx/Tx Path
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
101
Device Driver Rx Device Driver Tx
Packet Filtering Path in Kernel
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
102
Device Driver Rx Device Driver Tx
module
module
module
Netfilter Hook에 커널 모듈을 탑재해서
패킷을 필터링할 수 있음
ex) iptables, nftables
Packet Filtering Path in Kernel
103
DROP UDP 192.168.0.2:1234
$ iptables -A INPUT -d 192.168.0.2 -p udp --dport 1234 -j DROP
Netfilter (iptables) packet drop
Packet Filtering Example
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
104
Device Driver Rx Device Driver Tx
Packet
Packet
Packet
192.168.0.2:1234
Packet Filtering Path in Kernel
UPPER LAYER
Ingress
PROTO HANDLER ROUTING FORWARDING
OUTPUT
INPUT
NEIGH
ROUTING
Egress
L4~
L3
L2
105
Device Driver Rx Device Driver Tx
Packet
Packet
Packet
192.168.0.2:1234
DROP
Source IP Source Port Dest. IP Dest.Port Action
1 192.168.0.1 -- -- -- ALLOW
2 -- -- -- 22 DROP
3 -- -- 192.168.0.2 1234 DROP
Packet Filtering Path in Kernel
106
Packet Processing
Packet Filtering
Routing
NAT
Packet Mangling
Packet Receiving
Packet Forwarding
Packet Sending
TCP
HSR
UDP
AMT
Packet Tunneling
107
Linux Kernel Networking Stack
Packet Receiving
Packet Sending
Packet Forwarding
Packet Filtering
Packet Mangling
Routing
NAT
TCP
HSR
UDP
AMT
Packet Tunneling
108
Network Protocols
Packet Receiving
Packet Forwarding
Packet Sending
Packet Filtering
Routing
NAT
Packet Mangling
TCP
HSR
UDP
AMT
Packet Tunneling
109
Network Protocols
Packet Receiving
Packet Forwarding
Packet Sending
Packet Filtering
Routing
NAT
Packet Mangling
TCP
HSR
UDP
AMT
Packet Tunneling
110
HSR
Ring Topology의 구성을 통해 중복된 패킷을 전송하여
데이터 손실 없이 통신이 되도록 하는 네트워크 프로토콜
High Availability Seamless Redundancy
111
Node 1
Node 2
Critical Applications
- Fully Operational 24/7
- Require Zero-loss redundancy
ex) Power Plant (발전소),
Transportation (교통)
Basic Network Packet Transfer
112
Node 1
Node 2
Critical Applications
- Fully Operational 24/7
- Require Zero-loss redundancy
ex) Power Plant (발전소),
Transportation (교통)
Fail
Basic Network Packet Transfer
113
A-frame
HSR Tagged
B-frame
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
High Availability Seamless Redundancy
출발지
목적지
114
HSR Ring Topology
A-frame
HSR Tagged
B-frame
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A B
B
A B A B
B A
B A
A
High Availability Seamless Redundancy
출발지
목적지
115
HSR Ring Topology
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A-frame
HSR Tagged
B-frame
A B
B
A B A B
B A
B A
A
Packet
📦
📦
B-tagged
Packet
A-tagged
Packet
High Availability Seamless Redundancy
출발지
목적지
116
HSR Ring Topology
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A-frame
HSR Tagged
B-frame
A B
B
A B A B
B A
B A
A
Packet
📦
📦
B-tagged
Packet
A-tagged
Packet
High Availability Seamless Redundancy
출발지
목적지
117
HSR Ring Topology
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A-frame
HSR Tagged
B-frame
A B
B
A B A B
B A
B A
A
Packet
📦
📦
B-tagged
Packet
A-tagged
Packet
High Availability Seamless Redundancy
출발지
목적지
118
HSR Ring Topology
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A-frame
HSR Tagged
B-frame
A B
B
A B A B
B A
B A
A
Packet
📦
B-tagged
Packet
📦
A-tagged
Packet
High Availability Seamless Redundancy
출발지
목적지
119
HSR Ring Topology
Node 1 Node 2 Node 3
Node 6
Node 5
Node 4
A-frame
HSR Tagged
B-frame
A B
B
A B A B
B A
B A
A
Packet
📦
B-tagged
Packet
📦
A-tagged
Packet
High Availability Seamless Redundancy
출발지
목적지
120
Network Protocols
Packet Receiving
Packet Forwarding
Packet Sending
Packet Filtering
Routing
NAT
Packet Mangling
TCP
HSR
UDP
AMT
Packet Tunneling
121
Linux Kernel Networking Stack
Packet Receiving
Packet Sending
Packet Forwarding
Packet Filtering
Packet Mangling
Routing
NAT
TCP
HSR
UDP
AMT
Packet Tunneling
122
지금부터 리눅스 커널 컨트리뷰션을 위해
리눅스 커널 생태계를 알아봅시다.
2
Kernel 생태계
123
Linux Kernel
124
Linux Kernel은 Linux 운영 체제(OS)의 핵심 구성 요소
컴퓨터 하드웨어와 프로세스를 연결하는 핵심 인터페이스
Linux Kernel 마스코트 Tux
Linux Kernel 개발
125
전 세계 개발자들이 참여하는
최대 규모의 오픈소스 프로젝트
https://www.semanticscholar.org/paper/Perpetual-development%3A-A-model-of-the-Linux-kernel-
Feitelson/eb7cf446e983e98c1400c8181949f038caf0c8a8/figure/1
개발은 패치(Patch)라는 단위로 이루어짐
커널 release
126
v5.15 v5.16
v5.16-rc1 v5.16-rc2 … v5.16-rc7
Stable
(v5.16)
Stable
(v5.15)
LTS Release
10-11주(약 2개월) 마다 신규 커널 버전이 출시가 되고, stable 커널은 주 1회마다 출시
1. Mainline Kernel
2. Release Candidate (RC)
3. Stable
4. Long-term
커널 release 종류
127
1. Mainline Kernel
- 9~10주 주기로 릴리즈되는 커널
- 새로운 기능들이 소개되고 주요 버그 fix 패치가 합쳐져 출시
v5.15 v5.16
Mainline Kernel Release Mainline Kernel Release
커널 release 종류
128
2. Release Candidate (RC)
- Mainline kernel의 pre-release라고도 부름
- 신규 기능을 테스트하는 커널 버전
- 이 release는 반드시 소스코드를 컴파일해서 사용해야 함
- 주로 rc7까지 진행된 뒤 Mainline Release 진행
v5.15 v5.16
Release Candidate
Commit
v5.16-rc1 v5.16-rc2 … v5.16-rc7
커널 release 종류
129
3. Stable
- Bug fix만 진행되는 kernel release 버전 (mainline kernel backporting)
- mainline Kernel이 release 된 이후에 stable mode로 전환
v5.15 v5.16
v5.16-rc1 v5.16-rc2 … v5.16-rc7
Stable
(v5.15)
Stable
(v5.16)
커널 release 종류
130
4. Long-term
- stable release 버전 중 critical한 bug fix를 제공하는 kernel release 버전
v5.15 v5.16
v5.16-rc1 v5.16-rc2 … v5.16-rc7
Stable
(v5.16)
Stable
(v5.15)
LTS Release LTS Release
Linux Kernel Release Cycle
131
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15
Linux Kernel Release Cycle
132
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15
Stable
(v5.15)
Linux Kernel Release Cycle
133
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15
Stable
(v5.15)
LTS Release
Linux Kernel Release Cycle
134
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
Stable
(v5.15)
LTS Release
Linux Kernel Release Cycle
135
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1
Stable
(v5.15)
LTS Release
Linux Kernel Release Cycle
136
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2
Stable
(v5.15)
LTS Release
Linux Kernel Release Cycle
137
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
LTS Release
v5.16-rc6
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
Linux Kernel Release Cycle
138
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Linux Kernel Release Cycle
139
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Merge window
Linux Kernel Release Cycle
140
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
v5.16-rc6 v5.16-rc7
Merge window
http://vger.kernel.org/~davem/net-next.html
Linux Kernel Release Cycle
141
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Merge window
* Merge window
- 2주 정도 merge window 기간을 가지며, 이 merge window 기간 동안 리눅스 토발즈가 subsystem의 maintainer에게서 코드를 pull을
받아서 합치는 작업 진행
- 이 기간이 끝나면 새로운 버전 커널 release가 된 후, 2주 주기로 <mainline kernel version 명>-rc-<rc version 명>이라는 이름으로 커널
개발이 진행된다.
Linux Kernel Release Cycle
142
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Merge window
Linux Kernel Release Cycle
143
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.16)
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Merge window
Linux Kernel Release Cycle
144
5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.16)
Stable
(v5.15)
LTS Release
v5.16-rc6 v5.16-rc7
Merge window
LTS Release
Linux Kernel Release Cycle
145
v5.15 v5.16
v5.16-rc1 v5.16-rc2 …
Stable
(v5.16)
Stable
(v5.15)
v5.16-rc6 v5.16-rc7
Merge window
http://vger.kernel.org/~davem/net-next.html
Linux Kernel Subsystem
146
커널 내부에는 수많은 서브시스템이 있고,
http://www.MakeLinux.net/kernel/diagram
Linux Kernel Subsystem
147
커널 내부에는 수많은 서브시스템이 있고,
서브시스템별 개발된 기능들이 합쳐져 메인라인 커널로 출시
http://www.MakeLinux.net/kernel/diagram
Linux Kernel Subsystem
148
Linux Kernel v5.17 git
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
linux $ tree -d -L 1
.
├── arch
├── block
├── certs
├── crypto
├── Documentation
├── drivers
├── fs
├── include
├── init
├── ipc
├── kernel
├── lib
├── LICENSES
├── mm
├── net
├── samples
├── scripts
├── security
├── sound
├── tools
├── usr
└── virt
Linux Kernel Subsystem
149
linux $ tree -d -L 1
.
├── arch
├── block => 블록 디바이스 서브시스템
├── certs
├── crypto
├── Documentation
├── drivers => 드라이버 서브시스템
├── fs => 파일 시스템 서브시스템
├── include
├── init
├── ipc => IPC 서브시스템
├── kernel
├── lib
├── LICENSES
├── mm => 메모리 관리 서브시스템
├── net => 네트워크 서브시스템
├── samples
├── scripts
├── security
├── sound
├── tools
├── usr
└── virt
Linux Kernel v5.17 git
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Kernel Tree
150
https://git.kernel.org/
커널 코드는 몇몇 주요 subsystem git repository로 관리되는데
이걸 Kernel Tree라고 함
Kernel Tree
151
커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데
이걸 tree라고 함
Mainline Kernel tree
- Linus Torvalds가 관리
- Mainline kernel tree와 RC release 소스 코드가 관리
* https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18
Kernel Tree
152
* https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18
커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데
이걸 tree라고 함
Mainline Kernel tree
- Linus Torvalds가 관리
- Mainline kernel tree와 RC release 소스 코드가 관리
Stable Kernel tree
- Greg Kroah-Hartman가 관리
- stable release branches 소스 코드가 관리
Kernel Tree
153
커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데
이걸 tree라고 함
Mainline Kernel tree
- Linus Torvalds가 관리
- Mainline kernel tree와 RC release 소스 코드가 관리
Stable Kernel tree
- Greg Kroah-Hartman가 관리
- stable release branches 소스 코드가 관리
linux-next tree
- Stephen Rothwell가 관리.
- Subsystem의 변경 사항을 주기적으로 반영하고, 해당 코드의 통합 테스팅이
진행되는 곳
- 테스팅이 진행된 이후 mainline kernel tree로 pull request가 진행
* https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18
Linux Kernel Tree Hierarchy
154
Developer
Developer
net-next
Developer
Developer
driver-core
Developer
Developer
cgroup
linux
주요 서브시스템은 독립된 tree를 가짐
Linux Kernel Tree Hierarchy
155
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Torvalds
서브시스템 별 해당 tree를 관리하는 maintainer가 존재
netdev/net-next.git torvalds/linux.git
gregkh/driver-core.git
tj/cgroup.git
Subsystem Maintainers
156
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Torvalds
netdev/net.git
기존 release 버전의 버그 fix patch만 허용
git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
stable/linux.git
netdev/net.git : stable 버전 tree
Subsystem Maintainers
157
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Torvalds
netdev/net-next.git torvalds/linux.git
git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
netdev/net-next.git : 기능 개선 / 버그 수정 tree
Subsystem Maintainers
- MAINTAINERS 파일
158
$ cat MAINTAINERS | grep -A 30 'NETWORKING [GENERAL]'
NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net>
M: Eric Dumazet <edumazet@google.com>
M: Jakub Kicinski <kuba@kernel.org>
M: Paolo Abeni <pabeni@redhat.com>
L: netdev@vger.kernel.org
S: Maintained
Q: https://patchwork.kernel.org/project/netdevbpf/list/
B: mailto:netdev@vger.kernel.org
T: git git://git.kernel.org/.../netdev/net.git
T: git git://git.kernel.org/.../netdev/net-next.git
F: Documentation/networking/
F: Documentation/process/maintainer-netdev.rst
F: include/linux/in.h
F: include/linux/net.h
F: include/linux/netdevice.h
F: include/net/
F: include/uapi/linux/in.h
F: include/uapi/linux/net.h
F: include/uapi/linux/net_namespace.h
F: include/uapi/linux/netdevice.h
F: lib/net_utils.c
F: lib/random32.c
F: net/
F: tools/testing/selftests/net/
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Torvalds
netdev/net.git
Mailing List
159
각 서브시스템별로 mailing list를 가지며
컨트리뷰터들의 패치나 discussion이 이루어진다.
$ cat MAINTAINERS | grep -A 30 'NETWORKING [GENERAL]'
NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net>
M: Eric Dumazet <edumazet@google.com>
M: Jakub Kicinski <kuba@kernel.org>
M: Paolo Abeni <pabeni@redhat.com>
L: netdev@vger.kernel.org
S: Maintained
http://vger.kernel.org/vger-lists.html
Mailing List
160
Developer
L: netdev
📧
📜
[PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
컨트리뷰터가 패치 전송
Mailing List
161
Developer
L: netdev
patch
📧
📜
Mailing List에서 Review 와 Discussion 발생
[PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Mailing List
162
Developer
L: netdev
patch
📧
📜
패치가 accepted 되면 서브시스템에
반영되었다는 메일이 전송됨
[PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Maintainer
📧
Re: [PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open ode
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
Subsystem Maintainers
163
Developer
Maintainer Torvalds
netdev/net-next.git
패치는 net-next git tree에 반영
📧
📜
Subsystem Maintainers
164
Developer
Developer
Maintainer Torvalds
netdev/net-next.git
📧
📜
📜
📜
상위 tree로 Pull Request 전송
torvalds/linux.git
Subsystem Maintainers
165
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Developer
Developer
Maintainer
Torvalds
netdev/net-next.git
다양한 서브시스템에서도 상위 tree로 Pull Request 전송
📧
📜
📜
📜
📧
📜
📜
📜
gregkh/driver-core.git
tj/cgroup.git
torvalds/linux.git
166
Patch
Patch
리눅스 커널의 기여 단위
167
Patch
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
168
Patch
169
$ git format-patch -1
--subject-prefix="PATCH, net-next"
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
📜
Patch
170
From 0199215216978b612d4e8be11e878b87bc643033 Mon Sep 17 00:00:00 2001
From: Juhee Kang <claudiajkang@gmail.com>
Date: Sun, 10 Oct 2021 13:03:29 +0900
Subject: [PATCH, net-next] mlxsw: spectrum: use netif_is_macsec() instead of
open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
$ git format-patch -1
--subject-prefix="PATCH, net-next"
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
📜
Patch
171
$ git format-patch -1
--subject-prefix="PATCH, net-next"
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
$ git send-patch --cc “Network Maintainer
<example@email.com>“ --to “Network
Mailing List <list@email.com>” *.patch
📧
📜
Patch
172
$ git format-patch -1
--subject-prefix="PATCH, net-next"
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
📧
📧
📜
$ git send-patch --cc “Network Maintainer
<example@email.com>“ --to “Network
Mailing List <list@email.com>” *.patch
📜
Patch
173
$ git format-patch -1
--subject-prefix="PATCH, net-next"
리눅스 커널의 기여 단위
개발자들은 개발 내용을 patch로 만들어서
이메일로 메일링 리스트에 제출
📧
📧
📜
$ git send-patch --cc “Network Maintainer
<example@email.com>“ --to “Network
Mailing List <list@email.com>” *.patch
📜
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
Commit ID
174
commit을 중복 없이 기억하기 위해
SHA1 알고리즘으로 만들어진 hash 값을 사용
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
Commit ID
175
Author
Author Date
패치를 작성한 사람의 정보
ex) 작성자 이름 <작성자 메일 정보>
작성자가 해당 커밋을 작성한 시간
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
Commit ID
176
Author
Author Date
Commit
Commit Date
리눅스 커널에서 committer은 해당 패치를
git 저장소에 반영한 사람을 의미
ex) Maintainer 혹은 Reviewer
해당 커밋이 반영된 시간
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
Commit ID
177
Author
Author Date
Commit
Commit Date
Commit Description
해당 커밋에 대한 간략한 설명
다음과 같은 형식으로 작성
ex) 모듈 이름: 세부 모듈: 커밋 설명
해당 커밋에 대한 상세한 설명을 작성
Commit Header
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
Commit ID
178
Author
Author Date
Commit
Commit Date
Commit Header
Commit Description
Commit Tag
Signed-off-by:
작성자는 라이센싱 정책에 대해 이해했고
커밋을 오픈소스 패치로 제출하는 것에 동의
ex) Signed-off-by: 이름 <메일>
Patch 구성
179
1) Signed-off-by
라이센싱 정책에 대해 이해했고, 커밋을 오픈소스 패치로 제출하는 것에 동의
2) Acked-by
메인테이너가 해당 패치를 확인하였고, 개발자가 작성한 패치를 반영하기로 결정
3) Reviewed-by
해당 패치의 코드에 대해 Reviewer 혹은 다른 개발자가 리뷰하였음
4) Tested-by
해당 패치의 변경사항에 대해 Reviewer 혹은 다른 개발자가 테스트하였음
5) Reported-by / Suggested-by
해당 버그를 발견하거나 기능을 제안한 사람을 명시하기 위해 남기는 태그
6) Fixes
해당 패치가 어떤 커밋에서 발생한 버그를 해결하는지를 추적하기 위한 태그
mlxsw: spectrum: use netif_is_macsec() instead of open code
=== Commit Body ===
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Commit Tag Detail
samples: bpf: Fix tracex7 error raised on the missing argument
=== Commit Body ===
Acked-by: Yonghong Song <yhs@fb.com>
amt: Use BIT macros instead of open codes
=== Commit Body ===
Reviewed-by: Taehee Yoo <ap420073@gmail.com>
Tested-by: Taehee Yoo <ap420073@gmail.com>
net: hsr: fix hsr build error when lockdep is not enabled
=== Commit Body ===
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
bpf_glue: include errno.h
=== Commit Body ===
Fixes: ac4e0913beb1 (“bpf: Export bpf syscall wrapper”)
Patch 구성
commit 0199215216978b612d4e8be11e878b87bc643033
Author: Juhee Kang <claudiajkang@gmail.com>
AuthorDate: Sun Oct 10 13:03:29 2021 +0900
Commit: David S. Miller <davem@davemloft.net>
CommitDate: Sun Oct 10 11:18:48 2021 +0100
mlxsw: spectrum: use netif_is_macsec() instead of open code
Open code which is dev->priv_flags & IFF_MACSEC has already defined as
netif_is_macsec(). So use netif_is_macsec() instead of open code.
This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 15f4a658e436..0723c1314ea2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev)
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
}
extern struct pernet_operations __net_initdata loopback_net_ops;
--
2.34.1
diff 결과
(스냅샷 정보)
Commit Header
Commit ID
Author
Author Date
180
Commit
Commit Date
Commit Description
Commit Tag
해당 커밋에 포함된 diff 결과
- 수정이 발생한 파일 목록
include/linux/netdevice.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
- 세부 수정사항
static inline bool netif_reduces_vlan_mtu(struct net_device *dev)
{
/* TODO: reserve and use an additional IFF bit, if we get more
users */
- return dev->priv_flags & IFF_MACSEC;
+ return netif_is_macsec(dev);
181
리눅스 Kernel에 이제 실제로 Contribution 해볼까요?
3
Kernel 기여하기
182
① 문서 기여
② 버그 수정
③ 기능 개선
컨트리뷰션 방법
183
1. 문서 기여
신규 문서 추가
184
기존 문서 수정
2. 버그 수정
버그가 잘 동작하도록 수정 후 패치 전송
185
3. 기능 개선
신규 기능 추가
186
3. 기능 개선
기존 기능 강화
187
188
Kernel Patch in Action
189
버그를 수정하는 패치를 진행한다고 가정
문제 발견
190
커널의 테스트 스크립트
실행 도중 에러 발생
$ cd samples/bpf
$ make -j
$ ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
커널 개발 환경 구성 - 리눅스 환경 설정
191
Fedora
Debian
OpenSUSE
Ubuntu
가상 환경에 리눅스 설치
커널 개발 환경 구성 - 리눅스 환경 설정
192
가상 환경 리눅스에 개발 관련 패키지 설치
# apt-get install build-essential vim git cscope
libncurses-dev libssl-dev bison flex bison
# systemctl enable serial-getty@ttyS0.service
# systemctl start serial-getty@ttyS0.service
# systemctl daemon-reload
# vim /etc/default/grub
# update-grub2
커널 개발 환경 구성 - 리눅스 환경 설정
193
가상 환경 리눅스에 개발 관련 패키지 설치
및 디버깅을 위한 환경 구축
# apt-get install build-essential vim git cscope
libncurses-dev libssl-dev bison flex bison
# systemctl enable serial-getty@ttyS0.service
# systemctl start serial-getty@ttyS0.service
# systemctl daemon-reload
# vim /etc/default/grub
# update-grub2
커널 개발 환경 구성 - 커널 개발 소스 코드 다운
194
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
문제 재현 및 원인 판단
195
$ cd samples/bpf
$ make -j
$ ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
커널의 테스트 스크립트
실행 도중 에러 발생
문제 재현 및 원인 판단
196
커널의 테스트 스크립트
실행 도중 에러 발생
$ cd samples/bpf
$ make -j
$ ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
# vim tracex7_user.c
프로그램 실행 시 인자를
확인하지 않아 발생한 문제
버그 해결을 위해 소스코드 수정
197
diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh
index e68b9ee6814b8b..35db26f736b9d9 100755
--- a/samples/bpf/test_override_return.sh
+++ b/samples/bpf/test_override_return.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+rm -r tmpmnt
rm -f testfile.img
dd if=/dev/zero of=testfile.img bs=1M seek=1000 count=1
DEVICE=$(losetup --show -f testfile.img)
diff --git a/samples/bpf/tracex7_user.c b/samples/bpf/tracex7_user.c
index fdcd6580dd736a..8be7ce18d3ba05 100644
--- a/samples/bpf/tracex7_user.c
+++ b/samples/bpf/tracex7_user.c
@@ -14,6 +14,11 @@ int main(int argc, char **argv)
int ret = 0;
FILE *f;
+ if (!argv[1]) {
+ fprintf(stderr, "ERROR: Run with the btrfs device argument!n");
+ return 0;
+ }
+
snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
obj = bpf_object__open_file(filename, NULL);
if (libbpf_get_error(obj)) {
$ git diff
커밋 메시지 작성
198
소스 코드 수정 후, 커밋 메시지 작성 후 커밋 진행
$ git commit -s
커밋 메시지 작성
199
커밋 메시지 작성이 어렵다면?
$ git log -- <내가 수정한 파일 이름 filename>
커밋 메시지 작성
200
커밋 메시지 작성이 어렵다면?
$ git log -- samples/bpf/tracex7_user.c <해당 파일의 이전 커밋 확인>
commit 2bf3e2ef425bc2a164f10b554b7db6a8b4090ef4
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon May 14 22:35:02 2018 -0700
samples: bpf: include bpf/bpf.h instead of local libbpf.h
There are two files in the tree called libbpf.h which is becoming
problematic. Most samples don't actually need the local libbpf.h
they simply include it to get to bpf/bpf.h. Include bpf/bpf.h
directly instead.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
commit 965de87e54b803223bff703ea6b2a76c056695ae
Author: Josef Bacik <jbacik@fb.com>
Date: Mon Dec 11 11:36:49 2017 -0500
samples/bpf: add a test for bpf_override_return
커밋 메시지 작성
201
samples: bpf: Fix tracex7 error raised on the missing argument
The current behavior of 'tracex7' doesn't consist with other bpf samples
tracex{1..6}. Other samples do not require any argument to run with, but
tracex7 should be run with btrfs device argument. (it should be executed
with test_override_return.sh)
Currently, tracex7 doesn't have any description about how to run this
program and raises an unexpected error. And this result might be
confusing since users might not have a hunch about how to run this
program.
// Current behavior
# ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
// Fixed behavior
# ./tracex7 ERROR: Run with the btrfs device argument!
In order to fix this error, this commit adds logic to report a message
and exit when running this program with a missing argument.
Additionally in test_override_return.sh, there is a problem with
multiple directory(tmpmnt) creation. So in this commit adds a line with
removing the directory with every execution.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
커밋 메시지 작성
202
samples: bpf: Fix tracex7 error raised on the missing argument
The current behavior of 'tracex7' doesn't consist with other bpf samples
tracex{1..6}. Other samples do not require any argument to run with, but
tracex7 should be run with btrfs device argument. (it should be executed
with test_override_return.sh)
Currently, tracex7 doesn't have any description about how to run this
program and raises an unexpected error. And this result might be
confusing since users might not have a hunch about how to run this
program.
// Current behavior
# ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
// Fixed behavior
# ./tracex7 ERROR: Run with the btrfs device argument!
In order to fix this error, this commit adds logic to report a message
and exit when running this program with a missing argument.
Additionally in test_override_return.sh, there is a problem with
multiple directory(tmpmnt) creation. So in this commit adds a line with
removing the directory with every execution.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
커밋 헤더는
가능하다면 50자 이내
커밋 메시지 작성
203
samples: bpf: Fix tracex7 error raised on the missing argument
The current behavior of 'tracex7' doesn't consist with other bpf samples
tracex{1..6}. Other samples do not require any argument to run with, but
tracex7 should be run with btrfs device argument. (it should be executed
with test_override_return.sh)
Currently, tracex7 doesn't have any description about how to run this
program and raises an unexpected error. And this result might be
confusing since users might not have a hunch about how to run this
program.
// Current behavior
# ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
// Fixed behavior
# ./tracex7 ERROR: Run with the btrfs device argument!
In order to fix this error, this commit adds logic to report a message
and exit when running this program with a missing argument.
Additionally in test_override_return.sh, there is a problem with
multiple directory(tmpmnt) creation. So in this commit adds a line with
removing the directory with every execution.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
커밋 설명은 상세하게
한 줄에 72자 넘지 않도록
커밋 메시지 작성
204
samples: bpf: Fix tracex7 error raised on the missing argument
The current behavior of 'tracex7' doesn't consist with other bpf samples
tracex{1..6}. Other samples do not require any argument to run with, but
tracex7 should be run with btrfs device argument. (it should be executed
with test_override_return.sh)
Currently, tracex7 doesn't have any description about how to run this
program and raises an unexpected error. And this result might be
confusing since users might not have a hunch about how to run this
program.
// Current behavior
# ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
// Fixed behavior
# ./tracex7 ERROR: Run with the btrfs device argument!
In order to fix this error, this commit adds logic to report a message
and exit when running this program with a missing argument.
Additionally in test_override_return.sh, there is a problem with
multiple directory(tmpmnt) creation. So in this commit adds a line with
removing the directory with every execution.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
필요하다면, 발생한 문제의
상세한 설명을 위해 재현방법 서술
커밋 메시지 작성
205
samples: bpf: Fix tracex7 error raised on the missing argument
The current behavior of 'tracex7' doesn't consist with other bpf samples
tracex{1..6}. Other samples do not require any argument to run with, but
tracex7 should be run with btrfs device argument. (it should be executed
with test_override_return.sh)
Currently, tracex7 doesn't have any description about how to run this
program and raises an unexpected error. And this result might be
confusing since users might not have a hunch about how to run this
program.
// Current behavior
# ./tracex7
sh: 1: Syntax error: word unexpected (expecting ")")
// Fixed behavior
# ./tracex7 ERROR: Run with the btrfs device argument!
In order to fix this error, this commit adds logic to report a message
and exit when running this program with a missing argument.
Additionally in test_override_return.sh, there is a problem with
multiple directory(tmpmnt) creation. So in this commit adds a line with
removing the directory with every execution.
Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by 태그 작성
커널 개발 환경 구성 - Patch 메일 전송을 위한 환경 구축
206
git-email 패키지를 통해
작성된 patch를 쉽게 메일로 전송 가능
# apt-get install git-email
$ git config --global sendemail.smtpencryption tls
$ git config --global sendemail.smtpserver <mailserver>
$ git config --global sendemail.smtpuser <email>
$ git config --global sendemail.smtpserverport 587
$ git config --global sendemail.smtppass <password>
git config을 이용해 smtp 계정 설정
ex) gmail smtp 설정
패치 메일 작성 준비 및 컨벤션 테스트
207
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
208
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
<커밋 개수>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
209
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
<커밋 개수> <커널 tree에 따른 메일 prefix 추가>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
210
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
<커밋 개수>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
<커널 tree에 따른 메일 prefix 추가>
패치 메일 작성 준비 및 컨벤션 테스트
211
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ apt-get install codespell python-ply python-git
$ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
212
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ apt-get install codespell python-ply python-git
$ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
213
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ apt-get install codespell python-ply python-git
$ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 작성 준비 및 컨벤션 테스트
214
$ git format-patch -1 --subject-prefix=“PATCH, bpf-next“
0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ apt-get install codespell python-ply python-git
$ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달>
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
0001-*.patch has no obvious style problems and is ready for submission.
<컨벤션 문제 없음>
패치 메일 수신 대상 찾기 및 전송
215
$ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch
Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org
$ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch
Send this email? ([y]es|[n]o|[q]uit|[a]ll):
[...]
Result: OK
메인테이너와
메일링 리스트 찾기
패치 메일 수신 대상 찾기 및 전송
216
$ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch
Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org
$ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch
Send this email? ([y]es|[n]o|[q]uit|[a]ll):
[...]
Result: OK
<인자로 패치 파일 전달>
메인테이너와
메일링 리스트 찾기
패치 메일 수신 대상 찾기 및 전송
217
$ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch
Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org
$ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch
Send this email? ([y]es|[n]o|[q]uit|[a]ll):
[...]
Result: OK
메인테이너와
메일링 리스트 찾기
패치 메일 수신 대상 찾기 및 전송
218
$ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch
Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org
$ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch
Send this email? ([y]es|[n]o|[q]uit|[a]ll): Y
[...]
Result: OK 메일 전송하기
메일 전송되었는지 확인
219
Gmail을 통해서도 확인 가능
메일 전송되었는지 확인
220
https://patchwork.kernel.org/project/netdevbpf/list
Patchwork을 통해서도 확인
리뷰 확인
221
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Juhee Kang <claudiajkang@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>, Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [bpf-next 1/2] samples: bpf: Fix tracex7 error raised on the missing argument
On Sat, Jul 24, 2021 at 8:21 AM Juhee Kang <claudiajkang@gmail.com> wrote:
[...]
> diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh
> index e68b9ee6814b..6480b55502c7 100755
> --- a/samples/bpf/test_override_return.sh
> +++ b/samples/bpf/test_override_return.sh
> @@ -1,5 +1,6 @@
> #!/bin/bash
>
> +rm -rf tmpmnt
Do we need -rf or -r would do?
[...]
> --
> 2.27.0
리뷰 응답
222
From: Juhee Kang <claudiajkang@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>, Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [bpf-next 1/2] samples: bpf: Fix tracex7 error raised on the missing argument
On Tue, Jul 27, 2021 at 5:08 AM Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> On Sat, Jul 24, 2021 at 8:21 AM Juhee Kang <claudiajkang@gmail.com> wrote:
[...]
> > diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh
> > index e68b9ee6814b..6480b55502c7 100755
> > --- a/samples/bpf/test_override_return.sh
> > +++ b/samples/bpf/test_override_return.sh
> > @@ -1,5 +1,6 @@
> > #!/bin/bash
> >
> > +rm -rf tmpmnt
> Do we need -rf or -r would do?
It works properly using only -r.
Thanks for pointing it out! I will stick to this method.
I will send the next version as soon as possible.
[...]
> > 2.27.0
코드 수정 후 패치 메일 작성 준비
223
$ git format-patch -1 –v2 --subject-prefix=“PATCH, bpf-next“
v2-0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ ./scripts/checkpatch.pl --strict --codespell v2-0001-*.patch
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
v2-0001-*.patch has no obvious style problems and is ready for submission.
<두번째 버전의 패치임을 명시>
코드 수정 후 패치 메일 작성 준비
224
$ git format-patch -1 –v2 --subject-prefix=“PATCH, bpf-next“
v2-0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch
$ ./scripts/checkpatch.pl --strict --codespell v2-0001-*.patch
total: 0 errors, 0 warnings, 0 checks, 17 lines checked
v2-0001-*.patch has no obvious style problems and is ready for submission.
패치 메일 수신 대상 찾기 및 전송
225
$ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats v2-0001-*.patch
Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org
$ git send-email --to=“maintainer mail” --to=“mailing list mail” v2-0001-*.patch
Send this email? ([y]es|[n]o|[q]uit|[a]ll): Y
[...]
Result: OK 메일 전송하기
패치 accept
226
From: patchwork-bot+netdevbpf <patchwork-bot+netdevbpf@kernel.org>
To: Juhee Kang <claudiajkang@gmail.com>
Subject: Re: [bpf-next v2 1/2] samples: bpf: Fix tracex7 error raised on the missing argument
Hello:
This series was applied to bpf/bpf-next.git (refs/heads/master):
On Tue, 27 Jul 2021 04:10:55 +0000 you wrote:
> The current behavior of 'tracex7' doesn't consist with other bpf samples
> tracex{1..6}. Other samples do not require any argument to run with, but
> tracex7 should be run with btrfs device argument. (it should be executed
> with test_override_return.sh)
> [...]
Here is the summary with links:
- [bpf-next,v2,1/2] samples: bpf: Fix tracex7 error raised on the missing argument
https://git.kernel.org/bpf/bpf-next/c/7d07006f0592
- [bpf-next,v2,2/2] samples: bpf: Add the omitted xdp samples to .gitignore
https://git.kernel.org/bpf/bpf-next/c/05e9b4f60d31
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
패치 accept
227
Gmail을 통해서도 확인 가능
패치 accept
228
https://patchwork.kernel.org/project/netdevbpf/list
Patchwork을 통해서도 확인
229
여기까지가 간단한 리눅스 커널 커밋 과정이었습니다.
커널 패치를 진행해보고 싶으시다면?
커널 관련 컨트리뷰션 프로그램 참여
230
231
커널 패치를 위한 장벽 중 하나라도 극복이 되셨길!
Q&A
232

More Related Content

PDF
Breaking Down the Entry Barriers on Linux Kernel Networking Stack
PDF
Container Performance Analysis
PDF
containerd summit - Deep Dive into containerd
PDF
Qemu device prototyping
PDF
eBPF Trace from Kernel to Userspace
PDF
Faster packet processing in Linux: XDP
PDF
High-Performance Networking Using eBPF, XDP, and io_uring
PDF
Dockers and kubernetes
Breaking Down the Entry Barriers on Linux Kernel Networking Stack
Container Performance Analysis
containerd summit - Deep Dive into containerd
Qemu device prototyping
eBPF Trace from Kernel to Userspace
Faster packet processing in Linux: XDP
High-Performance Networking Using eBPF, XDP, and io_uring
Dockers and kubernetes

What's hot (20)

PDF
BPF: Tracing and more
PPT
Linux Kernel Image
PDF
Using eBPF for High-Performance Networking in Cilium
ODP
ansible why ?
PDF
ACPI Debugging from Linux Kernel
PDF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
PDF
Linux BPF Superpowers
PDF
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
PDF
ACRN Kata Container on ACRN
PDF
Cilium - BPF & XDP for containers
PDF
LISA2019 Linux Systems Performance
PDF
Writing the Container Network Interface(CNI) plugin in golang
PDF
Performance Wins with eBPF: Getting Started (2021)
PDF
Browsing Linux Kernel Source
PPTX
Understanding eBPF in a Hurry!
PDF
UM2019 Extended BPF: A New Type of Software
PPTX
[NHN_NEXT] DirectX Tutorial 강의 자료
PDF
Linux Performance Analysis: New Tools and Old Secrets
PDF
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
PDF
Linux Internals - Part II
BPF: Tracing and more
Linux Kernel Image
Using eBPF for High-Performance Networking in Cilium
ansible why ?
ACPI Debugging from Linux Kernel
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux BPF Superpowers
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
ACRN Kata Container on ACRN
Cilium - BPF & XDP for containers
LISA2019 Linux Systems Performance
Writing the Container Network Interface(CNI) plugin in golang
Performance Wins with eBPF: Getting Started (2021)
Browsing Linux Kernel Source
Understanding eBPF in a Hurry!
UM2019 Extended BPF: A New Type of Software
[NHN_NEXT] DirectX Tutorial 강의 자료
Linux Performance Analysis: New Tools and Old Secrets
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
Linux Internals - Part II
Ad

Similar to [ko] Kernel Networking Stack 진입 장벽 허물기 (20)

PDF
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
PPTX
Dataplane programming with eBPF: architecture and tools
PPTX
Raspberry pi Part 22
PPTX
Analise NetFlow in Real Time
PDF
TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...
PDF
Replacing iptables with eBPF in Kubernetes with Cilium
PDF
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
PDF
2008-09-09 IBM Interaction Conference, Red Hat Update for System z
PDF
Osnug meetup-tungsten fabric - overview.pptx
PDF
Cilium - Fast IPv6 Container Networking with BPF and XDP
PDF
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
PDF
"One network to rule them all" - OpenStack Summit Austin 2016
PPTX
Harmonia open iris_basic_v0.1
PPTX
DPDK KNI interface
ODT
Cross-compilation native sous android
PDF
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
PDF
ebpf and IO Visor: The What, how, and what next!
PDF
An Introduce of OPNFV (Open Platform for NFV)
PPTX
Hardware accelerated switching with Linux @ SWLUG Talks May 2014
PDF
Hackerworkshop exercises
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Dataplane programming with eBPF: architecture and tools
Raspberry pi Part 22
Analise NetFlow in Real Time
TDC2016POA | Trilha Infraestrutura - Apache Mesos & Marathon: gerenciando rem...
Replacing iptables with eBPF in Kubernetes with Cilium
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
2008-09-09 IBM Interaction Conference, Red Hat Update for System z
Osnug meetup-tungsten fabric - overview.pptx
Cilium - Fast IPv6 Container Networking with BPF and XDP
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
"One network to rule them all" - OpenStack Summit Austin 2016
Harmonia open iris_basic_v0.1
DPDK KNI interface
Cross-compilation native sous android
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
ebpf and IO Visor: The What, how, and what next!
An Introduce of OPNFV (Open Platform for NFV)
Hardware accelerated switching with Linux @ SWLUG Talks May 2014
Hackerworkshop exercises
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
MYSQL Presentation for SQL database connectivity
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.

[ko] Kernel Networking Stack 진입 장벽 허물기

  • 1. Linux Kernel Networking Stack 진입 장벽 허물기 강주희 claudiajkang@gmail.com
  • 2. Speaker 강주희 (Juhee Kang, claudiajkang@gmail.com) - 오픈 소스 파트 프런티어 개발자 - 프로젝트: Linux Kernel Networking Stack, Kubernetes i18n - 주력 분야 : 클라우드, 네트워크, 백엔드 - 강연 활동 : 연세대, 숭실대 등 5개 대학 Git/GitHub 교육 진행 2
  • 3. Linux Kernel Networking Stack 1 Kernel 기여하기 3 목차 3 Kernel 생태계 2
  • 6. 다른 오픈소스처럼 컨트리뷰션 하면 될까? 6 리눅스 커널도 오픈소스이니까 다른 오픈 소스처럼 github에서 하겠지?
  • 7. 오픈소스 원본 저장소 7 github으로 관리되는 오픈소스에 컨트리뷰션을 한다면?
  • 8. 오픈소스 원본 저장소 <나의 github id>/fork된 저장소 8 github으로 관리되는 오픈소스에 컨트리뷰션을 한다면? fork
  • 9. Issue 생성 브랜치 생성 커밋 PR (PullRequest) 최신 remote repo 내용 업데이트(pull) merge 오픈소스 원본 저장소 <나의 github id>/fork된 저장소 review 9 github으로 관리되는 오픈소스에 컨트리뷰션을 한다면? fork clone
  • 10. 타 오픈소스처럼 github에서 컨트리뷰션 하면 될까? 10 Github 내 kernel 소스코드 관리하는 repository로 이동
  • 11. 타 오픈소스처럼 github에서 컨트리뷰션 하면 될까? 11 Pull Request 존재 확인
  • 12. 타 오픈소스처럼 github에서 컨트리뷰션 하면 될까? 12 KernelPRBot 댓글 확인
  • 13. 타 오픈소스처럼 컨트리뷰션 하면 될까? 13 Github 은 read-only mirror
  • 14. 타 오픈소스처럼 컨트리뷰션 하면 될까? 14 KernelPRBot이 안내하는 Contribution 방법
  • 15. Linux Kernel 컨트리뷰션? 15 - Linux Kernel (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) Linux Kernel은 GitHub을 사용하지 않는 오픈 소스 프로젝트
  • 16. 로컬 브랜치 생성 커밋 Patch 생성 Patch 메일 전송 최신 remote repo 내용 업데이트(pull) merge linux.git review 16 Linux Kernel 컨트리뷰션 과정? clone
  • 17. 로컬 브랜치 생성 커밋 Patch 생성 Patch 메일 전송 최신 remote repo 내용 업데이트(pull) merge linux.git review 17 Linux Kernel 컨트리뷰션 과정? clone
  • 18. 18 Linux Kernel 컨트리뷰션? 소스 코드 다운 경로? 빌드 환경 구성? 패치란 무엇인가? 메일로 커밋한다고? 시작하기도 전에 마주한 무수히 많은 장벽들...
  • 19. 19 이번 세션의 목표 리눅스 커널 컨트리뷰션을 위한 장벽을 허물어 봅시다.
  • 22. 22 Packet 📦 Ethernet Frame Preamble Ethernet Frame Inter Frame Gap MAC. Destination MAC. Source Type PAYLOAD (IP/IPv6/ARP…) CRC 8 Bytes 6 Bytes 6 Bytes 2 Bytes 46-1500 Bytes 4 Bytes 12 Bytes 8 64 12 Linux Kernel Networking Stack
  • 29. 29 ① Receiving Path ② Forwarding Path ③ Sending Path 🖥️ ⚡ 🖥️ 🖥️⚡ 📦 📦 📦 ⚡ ⚡ Packet Path
  • 30. 30 Packet Kernel Linux Kernel Network Stack Userspace Program Userspace Software 📦 NIC Network Hardware Packet Receiving Path
  • 31. 31 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Packet Receiving Path
  • 32. 32 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet NIC Hardware Packet Receiving Path 네트워크 인터페이스 카드 하드웨어에서 패킷를 수신하고
  • 33. 33 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet NIC Driver Rx/Tx Queue Packet Receiving Path 디바이스 드라이버단에서 NIC의 하드웨어(RX) 큐에서 패킷을 빼 내와서
  • 34. 34 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Data Link (L2) Rx/Tx Queue 📄 struct sk_buff Packet Receiving Path 이를 sk_buff 구조체로 만들고
  • 35. 35 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Network (L3) Rx/Tx Queue 📄 struct sk_buff IP ARP Protocol Handler ICMP Packet Receiving Path 해당 패킷이 어떤 프로토콜인지 확인하여 해당하는 프로토콜의 핸들러 함수 호출
  • 36. 36 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Transport (L4) Rx/Tx Queue 📄 struct sk_buff IP ARP UDP TCP Protocol Handler ICMP QUIC Packet Receiving Path 상위 프로토콜에 따른 적절한 함수를 호출
  • 37. 37 🖥️ Host A 192.168.0.1 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Application Rx/Tx Queue 📄 struct sk_buff IP ARP UDP TCP Protocol Handler ICMP QUIC Packet Receiving Path 처리된 패킷을 사용자 어플리케이션에 넘겨줌
  • 38. 38 Packet Kernel Linux Kernel Network Stack Packet 📦 📦 NIC Network Hardware NIC Network Hardware Packet Forwarding Path
  • 39. 39 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet 🖥️ Host C 192.168.0.4 TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Forwarding Path
  • 40. 40 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 Packet 🖥️ Host C 192.168.0.4 TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Forwarding Path
  • 41. 41 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Hardware Packet Forwarding Path
  • 42. 42 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Driver Packet Forwarding Path
  • 43. 43 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Data Link (L2) Packet Forwarding Path
  • 44. 44 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) Packet Forwarding Path
  • 45. 45 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0 192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21 192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23 _gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0 Packet Forwarding Path
  • 46. 46 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX/TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0 192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21 192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23 _gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0 Packet Forwarding Path
  • 47. 47 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) Packet Forwarding Path
  • 48. 48 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Data Link (L2) Packet Forwarding Path
  • 49. 49 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Driver Packet Forwarding Path
  • 50. 50 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Hardware Packet Forwarding Path
  • 51. 51 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Forwarding Path
  • 52. 52 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Hardware Packet Forwarding Path
  • 53. 53 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Driver Packet Forwarding Path
  • 54. 54 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Data Link (L2) Packet Forwarding Path
  • 55. 55 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) Packet Forwarding Path
  • 56. 56 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Transport (L4) Packet Forwarding Path
  • 57. 57 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2/192.168.0.3 🖥️ Host C 192.168.0.4 Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Application Packet Forwarding Path
  • 58. 58 Userspace Program Userspace Software Kernel Linux Kernel Network Stack Packet 📦 NIC Network Hardware Packet Sending Path
  • 59. 59 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Packet Sending Path
  • 60. 60 🖥️ Host A 192.168.0.1 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Sending Path
  • 61. 61 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Application Packet Sending Path
  • 62. 62 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Transport (L4) Packet Sending Path
  • 63. 63 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Network (L3) Packet Sending Path
  • 64. 64 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Data Link (L2) Packet Sending Path
  • 65. 65 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Driver Packet Sending Path
  • 66. 66 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware NIC Hardware Packet Sending Path
  • 67. 67 🖥️ Host A 192.168.0.1 Packet 🖥️ Host B 192.168.0.2 RX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware TX Application Transport (L4) Network (L3) Data Link (L2) NIC Driver NIC Hardware Packet Sending Path
  • 68. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 68 Packet Path in Kernel
  • 69. 69 Packet Kernel Linux Kernel Network Stack Userspace Program Userspace Software 📦 NIC Network Hardware Packet Receiving Path
  • 70. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 70 Packet Receiving Path 네트워크 인터페이스 카드 하드웨어에서 이를 수신하고 디바이스 드라이버단에서 NIC의 하드웨어(RX) 큐에서 패킷을 빼 내와서
  • 71. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 71 Packet Receiving Path 빼온 패킷을 sk_buff 구조체로 생성하고
  • 72. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 72 Packet Receiving Path 해당 패킷이 어떤 프로토콜인지를 확인하여 해당하는 핸들러 함수를 호출해 프로토콜을 확인
  • 73. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 73 Packet Receiving Path ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
  • 74. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 74 $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 _gateway 0.0.0.0 UG 101 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 eth0 192.168.0.1 192.168.0.2 255.255.255.255 UGH 0 0 0 veth21 192.168.0.4 192.168.0.3 255.255.255.255 UGH 0 0 0 veth23 _gateway 0.0.0.0 255.255.255.255 UH 101 0 0 eth0 Packet Receiving Path ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
  • 75. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 75 Packet Receiving Path L4 함수 호출 전 전처리 진행
  • 76. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 76 Packet Receiving Path 패킷을 상위 계층으로 넘겨줌
  • 77. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 77 Packet Receiving Path
  • 78. 78 Packet Kernel Linux Kernel Network Stack Packet 📦 📦 NIC Network Hardware NIC Network Hardware Packet Forwarding Path
  • 79. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 79 Packet Forwarding Path ROUTING 테이블에서 나의 IP 주소로 오는 패킷인지 확인
  • 80. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 80 Packet Forwarding Path FORWARDING 인 경우 라우팅 테이블에 따른 인터페이스로 이동
  • 81. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 81 Packet Forwarding Path 전송할 목적지의 MAC 주소 확인
  • 82. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 82 Packet Forwarding Path sk_buff를 패킷으로 만듬
  • 83. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 83 Packet Forwarding Path 네트워크 인터페이스를 통해 패킷을 전송
  • 84. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 84 Packet Forwarding Path
  • 85. 85 Userspace Program Userspace Software Kernel Linux Kernel Network Stack Packet 📦 NIC Network Hardware Packet Sending Path
  • 86. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 86 Packet Sending Path 상위 레이어에서 패킷 전송
  • 87. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 87 Packet Sending Path ROUTING TABLE을 확인해서 어떤 인터페이스로 전송해야 되는지 확인
  • 88. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 88 Packet Sending Path 패킷 전송을 위한 전처리 진행
  • 89. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 89 Packet Sending Path 전송할 목적지의 MAC 주소 확인
  • 90. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 90 Packet Sending Path sk_buff를 패킷으로 만듬
  • 91. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 91 Packet Sending Path 네트워크 인터페이스를 통해 패킷을 전송
  • 92. DEVICE DRIVER UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 92 Packet Sending Path
  • 93. 93 ① Receiving Path ② Forwarding Path ③ Sending Path 🖥️ ⚡ 🖥️ 🖥️⚡ 📦 📦 📦 ⚡ ⚡ Linux Kernel Networking Stack Packet Processing
  • 94. 94 Linux Kernel Networking Stack Packet Receiving Packet Sending Packet Forwarding
  • 95. 95 Linux Kernel Networking Stack Packet Receiving Packet Sending Packet Forwarding Packet Filtering Packet Mangling Packet Tunneling Routing NAT TCP HSR UDP AMT
  • 96. 96 Packet Processing Packet Receiving Packet Forwarding Packet Sending Packet Filtering Routing NAT Packet Mangling TCP HSR UDP AMT Packet Tunneling
  • 97. 97 Packet Processing Packet Filtering Routing NAT Packet Mangling Packet Receiving Packet Forwarding Packet Sending TCP HSR UDP AMT Packet Tunneling
  • 100. UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 100 Device Driver Rx Device Driver Tx Basic Packet Rx/Tx Path
  • 101. UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 101 Device Driver Rx Device Driver Tx Packet Filtering Path in Kernel
  • 102. UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 102 Device Driver Rx Device Driver Tx module module module Netfilter Hook에 커널 모듈을 탑재해서 패킷을 필터링할 수 있음 ex) iptables, nftables Packet Filtering Path in Kernel
  • 103. 103 DROP UDP 192.168.0.2:1234 $ iptables -A INPUT -d 192.168.0.2 -p udp --dport 1234 -j DROP Netfilter (iptables) packet drop Packet Filtering Example
  • 104. UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 104 Device Driver Rx Device Driver Tx Packet Packet Packet 192.168.0.2:1234 Packet Filtering Path in Kernel
  • 105. UPPER LAYER Ingress PROTO HANDLER ROUTING FORWARDING OUTPUT INPUT NEIGH ROUTING Egress L4~ L3 L2 105 Device Driver Rx Device Driver Tx Packet Packet Packet 192.168.0.2:1234 DROP Source IP Source Port Dest. IP Dest.Port Action 1 192.168.0.1 -- -- -- ALLOW 2 -- -- -- 22 DROP 3 -- -- 192.168.0.2 1234 DROP Packet Filtering Path in Kernel
  • 106. 106 Packet Processing Packet Filtering Routing NAT Packet Mangling Packet Receiving Packet Forwarding Packet Sending TCP HSR UDP AMT Packet Tunneling
  • 107. 107 Linux Kernel Networking Stack Packet Receiving Packet Sending Packet Forwarding Packet Filtering Packet Mangling Routing NAT TCP HSR UDP AMT Packet Tunneling
  • 108. 108 Network Protocols Packet Receiving Packet Forwarding Packet Sending Packet Filtering Routing NAT Packet Mangling TCP HSR UDP AMT Packet Tunneling
  • 109. 109 Network Protocols Packet Receiving Packet Forwarding Packet Sending Packet Filtering Routing NAT Packet Mangling TCP HSR UDP AMT Packet Tunneling
  • 110. 110 HSR Ring Topology의 구성을 통해 중복된 패킷을 전송하여 데이터 손실 없이 통신이 되도록 하는 네트워크 프로토콜 High Availability Seamless Redundancy
  • 111. 111 Node 1 Node 2 Critical Applications - Fully Operational 24/7 - Require Zero-loss redundancy ex) Power Plant (발전소), Transportation (교통) Basic Network Packet Transfer
  • 112. 112 Node 1 Node 2 Critical Applications - Fully Operational 24/7 - Require Zero-loss redundancy ex) Power Plant (발전소), Transportation (교통) Fail Basic Network Packet Transfer
  • 113. 113 A-frame HSR Tagged B-frame Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 High Availability Seamless Redundancy 출발지 목적지
  • 114. 114 HSR Ring Topology A-frame HSR Tagged B-frame Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A B B A B A B B A B A A High Availability Seamless Redundancy 출발지 목적지
  • 115. 115 HSR Ring Topology Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A-frame HSR Tagged B-frame A B B A B A B B A B A A Packet 📦 📦 B-tagged Packet A-tagged Packet High Availability Seamless Redundancy 출발지 목적지
  • 116. 116 HSR Ring Topology Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A-frame HSR Tagged B-frame A B B A B A B B A B A A Packet 📦 📦 B-tagged Packet A-tagged Packet High Availability Seamless Redundancy 출발지 목적지
  • 117. 117 HSR Ring Topology Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A-frame HSR Tagged B-frame A B B A B A B B A B A A Packet 📦 📦 B-tagged Packet A-tagged Packet High Availability Seamless Redundancy 출발지 목적지
  • 118. 118 HSR Ring Topology Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A-frame HSR Tagged B-frame A B B A B A B B A B A A Packet 📦 B-tagged Packet 📦 A-tagged Packet High Availability Seamless Redundancy 출발지 목적지
  • 119. 119 HSR Ring Topology Node 1 Node 2 Node 3 Node 6 Node 5 Node 4 A-frame HSR Tagged B-frame A B B A B A B B A B A A Packet 📦 B-tagged Packet 📦 A-tagged Packet High Availability Seamless Redundancy 출발지 목적지
  • 120. 120 Network Protocols Packet Receiving Packet Forwarding Packet Sending Packet Filtering Routing NAT Packet Mangling TCP HSR UDP AMT Packet Tunneling
  • 121. 121 Linux Kernel Networking Stack Packet Receiving Packet Sending Packet Forwarding Packet Filtering Packet Mangling Routing NAT TCP HSR UDP AMT Packet Tunneling
  • 122. 122 지금부터 리눅스 커널 컨트리뷰션을 위해 리눅스 커널 생태계를 알아봅시다.
  • 124. Linux Kernel 124 Linux Kernel은 Linux 운영 체제(OS)의 핵심 구성 요소 컴퓨터 하드웨어와 프로세스를 연결하는 핵심 인터페이스 Linux Kernel 마스코트 Tux
  • 125. Linux Kernel 개발 125 전 세계 개발자들이 참여하는 최대 규모의 오픈소스 프로젝트 https://www.semanticscholar.org/paper/Perpetual-development%3A-A-model-of-the-Linux-kernel- Feitelson/eb7cf446e983e98c1400c8181949f038caf0c8a8/figure/1 개발은 패치(Patch)라는 단위로 이루어짐
  • 126. 커널 release 126 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … v5.16-rc7 Stable (v5.16) Stable (v5.15) LTS Release 10-11주(약 2개월) 마다 신규 커널 버전이 출시가 되고, stable 커널은 주 1회마다 출시 1. Mainline Kernel 2. Release Candidate (RC) 3. Stable 4. Long-term
  • 127. 커널 release 종류 127 1. Mainline Kernel - 9~10주 주기로 릴리즈되는 커널 - 새로운 기능들이 소개되고 주요 버그 fix 패치가 합쳐져 출시 v5.15 v5.16 Mainline Kernel Release Mainline Kernel Release
  • 128. 커널 release 종류 128 2. Release Candidate (RC) - Mainline kernel의 pre-release라고도 부름 - 신규 기능을 테스트하는 커널 버전 - 이 release는 반드시 소스코드를 컴파일해서 사용해야 함 - 주로 rc7까지 진행된 뒤 Mainline Release 진행 v5.15 v5.16 Release Candidate Commit v5.16-rc1 v5.16-rc2 … v5.16-rc7
  • 129. 커널 release 종류 129 3. Stable - Bug fix만 진행되는 kernel release 버전 (mainline kernel backporting) - mainline Kernel이 release 된 이후에 stable mode로 전환 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … v5.16-rc7 Stable (v5.15) Stable (v5.16)
  • 130. 커널 release 종류 130 4. Long-term - stable release 버전 중 critical한 bug fix를 제공하는 kernel release 버전 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … v5.16-rc7 Stable (v5.16) Stable (v5.15) LTS Release LTS Release
  • 131. Linux Kernel Release Cycle 131 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15
  • 132. Linux Kernel Release Cycle 132 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 Stable (v5.15)
  • 133. Linux Kernel Release Cycle 133 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 Stable (v5.15) LTS Release
  • 134. Linux Kernel Release Cycle 134 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 Stable (v5.15) LTS Release
  • 135. Linux Kernel Release Cycle 135 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 Stable (v5.15) LTS Release
  • 136. Linux Kernel Release Cycle 136 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 Stable (v5.15) LTS Release
  • 137. Linux Kernel Release Cycle 137 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) LTS Release v5.16-rc6 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release
  • 138. Linux Kernel Release Cycle 138 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7
  • 139. Linux Kernel Release Cycle 139 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7 Merge window
  • 140. Linux Kernel Release Cycle 140 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) v5.16-rc6 v5.16-rc7 Merge window http://vger.kernel.org/~davem/net-next.html
  • 141. Linux Kernel Release Cycle 141 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7 Merge window * Merge window - 2주 정도 merge window 기간을 가지며, 이 merge window 기간 동안 리눅스 토발즈가 subsystem의 maintainer에게서 코드를 pull을 받아서 합치는 작업 진행 - 이 기간이 끝나면 새로운 버전 커널 release가 된 후, 2주 주기로 <mainline kernel version 명>-rc-<rc version 명>이라는 이름으로 커널 개발이 진행된다.
  • 142. Linux Kernel Release Cycle 142 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7 Merge window
  • 143. Linux Kernel Release Cycle 143 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.16) Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7 Merge window
  • 144. Linux Kernel Release Cycle 144 5.15 mainline kernel version release -> 5.16-rc1 -> 5.16-rc2 -> … -> 5.16-rc7 -> merge window -> 5.16 mainline kernel version release v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.16) Stable (v5.15) LTS Release v5.16-rc6 v5.16-rc7 Merge window LTS Release
  • 145. Linux Kernel Release Cycle 145 v5.15 v5.16 v5.16-rc1 v5.16-rc2 … Stable (v5.16) Stable (v5.15) v5.16-rc6 v5.16-rc7 Merge window http://vger.kernel.org/~davem/net-next.html
  • 146. Linux Kernel Subsystem 146 커널 내부에는 수많은 서브시스템이 있고, http://www.MakeLinux.net/kernel/diagram
  • 147. Linux Kernel Subsystem 147 커널 내부에는 수많은 서브시스템이 있고, 서브시스템별 개발된 기능들이 합쳐져 메인라인 커널로 출시 http://www.MakeLinux.net/kernel/diagram
  • 148. Linux Kernel Subsystem 148 Linux Kernel v5.17 git git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux $ tree -d -L 1 . ├── arch ├── block ├── certs ├── crypto ├── Documentation ├── drivers ├── fs ├── include ├── init ├── ipc ├── kernel ├── lib ├── LICENSES ├── mm ├── net ├── samples ├── scripts ├── security ├── sound ├── tools ├── usr └── virt
  • 149. Linux Kernel Subsystem 149 linux $ tree -d -L 1 . ├── arch ├── block => 블록 디바이스 서브시스템 ├── certs ├── crypto ├── Documentation ├── drivers => 드라이버 서브시스템 ├── fs => 파일 시스템 서브시스템 ├── include ├── init ├── ipc => IPC 서브시스템 ├── kernel ├── lib ├── LICENSES ├── mm => 메모리 관리 서브시스템 ├── net => 네트워크 서브시스템 ├── samples ├── scripts ├── security ├── sound ├── tools ├── usr └── virt Linux Kernel v5.17 git git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  • 150. Kernel Tree 150 https://git.kernel.org/ 커널 코드는 몇몇 주요 subsystem git repository로 관리되는데 이걸 Kernel Tree라고 함
  • 151. Kernel Tree 151 커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데 이걸 tree라고 함 Mainline Kernel tree - Linus Torvalds가 관리 - Mainline kernel tree와 RC release 소스 코드가 관리 * https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18
  • 152. Kernel Tree 152 * https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18 커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데 이걸 tree라고 함 Mainline Kernel tree - Linus Torvalds가 관리 - Mainline kernel tree와 RC release 소스 코드가 관리 Stable Kernel tree - Greg Kroah-Hartman가 관리 - stable release branches 소스 코드가 관리
  • 153. Kernel Tree 153 커널 코드는 몇몇 주요 subsystem/release를 git repository에서 관리되는데 이걸 tree라고 함 Mainline Kernel tree - Linus Torvalds가 관리 - Mainline kernel tree와 RC release 소스 코드가 관리 Stable Kernel tree - Greg Kroah-Hartman가 관리 - stable release branches 소스 코드가 관리 linux-next tree - Stephen Rothwell가 관리. - Subsystem의 변경 사항을 주기적으로 반영하고, 해당 코드의 통합 테스팅이 진행되는 곳 - 테스팅이 진행된 이후 mainline kernel tree로 pull request가 진행 * https://www.devcurmudgeon.com/images/mainline-lts-ltsi-genivi-20131025.pdf#page=18
  • 154. Linux Kernel Tree Hierarchy 154 Developer Developer net-next Developer Developer driver-core Developer Developer cgroup linux 주요 서브시스템은 독립된 tree를 가짐
  • 155. Linux Kernel Tree Hierarchy 155 Developer Developer Maintainer Developer Developer Maintainer Developer Developer Maintainer Torvalds 서브시스템 별 해당 tree를 관리하는 maintainer가 존재 netdev/net-next.git torvalds/linux.git gregkh/driver-core.git tj/cgroup.git
  • 156. Subsystem Maintainers 156 Developer Developer Maintainer Developer Developer Maintainer Developer Developer Maintainer Torvalds netdev/net.git 기존 release 버전의 버그 fix patch만 허용 git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git stable/linux.git netdev/net.git : stable 버전 tree
  • 158. Subsystem Maintainers - MAINTAINERS 파일 158 $ cat MAINTAINERS | grep -A 30 'NETWORKING [GENERAL]' NETWORKING [GENERAL] M: "David S. Miller" <davem@davemloft.net> M: Eric Dumazet <edumazet@google.com> M: Jakub Kicinski <kuba@kernel.org> M: Paolo Abeni <pabeni@redhat.com> L: netdev@vger.kernel.org S: Maintained Q: https://patchwork.kernel.org/project/netdevbpf/list/ B: mailto:netdev@vger.kernel.org T: git git://git.kernel.org/.../netdev/net.git T: git git://git.kernel.org/.../netdev/net-next.git F: Documentation/networking/ F: Documentation/process/maintainer-netdev.rst F: include/linux/in.h F: include/linux/net.h F: include/linux/netdevice.h F: include/net/ F: include/uapi/linux/in.h F: include/uapi/linux/net.h F: include/uapi/linux/net_namespace.h F: include/uapi/linux/netdevice.h F: lib/net_utils.c F: lib/random32.c F: net/ F: tools/testing/selftests/net/ Developer Developer Maintainer Developer Developer Maintainer Developer Developer Maintainer Torvalds netdev/net.git
  • 159. Mailing List 159 각 서브시스템별로 mailing list를 가지며 컨트리뷰터들의 패치나 discussion이 이루어진다. $ cat MAINTAINERS | grep -A 30 'NETWORKING [GENERAL]' NETWORKING [GENERAL] M: "David S. Miller" <davem@davemloft.net> M: Eric Dumazet <edumazet@google.com> M: Jakub Kicinski <kuba@kernel.org> M: Paolo Abeni <pabeni@redhat.com> L: netdev@vger.kernel.org S: Maintained http://vger.kernel.org/vger-lists.html
  • 160. Mailing List 160 Developer L: netdev 📧 📜 [PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> 컨트리뷰터가 패치 전송
  • 161. Mailing List 161 Developer L: netdev patch 📧 📜 Mailing List에서 Review 와 Discussion 발생 [PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
  • 162. Mailing List 162 Developer L: netdev patch 📧 📜 패치가 accepted 되면 서브시스템에 반영되었다는 메일이 전송됨 [PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Maintainer 📧 Re: [PATCH net-next] mlxsw: spectrum: use netif_is_macsec() instead of open ode Hello: This series was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>:
  • 165. Subsystem Maintainers 165 Developer Developer Maintainer Developer Developer Maintainer Developer Developer Maintainer Torvalds netdev/net-next.git 다양한 서브시스템에서도 상위 tree로 Pull Request 전송 📧 📜 📜 📜 📧 📜 📜 📜 gregkh/driver-core.git tj/cgroup.git torvalds/linux.git
  • 168. Patch 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 168
  • 169. Patch 169 $ git format-patch -1 --subject-prefix="PATCH, net-next" 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 📜
  • 170. Patch 170 From 0199215216978b612d4e8be11e878b87bc643033 Mon Sep 17 00:00:00 2001 From: Juhee Kang <claudiajkang@gmail.com> Date: Sun, 10 Oct 2021 13:03:29 +0900 Subject: [PATCH, net-next] mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 $ git format-patch -1 --subject-prefix="PATCH, net-next" 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 📜
  • 171. Patch 171 $ git format-patch -1 --subject-prefix="PATCH, net-next" 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 $ git send-patch --cc “Network Maintainer <example@email.com>“ --to “Network Mailing List <list@email.com>” *.patch 📧 📜
  • 172. Patch 172 $ git format-patch -1 --subject-prefix="PATCH, net-next" 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 📧 📧 📜 $ git send-patch --cc “Network Maintainer <example@email.com>“ --to “Network Mailing List <list@email.com>” *.patch 📜
  • 173. Patch 173 $ git format-patch -1 --subject-prefix="PATCH, net-next" 리눅스 커널의 기여 단위 개발자들은 개발 내용을 patch로 만들어서 이메일로 메일링 리스트에 제출 📧 📧 📜 $ git send-patch --cc “Network Maintainer <example@email.com>“ --to “Network Mailing List <list@email.com>” *.patch 📜
  • 174. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 Commit ID 174 commit을 중복 없이 기억하기 위해 SHA1 알고리즘으로 만들어진 hash 값을 사용
  • 175. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 Commit ID 175 Author Author Date 패치를 작성한 사람의 정보 ex) 작성자 이름 <작성자 메일 정보> 작성자가 해당 커밋을 작성한 시간
  • 176. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 Commit ID 176 Author Author Date Commit Commit Date 리눅스 커널에서 committer은 해당 패치를 git 저장소에 반영한 사람을 의미 ex) Maintainer 혹은 Reviewer 해당 커밋이 반영된 시간
  • 177. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 Commit ID 177 Author Author Date Commit Commit Date Commit Description 해당 커밋에 대한 간략한 설명 다음과 같은 형식으로 작성 ex) 모듈 이름: 세부 모듈: 커밋 설명 해당 커밋에 대한 상세한 설명을 작성 Commit Header
  • 178. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 Commit ID 178 Author Author Date Commit Commit Date Commit Header Commit Description Commit Tag Signed-off-by: 작성자는 라이센싱 정책에 대해 이해했고 커밋을 오픈소스 패치로 제출하는 것에 동의 ex) Signed-off-by: 이름 <메일>
  • 179. Patch 구성 179 1) Signed-off-by 라이센싱 정책에 대해 이해했고, 커밋을 오픈소스 패치로 제출하는 것에 동의 2) Acked-by 메인테이너가 해당 패치를 확인하였고, 개발자가 작성한 패치를 반영하기로 결정 3) Reviewed-by 해당 패치의 코드에 대해 Reviewer 혹은 다른 개발자가 리뷰하였음 4) Tested-by 해당 패치의 변경사항에 대해 Reviewer 혹은 다른 개발자가 테스트하였음 5) Reported-by / Suggested-by 해당 버그를 발견하거나 기능을 제안한 사람을 명시하기 위해 남기는 태그 6) Fixes 해당 패치가 어떤 커밋에서 발생한 버그를 해결하는지를 추적하기 위한 태그 mlxsw: spectrum: use netif_is_macsec() instead of open code === Commit Body === Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Commit Tag Detail samples: bpf: Fix tracex7 error raised on the missing argument === Commit Body === Acked-by: Yonghong Song <yhs@fb.com> amt: Use BIT macros instead of open codes === Commit Body === Reviewed-by: Taehee Yoo <ap420073@gmail.com> Tested-by: Taehee Yoo <ap420073@gmail.com> net: hsr: fix hsr build error when lockdep is not enabled === Commit Body === Reported-by: Eric Dumazet <eric.dumazet@gmail.com> bpf_glue: include errno.h === Commit Body === Fixes: ac4e0913beb1 (“bpf: Export bpf syscall wrapper”)
  • 180. Patch 구성 commit 0199215216978b612d4e8be11e878b87bc643033 Author: Juhee Kang <claudiajkang@gmail.com> AuthorDate: Sun Oct 10 13:03:29 2021 +0900 Commit: David S. Miller <davem@davemloft.net> CommitDate: Sun Oct 10 11:18:48 2021 +0100 mlxsw: spectrum: use netif_is_macsec() instead of open code Open code which is dev->priv_flags & IFF_MACSEC has already defined as netif_is_macsec(). So use netif_is_macsec() instead of open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15f4a658e436..0723c1314ea2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5237,7 +5237,7 @@ static inline void netif_keep_dst(struct net_device *dev) static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev); } extern struct pernet_operations __net_initdata loopback_net_ops; -- 2.34.1 diff 결과 (스냅샷 정보) Commit Header Commit ID Author Author Date 180 Commit Commit Date Commit Description Commit Tag 해당 커밋에 포함된 diff 결과 - 수정이 발생한 파일 목록 include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - 세부 수정사항 static inline bool netif_reduces_vlan_mtu(struct net_device *dev) { /* TODO: reserve and use an additional IFF bit, if we get more users */ - return dev->priv_flags & IFF_MACSEC; + return netif_is_macsec(dev);
  • 181. 181 리눅스 Kernel에 이제 실제로 Contribution 해볼까요?
  • 183. ① 문서 기여 ② 버그 수정 ③ 기능 개선 컨트리뷰션 방법 183
  • 184. 1. 문서 기여 신규 문서 추가 184 기존 문서 수정
  • 185. 2. 버그 수정 버그가 잘 동작하도록 수정 후 패치 전송 185
  • 186. 3. 기능 개선 신규 기능 추가 186
  • 187. 3. 기능 개선 기존 기능 강화 187
  • 189. 189 버그를 수정하는 패치를 진행한다고 가정
  • 190. 문제 발견 190 커널의 테스트 스크립트 실행 도중 에러 발생 $ cd samples/bpf $ make -j $ ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")")
  • 191. 커널 개발 환경 구성 - 리눅스 환경 설정 191 Fedora Debian OpenSUSE Ubuntu 가상 환경에 리눅스 설치
  • 192. 커널 개발 환경 구성 - 리눅스 환경 설정 192 가상 환경 리눅스에 개발 관련 패키지 설치 # apt-get install build-essential vim git cscope libncurses-dev libssl-dev bison flex bison # systemctl enable serial-getty@ttyS0.service # systemctl start serial-getty@ttyS0.service # systemctl daemon-reload # vim /etc/default/grub # update-grub2
  • 193. 커널 개발 환경 구성 - 리눅스 환경 설정 193 가상 환경 리눅스에 개발 관련 패키지 설치 및 디버깅을 위한 환경 구축 # apt-get install build-essential vim git cscope libncurses-dev libssl-dev bison flex bison # systemctl enable serial-getty@ttyS0.service # systemctl start serial-getty@ttyS0.service # systemctl daemon-reload # vim /etc/default/grub # update-grub2
  • 194. 커널 개발 환경 구성 - 커널 개발 소스 코드 다운 194 $ git clone https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
  • 195. 문제 재현 및 원인 판단 195 $ cd samples/bpf $ make -j $ ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") 커널의 테스트 스크립트 실행 도중 에러 발생
  • 196. 문제 재현 및 원인 판단 196 커널의 테스트 스크립트 실행 도중 에러 발생 $ cd samples/bpf $ make -j $ ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") # vim tracex7_user.c 프로그램 실행 시 인자를 확인하지 않아 발생한 문제
  • 197. 버그 해결을 위해 소스코드 수정 197 diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh index e68b9ee6814b8b..35db26f736b9d9 100755 --- a/samples/bpf/test_override_return.sh +++ b/samples/bpf/test_override_return.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -r tmpmnt rm -f testfile.img dd if=/dev/zero of=testfile.img bs=1M seek=1000 count=1 DEVICE=$(losetup --show -f testfile.img) diff --git a/samples/bpf/tracex7_user.c b/samples/bpf/tracex7_user.c index fdcd6580dd736a..8be7ce18d3ba05 100644 --- a/samples/bpf/tracex7_user.c +++ b/samples/bpf/tracex7_user.c @@ -14,6 +14,11 @@ int main(int argc, char **argv) int ret = 0; FILE *f; + if (!argv[1]) { + fprintf(stderr, "ERROR: Run with the btrfs device argument!n"); + return 0; + } + snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); obj = bpf_object__open_file(filename, NULL); if (libbpf_get_error(obj)) { $ git diff
  • 198. 커밋 메시지 작성 198 소스 코드 수정 후, 커밋 메시지 작성 후 커밋 진행 $ git commit -s
  • 199. 커밋 메시지 작성 199 커밋 메시지 작성이 어렵다면? $ git log -- <내가 수정한 파일 이름 filename>
  • 200. 커밋 메시지 작성 200 커밋 메시지 작성이 어렵다면? $ git log -- samples/bpf/tracex7_user.c <해당 파일의 이전 커밋 확인> commit 2bf3e2ef425bc2a164f10b554b7db6a8b4090ef4 Author: Jakub Kicinski <kuba@kernel.org> Date: Mon May 14 22:35:02 2018 -0700 samples: bpf: include bpf/bpf.h instead of local libbpf.h There are two files in the tree called libbpf.h which is becoming problematic. Most samples don't actually need the local libbpf.h they simply include it to get to bpf/bpf.h. Include bpf/bpf.h directly instead. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> commit 965de87e54b803223bff703ea6b2a76c056695ae Author: Josef Bacik <jbacik@fb.com> Date: Mon Dec 11 11:36:49 2017 -0500 samples/bpf: add a test for bpf_override_return
  • 201. 커밋 메시지 작성 201 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
  • 202. 커밋 메시지 작성 202 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> 커밋 헤더는 가능하다면 50자 이내
  • 203. 커밋 메시지 작성 203 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> 커밋 설명은 상세하게 한 줄에 72자 넘지 않도록
  • 204. 커밋 메시지 작성 204 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> 필요하다면, 발생한 문제의 상세한 설명을 위해 재현방법 서술
  • 205. 커밋 메시지 작성 205 samples: bpf: Fix tracex7 error raised on the missing argument The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Signed-off-by 태그 작성
  • 206. 커널 개발 환경 구성 - Patch 메일 전송을 위한 환경 구축 206 git-email 패키지를 통해 작성된 patch를 쉽게 메일로 전송 가능 # apt-get install git-email $ git config --global sendemail.smtpencryption tls $ git config --global sendemail.smtpserver <mailserver> $ git config --global sendemail.smtpuser <email> $ git config --global sendemail.smtpserverport 587 $ git config --global sendemail.smtppass <password> git config을 이용해 smtp 계정 설정 ex) gmail smtp 설정
  • 207. 패치 메일 작성 준비 및 컨벤션 테스트 207 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 208. 패치 메일 작성 준비 및 컨벤션 테스트 208 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ <커밋 개수> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 209. 패치 메일 작성 준비 및 컨벤션 테스트 209 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ <커밋 개수> <커널 tree에 따른 메일 prefix 추가> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 210. 패치 메일 작성 준비 및 컨벤션 테스트 210 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ 0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch <커밋 개수> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission. <커널 tree에 따른 메일 prefix 추가>
  • 211. 패치 메일 작성 준비 및 컨벤션 테스트 211 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ 0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ apt-get install codespell python-ply python-git $ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 212. 패치 메일 작성 준비 및 컨벤션 테스트 212 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ 0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ apt-get install codespell python-ply python-git $ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 213. 패치 메일 작성 준비 및 컨벤션 테스트 213 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ 0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ apt-get install codespell python-ply python-git $ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission.
  • 214. 패치 메일 작성 준비 및 컨벤션 테스트 214 $ git format-patch -1 --subject-prefix=“PATCH, bpf-next“ 0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ apt-get install codespell python-ply python-git $ ./scripts/checkpatch.pl --strict --codespell 0001-*.patch <인자로 패치 파일 전달> total: 0 errors, 0 warnings, 0 checks, 17 lines checked 0001-*.patch has no obvious style problems and is ready for submission. <컨벤션 문제 없음>
  • 215. 패치 메일 수신 대상 찾기 및 전송 215 $ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org $ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch Send this email? ([y]es|[n]o|[q]uit|[a]ll): [...] Result: OK 메인테이너와 메일링 리스트 찾기
  • 216. 패치 메일 수신 대상 찾기 및 전송 216 $ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org $ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch Send this email? ([y]es|[n]o|[q]uit|[a]ll): [...] Result: OK <인자로 패치 파일 전달> 메인테이너와 메일링 리스트 찾기
  • 217. 패치 메일 수신 대상 찾기 및 전송 217 $ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org $ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch Send this email? ([y]es|[n]o|[q]uit|[a]ll): [...] Result: OK 메인테이너와 메일링 리스트 찾기
  • 218. 패치 메일 수신 대상 찾기 및 전송 218 $ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats 0001-*.patch Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org $ git send-email --to=“maintainer mail” --to=“mailing list mail” 0001-*.patch Send this email? ([y]es|[n]o|[q]uit|[a]ll): Y [...] Result: OK 메일 전송하기
  • 219. 메일 전송되었는지 확인 219 Gmail을 통해서도 확인 가능
  • 221. 리뷰 확인 221 From: Andrii Nakryiko <andrii.nakryiko@gmail.com> To: Juhee Kang <claudiajkang@gmail.com> Cc: Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org>, Andrii Nakryiko <andrii@kernel.org>, Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org> Subject: Re: [bpf-next 1/2] samples: bpf: Fix tracex7 error raised on the missing argument On Sat, Jul 24, 2021 at 8:21 AM Juhee Kang <claudiajkang@gmail.com> wrote: [...] > diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh > index e68b9ee6814b..6480b55502c7 100755 > --- a/samples/bpf/test_override_return.sh > +++ b/samples/bpf/test_override_return.sh > @@ -1,5 +1,6 @@ > #!/bin/bash > > +rm -rf tmpmnt Do we need -rf or -r would do? [...] > -- > 2.27.0
  • 222. 리뷰 응답 222 From: Juhee Kang <claudiajkang@gmail.com> To: Andrii Nakryiko <andrii.nakryiko@gmail.com> Cc: Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org>, Andrii Nakryiko <andrii@kernel.org>, Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org> Subject: Re: [bpf-next 1/2] samples: bpf: Fix tracex7 error raised on the missing argument On Tue, Jul 27, 2021 at 5:08 AM Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote: > On Sat, Jul 24, 2021 at 8:21 AM Juhee Kang <claudiajkang@gmail.com> wrote: [...] > > diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh > > index e68b9ee6814b..6480b55502c7 100755 > > --- a/samples/bpf/test_override_return.sh > > +++ b/samples/bpf/test_override_return.sh > > @@ -1,5 +1,6 @@ > > #!/bin/bash > > > > +rm -rf tmpmnt > Do we need -rf or -r would do? It works properly using only -r. Thanks for pointing it out! I will stick to this method. I will send the next version as soon as possible. [...] > > 2.27.0
  • 223. 코드 수정 후 패치 메일 작성 준비 223 $ git format-patch -1 –v2 --subject-prefix=“PATCH, bpf-next“ v2-0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ ./scripts/checkpatch.pl --strict --codespell v2-0001-*.patch total: 0 errors, 0 warnings, 0 checks, 17 lines checked v2-0001-*.patch has no obvious style problems and is ready for submission. <두번째 버전의 패치임을 명시>
  • 224. 코드 수정 후 패치 메일 작성 준비 224 $ git format-patch -1 –v2 --subject-prefix=“PATCH, bpf-next“ v2-0001-samples-bpf-Fix-tracex7-error-raised-on-the-missing-.patch $ ./scripts/checkpatch.pl --strict --codespell v2-0001-*.patch total: 0 errors, 0 warnings, 0 checks, 17 lines checked v2-0001-*.patch has no obvious style problems and is ready for submission.
  • 225. 패치 메일 수신 대상 찾기 및 전송 225 $ ./scripts/get_maintainer.pl –-no-multiline -–no-rolestats v2-0001-*.patch Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, netdev@vger.kernel.org, bpf@vger.kernel.org $ git send-email --to=“maintainer mail” --to=“mailing list mail” v2-0001-*.patch Send this email? ([y]es|[n]o|[q]uit|[a]ll): Y [...] Result: OK 메일 전송하기
  • 226. 패치 accept 226 From: patchwork-bot+netdevbpf <patchwork-bot+netdevbpf@kernel.org> To: Juhee Kang <claudiajkang@gmail.com> Subject: Re: [bpf-next v2 1/2] samples: bpf: Fix tracex7 error raised on the missing argument Hello: This series was applied to bpf/bpf-next.git (refs/heads/master): On Tue, 27 Jul 2021 04:10:55 +0000 you wrote: > The current behavior of 'tracex7' doesn't consist with other bpf samples > tracex{1..6}. Other samples do not require any argument to run with, but > tracex7 should be run with btrfs device argument. (it should be executed > with test_override_return.sh) > [...] Here is the summary with links: - [bpf-next,v2,1/2] samples: bpf: Fix tracex7 error raised on the missing argument https://git.kernel.org/bpf/bpf-next/c/7d07006f0592 - [bpf-next,v2,2/2] samples: bpf: Add the omitted xdp samples to .gitignore https://git.kernel.org/bpf/bpf-next/c/05e9b4f60d31 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
  • 229. 229 여기까지가 간단한 리눅스 커널 커밋 과정이었습니다.
  • 230. 커널 패치를 진행해보고 싶으시다면? 커널 관련 컨트리뷰션 프로그램 참여 230
  • 231. 231 커널 패치를 위한 장벽 중 하나라도 극복이 되셨길!