将NetworkManager创建VF等操作切换为通过udev创建VF;并修改RPS设置操作
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
---
|
||||
- name: "set 90-9000NPBP01R01.rules"
|
||||
template:
|
||||
src: "{{ role_path }}/templates/90-9000NPBP01R01.rules.j2"
|
||||
dest: /usr/lib/udev/rules.d/90-9000NPBP01R01.rules
|
||||
mode: 0644
|
||||
tags: template
|
||||
|
||||
- name: "set enp1s0 up "
|
||||
template:
|
||||
src: "{{ role_path }}/templates/ifcfg-enp1s0.toml.j2"
|
||||
@@ -103,20 +110,6 @@
|
||||
mode: 0755
|
||||
tags: template
|
||||
|
||||
- name: "set setup.enp1s0.ips"
|
||||
template:
|
||||
src: "{{ role_path }}/templates/setup.enp1s0.ips.toml.j2"
|
||||
dest: /sbin/setup.enp1s0.ips
|
||||
mode: 0777
|
||||
tags: template
|
||||
|
||||
- name: "set setup.enp130s0.ips"
|
||||
template:
|
||||
src: "{{ role_path }}/templates/setup.enp130s0.ips.toml.j2"
|
||||
dest: /sbin/setup.enp130s0.ips
|
||||
mode: 0777
|
||||
tags: template
|
||||
|
||||
- name: "set setup.enp131s0f0.ips"
|
||||
template:
|
||||
src: "{{ role_path }}/templates/setup.enp131s0f0.ips.toml.j2"
|
||||
@@ -138,6 +131,13 @@
|
||||
mode: 0777
|
||||
tags: template
|
||||
|
||||
- name: "set enp130s2f1"
|
||||
template:
|
||||
src: "{{ role_path }}/templates/setup.enp130s2f1.ips.toml.j2"
|
||||
dest: /sbin/setup.enp130s2f1.ips
|
||||
mode: 0777
|
||||
tags: template
|
||||
|
||||
- name: "copy tsg_9140_system_init"
|
||||
copy:
|
||||
src: "{{ role_path }}/files/"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",ATTR{device/sriov_numvfs}="3"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",ATTR{device/sriov/0/trunk}="add 0,3813,3814"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 1 vlan 3813"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 2 vlan 3814"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 0 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 1 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 2 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 0 spoofchk off"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 0 mac 00:0e:c6:d6:72:c1"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/enp1s0",PROGRAM+="/usr/sbin/ip link set enp1s0 vf 1 mac fe:65:b7:03:50:bd"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",ATTR{device/sriov_numvfs}="4"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 0 vlan 4095"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 1 vlan 4095"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 2 vlan 3816"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 3 vlan 3817"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 0 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 1 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 2 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 3 trust on"
|
||||
ACTION=="add", SUBSYSTEM=="net",DEVPATH=="/devices/pci0000:80/0000:80:01.0/0000:82:00.0/net/enp130s0",PROGRAM+="/usr/sbin/ip link set enp130s0 vf 0 spoofchk off"
|
||||
|
||||
@@ -6,9 +6,8 @@ if [ "$STA" == "pre-up" ]
|
||||
then
|
||||
logger "$0 called for interface named $INF with $STA ..."
|
||||
case "$INF" in
|
||||
enp1s0) logger "Setting $STA $INF VF And Vlan ..."; /sbin/setup.enp1s0.ips $INF $STA;;
|
||||
enp130s0) logger "Setting $STA $INF VF And Vlan ..."; /sbin/setup.enp130s0.ips $INF $STA;;
|
||||
enp131s0f0) logger "Setting $STA $INF ipaddr ..."; /sbin/setup.enp131s0f0.ips $INF $STA;;
|
||||
enp130s2f1) logger "Setting $STA $INF RPS ..."; /sbin/setup.enp130s2f1.ips $INF $STA;;
|
||||
esac
|
||||
fi
|
||||
exit 0
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
INF="$1"
|
||||
STA="$2"
|
||||
|
||||
logger "$0 called for interface named $INF with $STA ..."
|
||||
|
||||
if [ "$INF" == "enp130s0" ]
|
||||
then
|
||||
logger "$0: Interface $INF with $STA ,Set $INF VF And Vlan ..."
|
||||
echo 4 > /sys/class/net/enp130s0/device/sriov_numvfs
|
||||
sleep 0.5
|
||||
ip link set enp130s0 vf 0 vlan 4095
|
||||
ip link set enp130s0 vf 1 vlan 4095
|
||||
ip link set enp130s0 vf 2 vlan 3816
|
||||
ip link set enp130s0 vf 3 vlan 3817
|
||||
ip link set enp130s0 vf 0 trust on
|
||||
ip link set enp130s0 vf 1 trust on
|
||||
ip link set enp130s0 vf 2 trust on
|
||||
ip link set enp130s0 vf 3 trust on
|
||||
ip link set enp130s0 vf 0 spoofchk off
|
||||
sleep 1
|
||||
ip link set enp130s2 up
|
||||
ip link set enp130s2f1 up
|
||||
ip link set enp130s2f2 up
|
||||
ip link set enp130s2f3 up
|
||||
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-0/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-1/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-2/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-3/rps_cpus
|
||||
fi
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
INF="$1"
|
||||
STA="$2"
|
||||
|
||||
if [ "$INF" == "enp130s2f1" ]
|
||||
then
|
||||
logger "$0: Interface $INF with $STA ,Set $INF RPS ..."
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-0/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-1/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-2/rps_cpus
|
||||
echo 0003ff,f0003ffc > /sys/class/net/enp130s2f1/queues/rx-3/rps_cpus
|
||||
fi
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
INF="$1"
|
||||
STA="$2"
|
||||
|
||||
logger "$0 called for interface named $INF with $STA ..."
|
||||
|
||||
if [ "$INF" == "enp1s0" ]
|
||||
then
|
||||
logger "$0: Interface $INF with $STA ,Set $INF VF And Vlan ..."
|
||||
modprobe 8021q
|
||||
echo 3 > /sys/class/net/enp1s0/device/sriov_numvfs
|
||||
sleep 0.5
|
||||
echo add 0,3813,3814 > /sys/class/net/enp1s0/device/sriov/0/trunk
|
||||
ip link set enp1s0 vf 1 vlan 3813
|
||||
ip link set enp1s0 vf 2 vlan 3814
|
||||
ip link set enp1s0 vf 0 trust on
|
||||
ip link set enp1s0 vf 1 trust on
|
||||
ip link set enp1s0 vf 2 trust on
|
||||
ip link set enp1s0 vf 0 spoofchk off
|
||||
ip link set enp1s0 vf 0 mac 00:0e:c6:d6:72:c1
|
||||
ip link set enp1s0 vf 1 mac fe:65:b7:03:50:bd
|
||||
sleep 1
|
||||
ip link set enp1s2 up
|
||||
ip link set enp1s2f1 up
|
||||
ip link set enp1s2f2 up
|
||||
fi
|
||||
Reference in New Issue
Block a user