最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux多隊(duì)列網(wǎng)卡的硬件的實(shí)現(xiàn)詳解

  發(fā)布時(shí)間:2017-03-15 11:28:27   作者:佚名   我要評論
多隊(duì)列網(wǎng)卡是一種技術(shù),很多的朋友對多隊(duì)列網(wǎng)卡不了解!今天小編為大家分享的是Linux多隊(duì)列網(wǎng)卡的硬件的實(shí)現(xiàn)詳解;感興趣的朋友一起去看看吧

6.多隊(duì)列網(wǎng)卡識(shí)別

#lspci -vvv

Ethernet controller的條目內(nèi)容,如果有MSI-X && Enable+ && TabSize > 1,則該網(wǎng)卡是多隊(duì)列網(wǎng)卡,如圖4.4所示。

圖4.4 lspci內(nèi)容

Message Signaled Interrupts(MSI)是PCI規(guī)范的一個(gè)實(shí)現(xiàn),可以突破CPU 256條interrupt的限制,使每個(gè)設(shè)備具有多個(gè)中斷線變成可能,多隊(duì)列網(wǎng)卡驅(qū)動(dòng)給每個(gè)queue申請了MSI。MSI-X是MSI數(shù)組,Enable+指使能,TabSize是數(shù)組大小。

# setting up irq affinity according to /proc/interrupts

# 2008-11-25 Robert Olsson

# 2009-02-19 updated by Jesse Brandeburg

#

# > Dave Miller:

# (To get consistent naming in /proc/interrups)

# I would suggest that people use something like:

# char buf[IFNAMSIZ+6];

#

# sprintf(buf, "%s-%s-%d",

#         netdev->name,

#  (RX_INTERRUPT ? "rx" : "tx"),

#  queue->index);

#

#  Assuming a device with two RX and TX queues.

#  This script will assign: 

#

# eth0-rx-0  CPU0

# eth0-rx-1  CPU1

# eth0-tx-0  CPU0

# eth0-tx-1  CPU1

#

set_affinity()

{

    MASK=$((1<<$VEC))

    printf "%s mask=%X for /proc/irq/%d/smp_affinity\n" $DEV $MASK $IRQ

    printf "%X" $MASK > /proc/irq/$IRQ/smp_affinity

    #echo $DEV mask=$MASK for /proc/irq/$IRQ/smp_affinity

    #echo $MASK > /proc/irq/$IRQ/smp_affinity

}

if [ "$1" = "" ] ; then

 echo "Description:"

 echo "    This script attempts to bind each queue of a multi-queue NIC"

 echo "    to the same numbered core, ie tx0|rx0 --> cpu0, tx1|rx1 --> cpu1"

 echo "usage:"

 echo "    $0 eth0 [eth1 eth2 eth3]"

fi

# check for irqbalance running

IRQBALANCE_ON=`ps ax | grep -v grep | grep -q irqbalance; echo $?`

if [ "$IRQBALANCE_ON" == "0" ] ; then

 echo " WARNING: irqbalance is running and will"

 echo "          likely override this script's affinitization."

 echo "          Please stop the irqbalance service and/or execute"

 echo "          'killall irqbalance'"

fi

#

# Set up the desired devices.

#

for DEV in $*

do

  for DIR in rx tx TxRx

  do

     MAX=`grep $DEV-$DIR /proc/interrupts | wc -l`

     if [ "$MAX" == "0" ] ; then

       MAX=`egrep -i "$DEV:.*$DIR" /proc/interrupts | wc -l`

     fi

     if [ "$MAX" == "0" ] ; then

       echo no $DIR vectors found on $DEV

       continue

       #exit 1

     fi

     for VEC in `seq 0 1 $MAX`

     do

        IRQ=`cat /proc/interrupts | grep -i $DEV-$DIR-$VEC"$"  | cut  -d:  -f1 | sed "s/ //g"`

        if [ -n  "$IRQ" ]; then

          set_affinity

        else

           IRQ=`cat /proc/interrupts | egrep -i $DEV:v$VEC-$DIR"$"  | cut  -d:  -f1 | sed "s/ //g"`

           if [ -n  "$IRQ" ]; then

             set_affinity

           fi

        fi

     done

  done

done

相關(guān)文章

最新評論

九江市| 永吉县| 邯郸县| 屏山县| 长治县| 吴堡县| 宜兰市| 商南县| 蓬莱市| 荆门市| 同德县| 桦南县| 静宁县| 偃师市| 漳平市| 巴东县| 宁南县| 碌曲县| 英吉沙县| 环江| 祁东县| 军事| 华坪县| 新乡县| 临邑县| 柘荣县| 丹凤县| 古蔺县| 重庆市| 苏尼特左旗| 曲阳县| 墨江| 甘泉县| 定边县| 万盛区| 临沂市| 当涂县| 镇沅| 长宁县| 玉山县| 三都|