Advertisement
Guest User

Untitled

a guest
May 27th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. #!/bin/bash
  2. FAMILY=ixgbe
  3. echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  4. echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
  5.  
  6. # Remove old modules (if loaded)
  7. rmmod ixgbe
  8. rmmod ixgbe_zc
  9. rmmod pf_ring
  10.  
  11. # We assume that you have compiled PF_RING
  12. insmod /usr/lib/modules/3.10.0-327.18.2.el7.x86_64/extra/pf_ring.ko transparent_mode=2
  13.  
  14. # Required by ixgbe
  15. modprobe ptp
  16. modprobe vxlan
  17. modprobe dca
  18.  
  19. # As many queues as the number of processors
  20. insmod /usr/lib/modules/3.10.0-327.18.2.el7.x86_64/extra/ixgbe_zc.ko RSS=12
  21.  
  22. sleep 1
  23.  
  24. killall irqbalance
  25.  
  26. INTERFACES=$(cat /proc/net/dev|grep 'enp5s0'|grep -v 'lo'|grep -v 'sit'|awk -F":" '{print $1}'|tr -d ' ')
  27. for IF in $INTERFACES ; do
  28. TOCONFIG=$(ethtool -i $IF|grep $FAMILY|wc -l)
  29. if [ "$TOCONFIG" -eq 1 ]; then
  30. printf "Configuring %s\n" "$IF"
  31. ifconfig $IF up
  32. sleep 1
  33. bash /root/set_irq_affinity $IF
  34.  
  35. # Max number of RX slots
  36. ethtool -G $IF rx 32768
  37.  
  38. # Max number of TX slots
  39. ethtool -G $IF tx 32768
  40.  
  41. # Disabling VLAN stripping
  42. ethtool -K $IF rxvlan off
  43.  
  44. # Disabling Flow Control (actually it should be automatically disabled by the driver)
  45. #ethtool -A $IF autoneg off
  46. ethtool -A $IF rx off
  47. ethtool -A $IF tx off
  48. #ethtool -s $IF speed 10000
  49.  
  50. # Enable n-tuple hw filters
  51. #ethtool -K $IF ntuple on
  52.  
  53. fi
  54. done
  55.  
  56. HUGEPAGES=1024
  57. if [ `cat /proc/mounts | grep hugetlbfs | wc -l` -eq 0 ]; then
  58. sync && echo 3 > /proc/sys/vm/drop_caches
  59. echo $HUGEPAGES > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
  60. mkdir /mnt/huge
  61. mount -t hugetlbfs nodev /mnt/huge
  62. fi
  63. AVAILHUGEPAGES=$(grep HugePages_Total /sys/devices/system/node/node0/meminfo | cut -d ':' -f 2|sed 's/ //g')
  64. if [ $AVAILHUGEPAGES -ne $HUGEPAGES ]; then
  65. printf "Warning: %s hugepages available, %s requested\n" "$AVAILHUGEPAGES" "$HUGEPAGES"
  66. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement