CN104536824A - Method for achieving Chelsio 40 G network card performance optimization - Google Patents

Method for achieving Chelsio 40 G network card performance optimization Download PDF

Info

Publication number
CN104536824A
CN104536824A CN201510023871.XA CN201510023871A CN104536824A CN 104536824 A CN104536824 A CN 104536824A CN 201510023871 A CN201510023871 A CN 201510023871A CN 104536824 A CN104536824 A CN 104536824A
Authority
CN
China
Prior art keywords
chelsio
network interface
interface card
card performance
performance tuning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510023871.XA
Other languages
Chinese (zh)
Inventor
赵勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201510023871.XA priority Critical patent/CN104536824A/en
Publication of CN104536824A publication Critical patent/CN104536824A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method for achieving Chelsio 40 G network card performance optimization. Under a LINUX system, information of a tested network card is automatically read through related commands; meanwhile, interruption binding is automatically achieved, the CPU pressure is balanced, and the network card performance optimization can be rapidly and accurately carried out. By means of the method, the allocation process can be rapidly achieved, and the efficiency can be greatly improved; in addition, errors and leakage possibly caused during manual allocation can be avoided; in addition, operation is simple, the practicability is high, and a good effect on certain problem analysis, product parameter performance optimization and the like is achieved.

Description

A kind of method realizing Chelsio 40G network interface card Performance tuning
Technical field
The present invention relates to computer technology, specifically a kind of method realizing Chelsio 40G network interface card Performance tuning.
Background technology
Along with the development of current measuring technology, various testing tool, testing software and method are more and more applied to the test of server product and various parts.
Usually carrying out Test Network snaps past in journey, and all can meet the situation that the test performance of some network interface cards and theoretical performance differ greatly, the reason that this thing happens is had nothing in common with each other.Generally speaking, bind relevant to the interruption of CPU and network interface card.The Chelsio 40G network interface card introduced, when doing compatibility test, finds that bandwidth cannot reach the test of theoretical bandwidth 90% by standard, but through attempting optimizing, can be reached through standard.And namely the present invention has done some tentative tunings for Chelsio 40G network interface card, to reaching the object of Chelsio 40G network interface card performance optimization.
Summary of the invention
For the weak point that prior art exists, we are bright provides a kind of method realizing Chelsio 40G network interface card Performance tuning.
A kind of method realizing Chelsio 40G network interface card Performance tuning of the present invention, the technical scheme solving the problems of the technologies described above employing is as follows: the method is under LINUX system, pass through related command, realize the information of automatic read test network interface card, automatically realize interrupting binding simultaneously, balanced CPU pressure, can carry out network interface card Performance tuning fast and accurately.
These concrete steps realizing the method for Chelsio 40G network interface card Performance tuning comprise:
Step one, search Chelsio 40G network interface card, and start interface;
Step 2, determine CPU core task amount and respectively interrupt, and automatically binding;
Step 3, driver module reload.
The beneficial effect that the method for a kind of Chelsio of realization 40G network interface card Performance tuning of the present invention compared with prior art has is: the method can realize the performance optimization of Chelsio 40G network interface card fast, closely may reach its theoretical bandwidth; Layoutprocedure can be realized fast by the method, greatly raise the efficiency, and the mistake that may occur when can avoid artificially configuring, leakage; And the method is simple to operate, practicality is comparatively strong, has good effect, and offer reference with other network interface cards for being applied to for some case studies, product parameters Performance tuning etc.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with specific embodiment, a kind of method realizing Chelsio 40G network interface card Performance tuning of the present invention is further described.
A kind of method realizing Chelsio 40G network interface card Performance tuning of the present invention is under LINUX system, by related command, realizes respectively interrupting binding and verification operation result realizes.
Embodiment:
A kind of method realizing Chelsio 40G network interface card Performance tuning described in the present embodiment, by related command, namely by running corresponding program, realize the information of automatic read test network interface card, automatically realize interrupting binding, balanced CPU pressure, can carry out network interface card Performance tuning fast and accurately simultaneously.The concrete steps of the method are as follows:
Step one, search Chelsio 40G network interface card, and start interface;
Step 2, determine CPU core task amount and respectively interrupt, and automatically binding;
Step 3, driver module reload.
Realize in the method for Chelsio 40G network interface card Performance tuning described in the present embodiment, step one searches Chelsio 40G network interface card, and the specific implementation content starting interface is as follows:
# Find Chelsio devices
# commands path
ETHTOOL=`which ethtool 2> /dev/null`
IFUP=/sbin/ifup
CXGBTOOL=`which cxgbtool 2> /dev/null`
KILLALL="`which killall` -q"
SYSCTL="`which sysctl` -q -w"
usage()
{
echo "Usage: $0 [options]"
echo "options:"
echo " -C Disable binding IRQs to CPUs (smp_affinity)."
echo " -D Do not disable IRQ balance daemon."
echo " -t Write tx_coal=2 to modprobe.d/conf."
echo " -T Remove tx_coal=2 from modprobe.d/conf."
echo
exit
}
# Look for cxgb4 devices
list_chelsio_dev()
{
list_dev=`/sbin/ip link show | grep mtu | cut -d':' -f2`
for dev in $list_dev
do
desc_dev=`$ETHTOOL -i $dev 2>&1 | grep cxgb4`
if [ $? -eq 0 ]; then
echo $dev
fi
done
}
bringup()
{
# Privilege ifup as it will apply the interfaces'settings.
# If it fails, presumably due to the lack of config file,
# just bring the link up. IP settings can be applied later.
$IFUP $1 2>/dev/null
if [ $? -ne 0 ];
then
/sbin/ip link set dev $1 up
fi
}.
Realize in the method for Chelsio 40G network interface card Performance tuning described in the present embodiment, step 2 determination CPU core task amount and respectively interrupting, and the specific implementation content of binding is as follows automatically:
# cpumask is used in msi_x_perftune function to evenly spread interrupts around
# all the ports/CPUs
# It is declared external to the function as we want a stateful cpumask rotor
# which spreads interrupts as evenly as possible around all the ports/CPUs
cpumask=1
# grep /proc/interrupts to figure out cxgb4's interfaces msi interrupts.
# On recent kernels, typical lines look like:
# 81: 0 0 0 0 PCI-MSI-edge eth25-Rx1
# 89: 0 0 0 0 PCI-MSI-edge 0000:08:00.4-ofld3
# 90: 0 0 0 0 PCI-MSI-edge 0000:08:00.4-rdma0
# hence the grep on $1 and 'edge'
msi_x_perftune()
{
ETH=$1
# MSI-X interrupts allocated by driver are recognised by different
# terminology by different Linux distros.
# In RHEL 5.X, RHEL 6.X and SLES 11 SP1 distros MSI-X interrupts are
# recognised as PCI-MSI-edge.
# In SLES 10 SPX distros MSI-X interrupts are recognised as
# PCI-MSI-X.
# Following switch case statements handles these cases.
irqs=($(cat /proc/interrupts | grep $ETH | \
grep "PCI-MSI-" | awk '{ split($0,a,":"); print a[1] }'))
echo "IRQ table length ${#irqs[@]}"
maxcpu=$(( $(grep processor /proc/cpuinfo|wc -l) - 1))
# The smp_affinty mask is only 32 bits long. As a result, if we have
# more than 32 cpus, we need to set the maxcpu value to 31.
if [[ ${maxcpu} -gt 31 ]]; then
$maxcpu=31
fi
for (( c=0; c < ${#irqs[@]}; c++ ));
do
echo "Writing $(printf "%x" $cpumask) in /proc/irq/${irqs[$c]}/smp_affinity"
echo $(printf "%x" $cpumask) > /proc/irq/${irqs[$c]}/smp_affinity
cpumask=`expr $cpumask \* 2`
if [[ ${cpumask} -gt $((1<<${maxcpu})) ]] ; then
cpumask=1
fi
done
}.
Realize described in the present embodiment in the method for Chelsio 40G network interface card Performance tuning, the specific implementation content that step 3 driver module reloads is as follows:
# start fresh
# If iw_cxgb4 and cxgb4 modules are not loaded then trying to
# remove them will result into FATAL error. This can lead user
# to wrong direction. Hence removing errors getting displyed to
# user evenif modules are not loaded.
if ! (( dont_disable_irqbalance )); then
$KILLALL irqbalance
fi
if [ -e /etc/modprobe.conf ]; then
modprobe_config=/etc/modprobe.conf
elif [ -e /etc/modules.conf ]; then
modprobe_config=/etc/modules.conf
elif [ -d /etc/modprobe.d/ ]; then
modprobe_config=/etc/modprobe.d
fi
# Option for ipforwarding mode.
if [ "$tx_coal" == "2" ]; then
if [ -d "$modprobe_config" ]; then
# modprobe_config is a directory, need to scan all files.
cf=$(grep -r -l 'options\s*cxgb4\s*.*tx_coal=.*' $modprobe_config/* \
2>/dev/null | awk 'BEGIN{FS=":"}{print $1}')
else
cf=$(grep -l 'options\s*cxgb4\s*.*tx_coal=.*' $modprobe_config \
2>/dev/null)
[ -n "$cf" ] && cf=$modprobe_config
fi
if [ -z "$cf" ]; then
if [ -d "$modprobe_config" ]; then
cf=/etc/modprobe.d/chelsio.conf
else
cf=$modprobe_config
fi
echo "options cxgb4 tx_coal=2" >> $cf
logger -s "cxgb4 added tx_coal=2 to $cf"
else
# The tx_coal option is already set. Dump an error to syslog and continue.
logger -s "cxgb4 tx_coal value already set. Please check your $cf file."
fi
# Back to default mode.
elif [ "$tx_coal" == "1" ]; then
if [ -d "$modprobe_config" ]; then
cf=$(grep -r -l 'options\s*cxgb4\s*.*tx_coal=.*' $modprobe_config/* \
2>/dev/null)
else
cf=$modprobe_config
fi
if [[ ! -z "$cf" ]]; then
# If tx_coal is the only option on the line, then remove the
# line, otherwise, remove just the tx_coal option.
sed -i 's/\(\s\)*/\1/g' $cf # get rid of multiple spaces
t=$(grep "^options\s*cxgb4\s*.*tx_coal=2" $cf)
t=$(echo $t | sed 's/options\s*cxgb4\s*.*tx_coal=.//')
if [ -z "$t" ]; then
logger -s "cxgb4 tx_coal=2 removed from $cf"
sed -i 's/^options\s*cxgb4\s*tx_coal=.//' $cf
else
logger -s "cxgb4 tx_coal=2 removed from $cf"
sed -i 's/^\(options\s*cxgb4\s*.*\)tx_coal=./\1/' $cf
fi
fi
fi
echo "Discovering Chelsio T4/T5 devices ..."
# Allow the dust to settle. Sometimes the OS will rename the network interfaces,
# so if we bringup an interface before it finishes renaming them
# /proc/interrupts will associate irqs with stale interface names.
sleep 2;
# Get cxgb4 devices, bring them up
chelsio_devs=`list_chelsio_dev`
for dev in $chelsio_devs
do
bringup $dev
done
echo "Configuring Chelsio T4/T5 devices ..."
# get devices again, after potential renaming
# Complete the performance tuning on interfaces now up
chelsio_devs=`list_chelsio_dev`
for dev in $chelsio_devs
do
dev_perftune $dev
echo "$dev now up and tuned"
done
# Assign CPUs for offload queues
dev_perftune ofld
# Assign CPUs for rdma queues
dev_perftune rdma
# kill netserver
# killall -v netserver 2>&1 > /dev/null
# start netserver
# taskset -c 4-7 netserver 2>&1 > /dev/null.
Realize the method for Chelsio 40G network interface card Performance tuning described in the present embodiment, its operation steps: one is Install and configure, drive; Two is run corresponding program.
Above-mentioned embodiment is only concrete case of the present invention; scope of patent protection of the present invention includes but not limited to above-mentioned embodiment; any claims according to the invention and any person of an ordinary skill in the technical field to its suitable change done or replacement, all should fall into scope of patent protection of the present invention.

Claims (3)

1. realize a method for Chelsio 40G network interface card Performance tuning, it is characterized in that, under LINUX system, by related command, the information of automatic read test network interface card, automatically realize interrupting binding, balanced CPU pressure, carries out network interface card Performance tuning simultaneously.
2. a kind of method realizing Chelsio 40G network interface card Performance tuning according to claim 1, it is characterized in that, its concrete steps comprise:
Step one, search Chelsio 40G network interface card, and start interface;
Step 2, determine CPU core task amount and respectively interrupt, and automatically binding;
Step 3, driver module reload.
3. a kind of method realizing Chelsio 40G network interface card Performance tuning according to claim 2, is characterized in that, by related command, referring to by running corresponding program.
CN201510023871.XA 2015-01-16 2015-01-16 Method for achieving Chelsio 40 G network card performance optimization Pending CN104536824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510023871.XA CN104536824A (en) 2015-01-16 2015-01-16 Method for achieving Chelsio 40 G network card performance optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510023871.XA CN104536824A (en) 2015-01-16 2015-01-16 Method for achieving Chelsio 40 G network card performance optimization

Publications (1)

Publication Number Publication Date
CN104536824A true CN104536824A (en) 2015-04-22

Family

ID=52852356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510023871.XA Pending CN104536824A (en) 2015-01-16 2015-01-16 Method for achieving Chelsio 40 G network card performance optimization

Country Status (1)

Country Link
CN (1) CN104536824A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068911A (en) * 2015-08-20 2015-11-18 浪潮电子信息产业股份有限公司 Method for performing network card performance tuning for CPU inner core
CN108469964A (en) * 2018-05-18 2018-08-31 郑州云海信息技术有限公司 A method of it solving network interface card FW and upgrades automatically
CN109787864A (en) * 2019-01-25 2019-05-21 郑州云海信息技术有限公司 A kind of network automatic test approach, device, terminal and storage medium based on Netperf

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398772A (en) * 2008-10-21 2009-04-01 成都市华为赛门铁克科技有限公司 Network data interrupt treating method and device
CN102427483A (en) * 2011-11-15 2012-04-25 浪潮电子信息产业股份有限公司 Method for binding network card name with equipment under Linux system
CN104461679A (en) * 2014-11-04 2015-03-25 浪潮电子信息产业股份有限公司 Method for binding network card to CPU automatically

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398772A (en) * 2008-10-21 2009-04-01 成都市华为赛门铁克科技有限公司 Network data interrupt treating method and device
CN102427483A (en) * 2011-11-15 2012-04-25 浪潮电子信息产业股份有限公司 Method for binding network card name with equipment under Linux system
CN104461679A (en) * 2014-11-04 2015-03-25 浪潮电子信息产业股份有限公司 Method for binding network card to CPU automatically

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
南风轩: "《多核下绑定硬件进程到不同CPU》", 《博客园》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068911A (en) * 2015-08-20 2015-11-18 浪潮电子信息产业股份有限公司 Method for performing network card performance tuning for CPU inner core
CN108469964A (en) * 2018-05-18 2018-08-31 郑州云海信息技术有限公司 A method of it solving network interface card FW and upgrades automatically
CN109787864A (en) * 2019-01-25 2019-05-21 郑州云海信息技术有限公司 A kind of network automatic test approach, device, terminal and storage medium based on Netperf

Similar Documents

Publication Publication Date Title
US9495418B2 (en) Scalable acceleration of database query operations
US8527744B2 (en) Board module for providing alternative board functions which are not called by UEFI compatible programs for driving platform service in silicon components
US7577686B1 (en) Dynamic table configuration in a virtual machine
US8566831B2 (en) Execution of work units in a heterogeneous computing environment
US20170286234A1 (en) System and method for live virtual incremental restoring of data from cloud storage
US20070094643A1 (en) System and method for writing captured data from kernel-level to a file
EP2575041A1 (en) Method and computer for controlling virtual machine
US8468334B1 (en) Efficient initial RAM disk creation
JP2006018814A (en) System and method for development of emulated device in virtual machine environment
US20160306580A1 (en) System and method to extend nvme queues to user space
US10515078B2 (en) Database management apparatus, database management method, and storage medium
US20140189264A1 (en) Reads and Writes Between a Contiguous Data Block and Noncontiguous Sets of Logical Address Blocks in a Persistent Storage Device
CN104536824A (en) Method for achieving Chelsio 40 G network card performance optimization
US10275175B2 (en) System and method to provide file system functionality over a PCIe interface
EP4198732A1 (en) Systems, methods, and devices for accessing a computational device kernel
US9672047B1 (en) Systems and methods for accessing a bootable partition on a serial peripheral interface device
US10705936B2 (en) Detecting and handling errors in a bus structure
WO2023174128A1 (en) Hypercall method and apparatus for kernel-mode program of enhanced berkeley packet filter
US9411871B2 (en) Merging data volumes and derivative versions of the data volumes
US20220121359A1 (en) System and method to utilize a composite block of data during compression of data blocks of fixed size
WO2018085616A1 (en) System arbiter with programmable priority levels
US9665582B2 (en) Software, systems, and methods for enhanced replication within virtual machine environments
CN104572282A (en) Automatic method for binding SAS controller interruption to CPU
CN105187270A (en) Method capable of realizing network card performance optimization of LINUX system
US8255584B2 (en) Systems and methods for managing I/O throughput for large scale computing systems

Legal Events

Date Code Title Description
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150422