2014년 2월 20일 목요일

Mango220(Exynos4412) 이더넷 Iperf 테스트





1. 기본 iperf 테스트
1.1. 망고220 이 서버 일 때
<망고220 로그>
$ /data/data/com.magicandroidapps.iperf/bin/iperf -s -i 1&   
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  2.54 MBytes  21.3 Mbits/sec
[  4]  1.0- 2.0 sec  3.25 MBytes  27.2 Mbits/sec
[  4]  2.0- 3.0 sec  3.30 MBytes  27.7 Mbits/sec
[  4]  3.0- 4.0 sec  3.27 MBytes  27.5 Mbits/sec
[  4]  4.0- 5.0 sec  3.21 MBytes  27.0 Mbits/sec
[  4]  5.0- 6.0 sec  3.28 MBytes  27.5 Mbits/sec
[  4]  6.0- 7.0 sec  3.28 MBytes  27.5 Mbits/sec
[  4]  7.0- 8.0 sec  3.29 MBytes  27.6 Mbits/sec
[  4]  8.0- 9.0 sec  3.31 MBytes  27.8 Mbits/sec
[  4]  9.0-10.0 sec  3.31 MBytes  27.8 Mbits/sec
[  4]  0.0-10.1 sec  32.2 MBytes  26.9 Mbits/sec



<HOST PC>
$ iperf -c 192.168.55.13
------------------------------------------------------------
Client connecting to 192.168.55.13, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.8 port 59789 connected with 192.168.55.13 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.1 sec  32.2 MBytes  26.9 Mbits/sec












1.2. HOST PC가 서버 일 때
<망고220>
/data/data/com.magicandroidapps.iperf/bin/iperf -c 192.168.55.8

------------------------------------------------------------
Client connecting to 192.168.55.8, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.13 port 35105 connected with 192.168.55.8 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  35.6 MBytes  29.8 Mbits/sec



<HOSTPC>
$ iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.8 port 5001 connected with 192.168.55.13 port 35105
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  3.20 MBytes  26.9 Mbits/sec
[  4]  1.0- 2.0 sec  3.53 MBytes  29.6 Mbits/sec
[  4]  2.0- 3.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  3.0- 4.0 sec  3.54 MBytes  29.7 Mbits/sec
[  4]  4.0- 5.0 sec  3.61 MBytes  30.3 Mbits/sec
[  4]  5.0- 6.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  6.0- 7.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  7.0- 8.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  8.0- 9.0 sec  3.61 MBytes  30.3 Mbits/sec
[  4]  9.0-10.0 sec  3.63 MBytes  30.5 Mbits/sec
[  4]  0.0-10.0 sec  35.6 MBytes  29.8 Mbits/sec








2. 이더넷 속도 관련 kernel 소스 수정

$ vi arch/arm/mach-exynos/mach-mango220.c
static void __init smdk4x12_smsc911x_init(void)
… 생략…
__raw_writel((0x0 << S5P_SROM_BCX__PMC__SHIFT) |
            (0x0 << S5P_SROM_BCX__TACP__SHIFT) |
            (0x1 << S5P_SROM_BCX__TCAH__SHIFT) |
            (0x0 << S5P_SROM_BCX__TCOH__SHIFT) |
            (0x2 << S5P_SROM_BCX__TACC__SHIFT) |
            (0x0 << S5P_SROM_BCX__TCOS__SHIFT) |
            (0x0 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);

$vi drivers/net/smsc911x.c
static inline void reg_write(u32 addr, u32 val)
{
   *(volatile u16*)addr = (u16)val;
   *(volatile u16*)(addr + 2) = (u16)(val >> 16);
}
static inline u32 reg_read(u32 addr)
{
   volatile unsigned short __force  *addr_16 = (unsigned short *)(addr);
   //printk("addr_16 = 0x%x, addr = 0x%x \n",*addr_16,addr);  //by crazyboy 20140220 by treego;
   return ((readw(addr) & 0xFFFF) |
           ((readw(addr + 2) & 0xFFFF) << 16));
}

#if 1
static inline void
smsc911x_tx_writefifo(struct smsc911x_data *pdata, unsigned int *buf,
     unsigned int wordcount)
{
   unsigned long flags;
   int val;
   spin_lock_irqsave(&pdata->dev_lock, flags);
//#ifdef CRZ_SPEED_UP//crazyboys
#if 1
   while (wordcount--)
   {
    val = *buf++;
//   printk("write == reg=0x%x buf = 0x%x val = 0x%x \n",pdata->ioaddr + TX_DATA_FIFO,*buf,(u16)val);
    *(volatile u16*)(pdata->ioaddr + TX_DATA_FIFO) = (u16)val;
    *(volatile u16*)(pdata->ioaddr + TX_DATA_FIFO + 2) = (u16)(val >> 16);
   }

#else
//MANGO_DBG("== wordcount=%d\n",wordcount);
while (wordcount--)
__smsc911x_reg_write(pdata, TX_DATA_FIFO, *buf++);
goto out;
#endif
   spin_unlock_irqrestore(&pdata->dev_lock, flags);
}

#if 1
static inline void
smsc911x_rx_readfifo(struct smsc911x_data *pdata, unsigned int *buf,
    unsigned int wordcount)
{
unsigned long flags;
unsigned int test_val;
unsigned short *sp = (unsigned short *)buf;
volatile u16 *addr_16 = (u16 *)(pdata->ioaddr);
   spin_lock_irqsave(&pdata->dev_lock, flags);
//#ifdef CRZ_SPEED_UP//crazyboys
//  printk("CCRRZZZZZZ- pdata->ioaddr=0x%x addr_16 = 0x%x\n",pdata->ioaddr + TX_DATA_FIFO,addr_16);
//  printk("CCRRZZZZZZ- pdata->ioaddr=0x%x addr_16 = 0x%x\n",pdata->ioaddr,*addr_16);
   while (wordcount--)
   {
   #if 0 //crazyboys test Remove it
   *buf++=reg_read(0xf1000000);
   *buf++=reg_read(0xf1000000);
   while(1);
   #endif
//   printk("write == reg=0x%x buf = 0x%x \n",pdata->ioaddr + RX_DATA_FIFO,*buf);
    //printk("read == wordcount=%d\n",wordcount);
    *buf++=reg_read(pdata->ioaddr);
//   *buf++=__smsc911x_reg_read(pdata,RX_DATA_FIFO);
//   *buf++ = ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
   // *buf++ = reg_read(0xeed20000);
     // *sp++=(*(volatile u16*)(0xf1000000));
     //*sp++=*addr_16;
   // udelay(1);
   //*sp++=(*(volatile u16*)(0xf1000002));
   //*sp++=*(addr_16+1);
   // udelay(5);
   }
   spin_unlock_irqrestore(&pdata->dev_lock, flags);
}

3. 소스 수정 후 iperf 테스트
3.1. 망고220 이 서버 일 때
<망고220 로그>
# /data/data/com.magicandroidapps.iperf/bin/iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.13 port 5001 connected with 192.168.55.8 port 50215
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  4.65 MBytes  39.0 Mbits/sec
[  4]  1.0- 2.0 sec  4.49 MBytes  37.6 Mbits/sec
[  4]  2.0- 3.0 sec  4.51 MBytes  37.8 Mbits/sec
[  4]  3.0- 4.0 sec  4.62 MBytes  38.7 Mbits/sec
[  4]  4.0- 5.0 sec  4.54 MBytes  38.1 Mbits/sec
[  4]  5.0- 6.0 sec  4.56 MBytes  38.2 Mbits/sec
[  4]  6.0- 7.0 sec  4.64 MBytes  38.9 Mbits/sec
[  4]  7.0- 8.0 sec  4.63 MBytes  38.8 Mbits/sec
[  4]  8.0- 9.0 sec  4.82 MBytes  40.4 Mbits/sec
[  4]  9.0-10.0 sec  4.59 MBytes  38.5 Mbits/sec
[  4]  0.0-10.0 sec  46.2 MBytes  38.6 Mbits/sec



<HOST PC>
$ iperf -c 192.168.55.13
------------------------------------------------------------
Client connecting to 192.168.55.13, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.8 port 50215 connected with 192.168.55.13 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  46.2 MBytes  38.6 Mbits/sec







3.2. HOST PC가 서버 일 때
<망고220>
/data/data/com.magicandroidapps.iperf/bin/iperf -c 192.168.55.8

------------------------------------------------------------
Client connecting to 192.168.55.8, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.13 port 55880 connected with 192.168.55.8 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  77.0 MBytes  64.5 Mbits/sec



<HOSTPC>
$ iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.8 port 5001 connected with 192.168.55.13 port 55880
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  6.90 MBytes  57.9 Mbits/sec
[  4]  1.0- 2.0 sec  7.50 MBytes  62.9 Mbits/sec
[  4]  2.0- 3.0 sec  7.50 MBytes  62.9 Mbits/sec
[  4]  3.0- 4.0 sec  7.51 MBytes  63.0 Mbits/sec
[  4]  4.0- 5.0 sec  7.49 MBytes  62.8 Mbits/sec
[  4]  5.0- 6.0 sec  7.52 MBytes  63.1 Mbits/sec
[  4]  6.0- 7.0 sec  8.03 MBytes  67.4 Mbits/sec
[  4]  7.0- 8.0 sec  8.11 MBytes  68.1 Mbits/sec
[  4]  8.0- 9.0 sec  8.16 MBytes  68.5 Mbits/sec
[  4]  9.0-10.0 sec  8.16 MBytes  68.5 Mbits/sec
[  4]  0.0-10.0 sec  77.0 MBytes  64.5 Mbits/sec




댓글 없음:

댓글 쓰기