#!/bin/bash
# smp_affinity.sh version 2.3(2023.03.15)
#
export LANG=C
shield_result=`shield -c`
mask=0
cpus=0
cpu_list=""
while read CPUID irqs ltmrs_procs_mem
do
if [ "$irqs" == "no" ]
then
if [ -z "$cpu_list" ]
then
cpu_list="$cpus"
else
cpu_list="$cpu_list,$cpus"
fi
cpus=`expr $cpus + 1`
id=`echo "2 ^ $CPUID" | bc`
mask=`echo "$mask + $id"|bc`
fi
if [ "$irqs" == "yes" ]
then
cpus=`expr $cpus + 1`
fi
done << EOI
${shield_result}
EOI
#
set_affinity=`echo "ibase=10;obase=16;$mask"|bc`
#
len=${#set_affinity}
if [ $len -gt 8 ]
then
low=`echo ${set_affinity:$len-8}`
hi=`echo ${set_affinity::$len-8}`
set_affinity="$hi $low"
fi
#
#
if [ "$1" == "-d" ]
then
CPUS=`echo $cpu_list| perl -pe 's/\b(\d+)(?{$q=$1+1})(?:,(??{$q})\b(?{$p=$q++})){2,}/$1-$p/g'`
echo -e "IRQ_ASSIGN=\"$CPUS:rcim;\""
cat /proc/interrupts |grep megasas |while read IRQNO Other
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo -e "IRQ_ASSIGN+=\"$CPUS:$IRQNO;\""
fi
done
lsirq|grep -e "Network" -e "Ethernet" |while read IRQNO Bus Vendor Comment
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo -e "IRQ_ASSIGN+=\"$CPUS:$IRQNO;\""
fi
done
exit 0;
fi
if [ "$1" == "-s" ]
then
echo "cpus=$cpus"
echo "set_affinity=$set_affinity"
cat /proc/interrupts |grep megasas |while read IRQNO Other
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo "echo $set_affinity > /proc/irq/$IRQNO/smp_affinity"
echo "$set_affinity" > /proc/irq/$IRQNO/smp_affinity
fi
done
lsirq|grep -e "Network" -e "Ethernet" |while read IRQNO Bus Vendor Comment
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo "echo $set_affinity > /proc/irq/$IRQNO/smp_affinity"
echo "$set_affinity" > /proc/irq/$IRQNO/smp_affinity
fi
done
for name in `ls /proc/irq/*/*-TxRx-* 2> /dev/null | cut -d: -f1`
do
IRQNO=`echo $name|cut -d / -f 4`
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo "echo $set_affinity > /proc/irq/$IRQNO/smp_affinity"
echo "$set_affinity" > /proc/irq/$IRQNO/smp_affinity
fi
done
exit 0;
fi
if [ "$1" == "-r" ]
then
echo "cpus=$cpus"
list=`cat /proc/interrupts |grep CPU|sed s/CPU//g`
if [ -n "$list" ]
then
cpu=0
cpus=0
for CPUID in $list
do
cpu=`echo "2 ^ $CPUID" | bc`
cpus=`expr $cpus + $cpu`
done
reset_affinity=`echo "ibase=10;obase=16;$cpus"|bc`
fi
#
len=${#reset_affinity}
if [ $len -gt 8 ]
then
low=`echo ${reset_affinity:$len-8}`
hi=`echo ${reset_affinity::$len-8}`
reset_affinity="$hi $low"
fi
#
echo "reset_affinity=$reset_affinity"
cat /proc/interrupts |grep megasas |while read IRQNO Other
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo "echo $reset_affinity > /proc/irq/$IRQNO/smp_affinity"
echo "$reset_affinity" > /proc/irq/$IRQNO/smp_affinity
fi
done
lsirq|grep -e "Network" -e "Ethernet" |while read IRQNO Bus Vendor Comment
do
if [ -f /proc/irq/$IRQNO/smp_affinity ]
then
echo "echo $reset_affinity > /proc/irq/$IRQNO/smp_affinity"
echo "$reset_affinity" > /proc/irq/$IRQNO/smp_affinity
fi
done
for name in `ls /proc/irq/*/*-TxRx-* 2> /dev/null| cut -d: -f1`
do
irq=`echo $name|cut -d / -f 4`
echo "echo $reset_affinity > /proc/irq/$irq/smp_affinity"
echo "$reset_affinity" > /proc/irq/$irq/smp_affinity
done
exit 0;
fi
echo
echo "$0 [-s -r -d]"
echo "-s:set affinity for IRQ"
echo "ex:"
echo " # shield -r -a 1-3"
echo " # $0 -s"
echo ""
echo "-r:reset affinity for IRQ"
echo "ex:"
echo " # $0 -r"
echo " # shield -r"
echo ""
echo
echo "-d:set affinity for shield.service configuration file (/etc/sysconfig/shield)"
echo "ex:"
echo " # shield -r -a 1-3"
echo " # $0 -d"
echo ""
exit 0;
# tar cvfz network-script.tar.gz /etc/sysconfig/network-script/
# rm -f /etc/sysconfig/network-script/*
2. ネットワーク命名ルールを構築する。
# sh build_rules.sh
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="a0:bb:cc:dd:ee:ff", NAME="em1"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="a1:bb:cc:dd:ee:ff", NAME="em2"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="a2:bb:cc:dd:ee:ff", NAME="em3"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="a3:bb:cc:dd:ee:ff", NAME="em4"
上記ATTR{address}==""に示される値は、インターネットのMACアドレスです。
# sh build_rules.sh eth
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="e100", ATTR{address}=="a0:bb:cc:dd:ee:ff", NAME="eth0"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="e1000", ATTR{address}=="a1:bb:cc:dd:ee:ff", NAME="eth1"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="e1000e", ATTR{address}=="a2:bb:cc:dd:ee:ff", NAME="eth2"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="igb", ATTR{address}=="a3:bb:cc:dd:ee:ff", NAME="eth3"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="ixgb", ATTR{address}=="a4:bb:cc:dd:ee:ff", NAME="eth4"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="ixgbe", ATTR{address}=="a5:bb:cc:dd:ee:ff", NAME="eth5"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="i40e", ATTR{address}=="a6:bb:cc:dd:ee:ff", NAME="eth6"
# mkdir /etc/systemd/network
# vi /etc/systemd/network/10-eth0.link
[Match]
MACAddress=a0:bb:cc:dd:ee:ff
[Link]
Alias=eth0
3. initramfsを再構築する。(再構築しない場合には、設定が反映されない。)
# dracut -f --include /etc/udev/rules.d/70-persistent-intel.rules
4. 再起動後、下記コマンドで、デバイス名称とMACアドレスの対応が正しいか確認する。
# ip addr show
5. 上記の手順でも動作しない場合
# dracut -f --omit-drivers "e100 e1000 e1000e igb ixgb ixgbe i40e i40eiw tg3"
70-persistent-intel.rulesを利用している場合
# dracut -f --include /etc/udev/rules.d/70-persistent-intel.rules
5.2 以下の内容で /etc/modprobe.d/intel.conf を作成し、ドライバモジュールのロード順を定義する。
#
# intel driver load sequence "tg3 e100 e1000 e1000e igb ixgb ixgbe i40e"
#
softdep tg3 post: e100 e1000 e1000e igb ixgb ixgbe i40e
softdep e100 post: e1000 e1000e igb ixgb ixgbe i40e
softdep e1000 pre: e100 post: e1000e igb ixgb ixgbe i40e
softdep e1000e pre: e100 e1000 post: igb ixgb ixgbe i40e
softdep igb pre: e100 e1000 e1000e post: ixgb ixgbe i40e
softdep ixgb pre: e100 e1000 e1000e igb post: ixgbe i40e
softdep ixgbe pre: e100 e1000 e1000e igb ixgb post: i40e
softdep i40e pre: e100 e1000 e1000e igb ixgb ixgbe
5.3 initramfsを再構築する。(再構築しない場合には、設定が反映されない。)
# dracut -f --omit-drivers "e100 e1000 e1000e igb ixgb ixgbe i40e i40eiw tg3"
70-persistent-intel.rulesを利用している場合
# dracut -f --include /etc/udev/rules.d/70-persistent-intel.rules
注:initramfsと設定環境に差分があると、いくつかの副作用が発生します。
RedHawk Version | 6.0 | 6.3 | 6.5 | 7.0 | 7.2 |
---|---|---|---|---|---|
RedHawk Kernel Version | 2.6.36 | 3.5.7 | 3.10.65 | 3.16.3 | 4.1.15 |
e1000 | 7.3.21 |
7.3.21 |
7.3.21 |
7.3.21 |
7.3.21 |
e1000e | 1.2.7 |
2.0.0 |
2.3.2 |
2.3.2 |
2.3.2 |
igb | 2.1.0 |
3.4.7 |
5.0.3 |
5.0.5 |
5.2.15 |
igbvf | 1.0.0 |
2.0.1 |
2.0.2 |
2.0.2 |
2.0.2 |
ixgbe | 2.0.84 |
3.9.15 |
3.13.10 |
3.19.1 |
4.0.1 |
ixgbevf | 1.0.0 |
2.6.0 |
2.7.12 |
2.12.1 |
2.12.1 |
i40e | Not supported |
Not supported |
Not supported |
0.4.10 |
1.3.2 |
i40evf | Not supported |
Not supported |
Not supported |
0.9.34 |
1.2.25 |
# cd /usr/src/linux-2.6.36.4RedHawk6.0.2
# ./ccur-config -n -c
3. ドライバーを解凍し、rpmファイルを作成する
# rpmbuild -tb igb-5.3.5.4.tar.gz
4./root/rpmbuild/RPMS/アーキテクチャ/ 下にインストール可能なドライバモジュールを含んだRPMファイルが生成させるので、それをコピーし、インストールする。
# mv /root/rpmbuild/RPMS/x86_64/igb-5.3.5.4-1.x86_64.rpm .
# rpm -ivh igb-5.3.5.4-1.x86_64.rpm
詳細はダウンロードファイルに含まれるREADMEファイルをご参照ください
# dracut --add-drivers "e1000e" -f /boot/initramfs-`uname -r`.img `uname -r`
静的なイメージの場合には、RedHawkのソースコードツリーに新しいデバイスドライバのソースコードをマージさせる必要があります。アドオンボード | なし | なし | あり | あり |
---|---|---|---|---|
BIOS設定 | PXE OPROM [Disable] | PXE OPROM [Enebled] | PXE OPROM [Disable] | PXE OPROM [Enebled] |
起動時表示 | なし | Initializaing Intel(R) Boot Agent GE v1.3.95 PXE 2.1 Build 091 (WfM 2.0) | Initializaing Intel(R) Boot Agent GE v1.3.51 PXE 2.1 Build 089 (WfM 2.0) | Initializaing Intel(R) Boot Agent GE v1.3.95 PXE 2.1 Build 091 (WfM 2.0) |
動作 | OK | OK | NG | OK |
PREBOOT/
index.htm - ホームページのユーザーガイド
licesnse.pdf - ソフトウェアライセンス
license.txt - ライセンスの追加について
README.TXT - ソフトウェアバージョンリリースノート
relnotes.rtf - ウェブパックリリースノート
PREBOOT/APPS/BOOTAGNT/DOCS - ユーザーガイドファイル インテルブートエージェント
PREBOOT/APPS/BootUtil/ - インテルR Ethernet Flash Firmware Utilityファイル
../iv.txt - BootIMG.FLB のドライバーのバージョンとイメージ、
../bootimg.flb - - Prebootイメージファイル
../DOCS/bootutil.txt - インテルRイーサネット・フラッシュ・ファームウエアー・ユーティリティーREADME
../linux_x64/ - インテルRイーサネット・フラッシュ・ファームウエアー・ユーティリティ
../linux32/ - インテルRイーサネット・フラッシュ・ファームウエアー・ユーティリティ
# cd PREBOOT/APPS/BootUtil/Linux_x64
# chmod +x bootutil64e
を行い、実行可能にしてから使用する
# ./bootutil64e -NIC=1 -FD
# ./bootutil64e -NIC=1 -WOLD
-NIC=XX
Selects a specific network port in the system. If used without any executable option, it prints the iSCSI boot configuration of
the selected port, or saves it in the file when the -O option is used.
-FLASHDISABLE or -FD
Disables the capability to run flash firmware on the selected adapter.
-WOLDISABLE or -WOLD
Disables Wake On Lan (WOL) functionality on the selected port
なお、マニュアルは、
# ./bootutil64e -?
で表示される。
現在の状態を示す。以下ではPORT3のPXEがENABLEである。
# APPS/BootUtil/Linux_x64/bootutil64e -SHOWPXE -NIC=1
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
ERROR: Unsupported feature
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit YES PXE 1.3.51
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present
スロット番号(ただし16進)表示
# lspci |grep Ether
02:00.0 Ethernet controller: Intel Corporation Device 10fb (rev 01)
02:00.1 Ethernet controller: Intel Corporation Device 10fb (rev 01)
03:00.0 Ethernet controller: Intel Corporation Device 150e (rev 01)
03:00.1 Ethernet controller: Intel Corporation Device 150e (rev 01)
03:00.2 Ethernet controller: Intel Corporation Device 150e (rev 01)
03:00.3 Ethernet controller: Intel Corporation Device 150e (rev 01)
05:00.0 Ethernet controller: Intel Corporation Device 1533 (rev 03)
0a:00.0 Ethernet controller: Intel Corporation Device 1533 (rev 03)
82:00.0 Ethernet controller: Intel Corporation Device 10e6 (rev 01)
82:00.1 Ethernet controller: Intel Corporation Device 10e6 (rev 01)
PORT3のフラッシュをDISABLEに設定
# APPS/BootUtil/Linux_x64/bootutil64e -NIC=3 -FLASHDISABLE
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
Disabling boot ROM on port 3...Success
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit YES FLASH Disabled
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present
PORT3のWOL(Wake On Lan)をDISABLEに設定
# APPS/BootUtil/Linux_x64/bootutil64e -NIC=3 -WOLDISABLE
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
Disabling Wake On LAN for port 3...Success
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit NO FLASH Disabled
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present
PORT4のWOL(Wake On Lan)をDISABLEに設定
# APPS/BootUtil/Linux_x64/bootutil64e -NIC=4 -WOLDISABLE
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
Disabling Wake On LAN for port 4...Unsupported feature
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit NO FLASH Disabled
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present
PORT5のWOL(Wake On Lan)をDISABLEに設定
# APPS/BootUtil/Linux_x64/bootutil64e -NIC=5 -WOLDISABLE
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
Disabling Wake On LAN for port 5...Unsupported feature
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit NO FLASH Disabled
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present
PORT6のWOL(Wake On Lan)をDISABLEに設定
# APPS/BootUtil/Linux_x64/bootutil64e -NIC=6 -WOLDISABLE
Intel(R) Ethernet Flash Firmware Utility
BootUtil version 1.5.94.2
Copyright (C) 2003-2015 Intel Corporation
Disabling Wake On LAN for port 6...Unsupported feature
Port Network Address Location Series WOL Flash Firmware Version
==== =============== ======== ======= === ============================= =======
1 90E2BA987754 2:00.0 10GbE N/A FLASH Disabled
2 90E2BA987755 2:00.1 10GbE N/A FLASH Disabled
3 001B21B0BD1C 3:00.0 Gigabit NO FLASH Disabled
4 001B21B0BD1D 3:00.1 Gigabit N/A FLASH Disabled
5 001B21B0BD1E 3:00.2 Gigabit N/A FLASH Disabled
6 001B21B0BD1F 3:00.3 Gigabit N/A FLASH Disabled
7 008017AD03A0 5:00.0 Gigabit NO FLASH Not Present
8 008017AD039F 10:00.0 Gigabit NO FLASH Not Present
9 001B21A026CC 130:00.0 Gigabit YES FLASH Not Present
10 001B21A026CD 130:00.1 Gigabit N/A FLASH Not Present