0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7でDPDK20 SDKを試す ②DPDKドライバの制御

0
Last updated at Posted at 2021-01-04

はじめに

DPDK18 SDKではDPDKドライバもmakeしていたが、DPDK20ではLinux標準のドライバを使うのが標準みたい。DPDK18でmakeされるドライバ(igb_uio)は動作が安定していたが、Linux標準ドライバはどうなのかちょっと不安なところ。

igb_uioはカーネルが更新される度にmakeし直すが必要があったが、Linux標準のドライバではその手間がなくなるというメリットがある。

いろいろなドライバ名が出てくるので最初に整理しておくと。

ドライバ名 DPDK対応 Linux標準 備考
e1000e NO YES インテル1G NIC
ixgbe NO YES インテル10G NIC
igb_uio YES NO SDKでmake
uio_pci_generic YES YES
vfio-pci YES YES IOMMU対応

「ドライバ付け外し」コマンド dpdk-devbind を使ってみる

dpdk-devbindコマンドはよく使うので、以下のようにaliasでdbと短くして使っている。

alias db='/usr/local/bin/dpdk-devbind.py'

DPDKドライバ未登録状態で、dbコマンドを使ってみると以下のようになる。

# db -s

Network devices using kernel driver
===================================
0000:00:1f.6 'Ethernet Connection (2) I219-V 15b8' if=eno1 drv=e1000e unused= *Active*
0000:01:00.0 'Ethernet Controller 10G X550T 1563' if=enp1s0f0 drv=ixgbe unused=
0000:01:00.1 'Ethernet Controller 10G X550T 1563' if=enp1s0f1 drv=ixgbe unused=
(後略)

3つのNICポートにカーネル標準のドライバ(e1000eとixgbe)が割り当てられているのが分かる。ここでDPDK対応ドライバを登録して、再度同じコマンドを入れると、

# modprobe uio
# modprobe uio_pci_generic
# modprobe vfio-pci
# db -s

Network devices using kernel driver
===================================
0000:00:1f.6 'Ethernet Connection (2) I219-V 15b8' if=eno1 drv=e1000e unused=vfio-pci,uio_pci_generic *Active*
0000:01:00.0 'Ethernet Controller 10G X550T 1563' if=enp1s0f0 drv=ixgbe unused=vfio-pci,uio_pci_generic
0000:01:00.1 'Ethernet Controller 10G X550T 1563' if=enp1s0f1 drv=ixgbe unused=vfio-pci,uio_pci_generic
(後略)

3つのNICポートに「DKDK対応ドライバ」(vfio-pciとuio_pci_generic)が適用可能なことが表示されるようになった。注:まだ適用されてない。
X550Tの2つのNICポートをカーネル標準ドライバ(ixgbe)からDPDK対応用(uio_pci_generic)に付け替えてみる。

# db -b uio_pci_generic 0000:01:00.0
# db -b uio_pci_generic 0000:01:00.1
# db -s

Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'Ethernet Controller 10G X550T 1563' drv=uio_pci_generic unused=ixgbe,vfio-pci
0000:01:00.1 'Ethernet Controller 10G X550T 1563' drv=uio_pci_generic unused=ixgbe,vfio-pci

Network devices using kernel driver
===================================
0000:00:1f.6 'Ethernet Connection (2) I219-V 15b8' if=eno1 drv=e1000e unused=vfio-pci,uio_pci_generic *Active*
(後略)

nmcliコマンドで確認すると、以下のようにX550Tの2つのNICポートがカーネルから見えなくなっている。

# nmcli d
DEVICE       TYPE      STATE      CONNECTION
eno1         ethernet  connected  Wired connection 3
lo           loopback  unmanaged  --

X550Tの2つのNICポートをDPDK対応用(uio_pci_generic)からカーネル標準ドライバ(ixgbe)に戻してみる。

# db -b ixgbe 0000:01:00.0
# db -b ixgbe 0000:01:00.1
# nmcli d
DEVICE       TYPE      STATE         CONNECTION
eno1         ethernet  connected     Wired connection 3
enp1s0f0     ethernet  disconnected  --
enp1s0f1     ethernet  unavailable   --
lo           loopback  unmanaged     --

# db -s

Network devices using kernel driver
===================================
0000:00:1f.6 'Ethernet Connection (2) I219-V 15b8' if=eno1 drv=e1000e unused=vfio-pci,uio_pci_generic *Active*
0000:01:00.0 'Ethernet Controller 10G X550T 1563' if=enp1s0f0 drv=ixgbe unused=vfio-pci,uio_pci_generic
0000:01:00.1 'Ethernet Controller 10G X550T 1563' if=enp1s0f1 drv=ixgbe unused=vfio-pci,uio_pci_generic
(後略)

もとに戻った。

次回予告

次回はSR-IOVの設定をしてみたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?