Skip to content

Commit

Permalink
Added mlnx-[pre|post]-hlk scripts
Browse files Browse the repository at this point in the history
These scripts should be used to configure SmartNIC for Microsoft HLK
test framework.

Signed-off-by: Vladimir Sokolovsky <[email protected]>
  • Loading branch information
vladsokolovsky committed Aug 14, 2020
1 parent e312605 commit 1cdf87a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ override_dh_auto_install:
install -m 0755 ofed_scripts/setup_mr_cache.sh debian/$(pname)/usr/sbin
install -m 0755 ofed_scripts/odp_stat.sh debian/$(pname)/usr/sbin
install -m 0755 ofed_scripts/show_counters debian/$(pname)/usr/sbin
install -m 0755 ofed_scripts/mlnx*hlk debian/$(pname)/usr/sbin
install -m 0755 ofed_scripts/roce_config.sh debian/$(pname)/usr/bin/roce_config
install -m 0644 kernel-boot/mlnx-bf.conf debian/$(pname)/etc/modprobe.d

Expand Down
1 change: 1 addition & 0 deletions mlnx-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ install -m 0755 ofed_scripts/setup_mr_cache.sh %{buildroot}%{_sbindir}
install -m 0755 ofed_scripts/odp_stat.sh %{buildroot}%{_sbindir}
install -m 0755 ofed_scripts/show_counters %{buildroot}%{_sbindir}
install -m 0755 ofed_scripts/show_gids %{buildroot}%{_sbindir}
install -m 0755 ofed_scripts/mlnx*hlk %{buildroot}%{_sbindir}
install -m 0755 ofed_scripts/ibdev2netdev %{buildroot}%{_bindir}
install -m 0755 ofed_scripts/roce_config.sh %{buildroot}%{_bindir}/roce_config
install -m 0755 kernel-boot/vf-net-link-name.sh %{buildroot}/lib/udev/
Expand Down
18 changes: 18 additions & 0 deletions ofed_scripts/mlnx-post-hlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

export PATH=/opt/mellanox/iproute2/sbin:$PATH

tc qdisc del dev p0 handle ffff: ingress
tc qdisc del dev pf0hpf handle ffff: ingress
tc qdisc del dev p1 handle ffff: ingress
tc qdisc del dev pf1hpf handle ffff: ingress
ifconfig p0 mtu 1500
ifconfig pf0hpf mtu 1500
ifconfig p1 mtu 1500
ifconfig pf1hpf mtu 1500

if [ -e /etc/debian_version ]; then
/etc/init.d/openvswitch-switch start
else
/usr/bin/systemctl start openvswitch.service
fi
30 changes: 30 additions & 0 deletions ofed_scripts/mlnx-pre-hlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

export PATH=/opt/mellanox/iproute2/sbin:$PATH

if [ -e /etc/debian_version ]; then
/etc/init.d/openvswitch-switch stop
else
/usr/bin/systemctl stop openvswitch.service
fi

tc qdisc del dev p0 handle ffff: ingress
tc qdisc del dev pf0hpf handle ffff: ingress
tc qdisc del dev p1 handle ffff: ingress
tc qdisc del dev pf1hpf handle ffff: ingress


tc qdisc add dev p0 handle ffff: ingress
tc qdisc add dev pf0hpf handle ffff: ingress
tc qdisc add dev p1 handle ffff: ingress
tc qdisc add dev pf1hpf handle ffff: ingress

tc filter add dev p0 ingress protocol all flower skip_sw action mirred egress redirect dev pf0hpf
tc filter add dev pf0hpf ingress protocol all flower skip_sw action mirred egress redirect dev p0
tc filter add dev p1 ingress protocol all flower skip_sw action mirred egress redirect dev pf1hpf
tc filter add dev pf1hpf ingress protocol all flower skip_sw action mirred egress redirect dev p1

ifconfig p0 mtu 9614
ifconfig pf0hpf mtu 9614
ifconfig p1 mtu 9614
ifconfig pf1hpf mtu 9614

0 comments on commit 1cdf87a

Please sign in to comment.