First of all let me give you a brief on the insides of Ethernet MAC.
We have a MAC module which interacts with Physical layer and we have DMA which interacts with memory. So the Ethernet frame flow is like this
Transmit:
Memory-->DMA-->MAC-->Physical Layer
Receive:
Memory<--DMA<--MAC<--Physical Layer
Transmit and receive descriptors are basically used by DMA. In these descriptors, we give address of memory location from where DMA reads and writes back the Ethernet frame while transmitting and receiving respectively. Apart from memory location, many other important parameters which are required by DMA to process a frame are programmed in descriptors.Once all the information is programmed, we give the control of descriptors to DMA. We can have one or many descriptors for one frame. When transmit or receive of frame is complete , DMA updates the status in descriptors and assign them back to user. Once we read status and frame data, we again give control of descriptors back to DMA and the process continues.
It's our choice how many descriptors we want to program. The more descriptors we program...the more frames we can process in one go (high performance) but yes at the cost of more kernel resources. There is always a trade off in kernel.
- Oct 25 Fri 2019 01:06
What transmit/receive descriptorsare used for in Ethernet MAC?
- Sep 17 Mon 2018 22:50
linux screen 用法
使用 screen
在命令列下打 screen 就會進入 screen 的天地:
% screen
注意,所有 screen 的指令都是以 Ctrl 鍵加上 a 鍵開始的,在之後以 C-a 代表,C-a c 代表按住 Ctrl 鍵不放再按 a 鍵,然後放開按 c 鍵;而 C-a C-c 代表按住 Ctrl 鍵不放再按 a 鍵,然後放開後再按住 Ctrl 鍵不放按 c 鍵。
開啟,關閉,切換
C-a c 或 C-a C-c 開啟新的視窗,並同時切換到這個新的視窗
C-a n 或 C-a C-n 或 C-a (space) 切換到下一個視窗(0->1 1->2 ...)
C-a p 或 C-a C-p 切換到上一個視窗(1->0 2->1 ...)
C-a C-a 切換到上一個顯示過的視窗(不是照順序切換)
C-a 0 切換到第 0 個視窗
C-a (1..9) 切換到第 (1..9) 個視窗
C-a w 或 C-a C-w 會列出目前所開啟的視窗
0$ tcsh 1$ tcsh 2*$ tcsh 3$ tcsh
有星號 "*" 的表示目前顯示中的視窗,之後的 tcsh 代表這個視窗的 title ,預設是以開啟時的 shell 名稱
C-a K 關閉所有的視窗並退出 screen
C-a ' 或 C-a " 會出現 "Switch to window:" 字樣,輸入號碼後就可切到該視窗
單一視窗使用中的指令
C-a C 清除目前的視窗內容
- Sep 05 Wed 2018 01:15
Could not find "http://www.zylin.com/zylincdt
When install zylin cdt plugin into eclipse, it will suffer the problem that could not find the"http://www.zylin.com/zylincdt"as below,
After searching, the correct address for installing zylin cdt should change to http://opensource.zylin.com/zylincdt
- Aug 31 Fri 2018 16:44
how to install sun jdk 6 in Ubuntu 14.4 LTS
refer to:
https://jingyan.baidu.com/article/d621e8dae805272865913fa7.html
一、安装
创建安装目录,在/usr/java下建立安装路径,并将文件考到该路径下:
# mkdir /usr/java
1、jdk-6u11-linux-i586.bin 这个是自解压的文件,在linux上安装如下:
please go to download jdk-6u11-linux-i586.bin from
http://www.oracle.com/technetwork/java/javase/java-archive-downloads-javase6-419409.html
# chmod 755 jdk-6u11-linux-i586.bin
# ./jdk-6u11-linux-i586.bin (注意,这个步骤一定要在jdk-6u11-linux-i586.bin所在目录下)
在按提示输入yes后,jdk被解压。
出现一行字:Do you aggree to the above license terms? [yes or no]
- Aug 20 Mon 2018 14:41
Virtual box mount existing physical hard disk and partition.(virtuabox 掛實體硬碟)
Create a image of VMDK file for existing harddisk in ubuntu linux host:
$sudo VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda
if create a image is created from a given partition of physical harddisk,
$sudo VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1,5
Create a image of VMDK file from a exsting harddisk in window host:
- Run cmd as adminstrator mode
- C:\> cd "Program Files\Oracle\VirtualBox"
- C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands createrawvmdk -filename "C:\xxx.vmdk" -rawdisk "\\.\PhysicalDrive1"
the "\\.\physicalDrive1" is the harddisk which the image create from.
if create a image is from a given partition of physical harddisk,
C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands createrawvmdk -filename "C:\xxx.vmdk" -rawdisk "\\.\PhysicalDrive0" -partitions 6
if need to involve more partitions at once, could add "," between two partitions number, for example, -partitions 6,5
reference from:
https://www.virtualbox.org/manual/ch09.html#idm8266
- Aug 20 Mon 2018 11:21
Resolve the issue that VirtualBox Customize Screen Resolution failed(window xp 調解度)
Installing VirtualBox Guest Addition in host and target platform still can't chanage window XP resolution, the highest resolution is 1024X768.
Two methods to adjust display resolution.
1.Set vesa resolutions in host platform:
cd c:\programfiles\oracle\virtualbox
VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16
2.Configuring the maximum resolution of guests when using the graphical frontend:
VBoxManage setextradata global GUI/MaxGuestResolution any
will remove all limits on guest resolutions.
VBoxManage setextradata global GUI/MaxGuestResolution >width,height<
manually specifies a maximum resolution.
VBoxManage setextradata global GUI/MaxGuestResolution auto
restores the default settings. Note that these settings apply globally to all guest systems, not just to a single machine.
reference from
https://www.virtualbox.org/manual/ch09.html#idm8266
- Sep 11 Mon 2017 15:13
[音響論壇] 調整LP唱盤的八大基本功
[音響論壇] 調整LP唱盤的八大基本功
在LP時代,許多人終其一生聽LP唱片,然而,他們可能連唱頭要調整三個角度都不知道。只知道唱頭鎖上唱頭蓋,加上適當針壓就能唱出聲音了。從「知」的角度來看,他們可說是糊里糊塗的聽著唱片。從「不知」的角度來看,他們才是真正幸福的LP迷,因為他們從來未曾感受到調整唱頭唱臂的痛苦。
基於這四大痛苦,所以今日CD盛行真是救苦救難菩薩,讓大多數人從苦海中解脫。奇怪?既然聽LP唱片那麽的痛苦,為什麽還有人甘之如飴呢?其實答案也很簡單。第一:聽LP唱片有成就感。調整功夫的高低直接就影響到聲音的好聽與否,功夫不夠,聲音就不好聽;功夫好,大家都稱讚。因此,聽LP唱片比聽CD要來得有成就感。第二:LP是類比的聲音。類比聲音裏有數位聲音所無法企及的許多細節,而且音質也更自然。這也是許多人仍不放棄聽LP唱片的主要原因。
對於從LP時代跨到CD時代的LP迷而言,調整唱頭唱臂的一些基本功夫他們皆已具備。而對于那些要從CD時代跨入LP領域的新LP迷而言,他們恐怕就沒有這些基本功夫。因此,我在這裡想以最簡單的方式來為這些新鮮人講述調整唱盤系統的八大基本功。有了這八大基本功之後,您再往更細微的地方去發展,很快的就會有所成就。
第一功:調唱盤、轉盤的水平
這裡所說的唱盤包括整座唱盤本身以及轉盤。尤其是轉盤,如果轉盤本身沒有水平,那就沒什麽戲好唱了。為什麽?由于它不水平,抗滑會有問題,唱片溝槽二側受力也不同。這樣一來,許多問題就會產生。
調整方法:使用水平儀。水平儀有二種,一種是圓形中間有孔的,可以套在轉軸中央。另一種是長型的,可以測較大面積的表面水平與否。最好的方法就是二種都準備,先用長型水平儀側唱盤水平與否。然後再用圓形的測轉盤水平與否。至於要如何調轉盤的水平,由于各種唱盤的懸浮系統都不一樣,因此無法在此詳述。
檢驗成果:以目視檢驗,看氣泡是否在中間就對了。
- Sep 11 Mon 2017 15:13
(未設定標題)
[音響論壇] 調整LP唱盤的八大基本功
在LP時代,許多人終其一生聽LP唱片,然而,他們可能連唱頭要調整三個角度都不知道。只知道唱頭鎖上唱頭蓋,加上適當針壓就能唱出聲音了。從「知」的角度來看,他們可說是糊里糊塗的聽著唱片。從「不知」的角度來看,他們才是真正幸福的LP迷,因為他們從來未曾感受到調整唱頭唱臂的痛苦。
基於這四大痛苦,所以今日CD盛行真是救苦救難菩薩,讓大多數人從苦海中解脫。奇怪?既然聽LP唱片那麽的痛苦,為什麽還有人甘之如飴呢?其實答案也很簡單。第一:聽LP唱片有成就感。調整功夫的高低直接就影響到聲音的好聽與否,功夫不夠,聲音就不好聽;功夫好,大家都稱讚。因此,聽LP唱片比聽CD要來得有成就感。第二:LP是類比的聲音。類比聲音裏有數位聲音所無法企及的許多細節,而且音質也更自然。這也是許多人仍不放棄聽LP唱片的主要原因。
對於從LP時代跨到CD時代的LP迷而言,調整唱頭唱臂的一些基本功夫他們皆已具備。而對于那些要從CD時代跨入LP領域的新LP迷而言,他們恐怕就沒有這些基本功夫。因此,我在這裡想以最簡單的方式來為這些新鮮人講述調整唱盤系統的八大基本功。有了這八大基本功之後,您再往更細微的地方去發展,很快的就會有所成就。
第一功:調唱盤、轉盤的水平
這裡所說的唱盤包括整座唱盤本身以及轉盤。尤其是轉盤,如果轉盤本身沒有水平,那就沒什麽戲好唱了。為什麽?由于它不水平,抗滑會有問題,唱片溝槽二側受力也不同。這樣一來,許多問題就會產生。
調整方法:使用水平儀。水平儀有二種,一種是圓形中間有孔的,可以套在轉軸中央。另一種是長型的,可以測較大面積的表面水平與否。最好的方法就是二種都準備,先用長型水平儀側唱盤水平與否。然後再用圓形的測轉盤水平與否。至於要如何調轉盤的水平,由于各種唱盤的懸浮系統都不一樣,因此無法在此詳述。
檢驗成果:以目視檢驗,看氣泡是否在中間就對了。
- May 04 Thu 2017 16:21
How to create swap file
1.creat a file.
dd if=/dev/zero of=/swapfile bs=1024 count=65536
2.make swap file
mkswap /swapfile
3.enable swap file
swapon /swapfile
4.add swap file instance into /etc/fstab for auto enable swap file after reboot.
/swapfile swap swap defaults 0 0
- May 04 Thu 2017 11:54
the problems of EPC installation
When meet the problem that can't access the phpmyadmin with "http://xx.xx.xx.xx/phpmyadmin
the problem could be caused by the following
1) mysql isn't started up
--> use this command to up mysql "sudo /etc/init.d/mysql start"
--> check whether mysql is up or not "mysql -h 127.0.0.1 -P 3306 -u root -p
2)apache2 dosn't up
--> to start apache2 with command "sudo /etc/init.d/mysql start"
3) phpmyadmin doesn't configure properly
-->reconfigure it with command "sudo dpkg-reconfigure phpmyadmin"