Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 2014 22:47:37 +0800
From:      "dongshan" <thomasyang1206@126.com>
To:        <net@freebsd.org>
Subject:   problem of netmap running on PowerPC platform board
Message-ID:  <005601cf7da8$6ea46900$4bed3b00$@126.com>

next in thread | raw e-mail | index | archive | help
Hi, 

 

very good work you have done, thank you for sharing the source code of
netmap.

 

These days I am trying to test netmap performance on PowerPC 32 bit board,
followed the guide, I rebuilt the kernel and netmap modules, then I tested
pkt-gen. when configured it as RX mode, it seems work fine. But when I test
the TX mode, segmentation fault error occurs. Am sure the procedures I did
was right, as I followed the procedures as what I did on X86 platform.

 

Here is the info:

root@p4080ds:~/netmap_modules# ./pkt-gen -i eth0 -f tx -n 500111222 -l 60 -w
10
886.299155 main [1624] interface is eth0
886.299712 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0
886.299731 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0
886.517024 main [1807] mapped 334980KB at 0x48003000
Sending on netmap:eth0: 1 queues, 1 threads and 1 cpus.
10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> ff:ff:ff:ff:ff:ff)
886.517087 main [1885] Sending 512 packets every 0.000000000 s
886.517099 main [1887] Wait 10 secs for phy reset
896.517259 main [1889] Ready...
896.517293 nm_open [457] overriding ifname eth0 ringid 0x0 flags 0x1
896.517428 sender_body [996] start
Segmentation fault

 

After carefully debugging, I found where the error occurs. In pkt-gen.c
file, line 691:

.

} else if (options & OPT_MEMCPY) {

memcpyu(frame, p, size);

       if ( fcnt == nfrags)

.

The 'p' address in the code is out of range of the mmap(). Then I traced it
and found the root error but I don't know how to correct it. I used GDB to
debug the code, in netmap_user.h file: 525, I added info of r->ofs as:

.

for(i = 0; i <+ d->req.nr_tx_rings, i++) {

       struct netmap_ring *r = NETMAP_TXRING(d->nifp, i);

       D("TX%d %p h %d c %d t %d ofs 0x%lx", i, r, r->head, r->cur, r->tail,
r->buf_ofs);

}

.

The red is what I added. It outcomes the 'ofs' is 0x8000000, however 0x800
is expected.

The board I tested is PowerPC big endian 32 bit board, I am not whether it
effects the outcome.

 

Best regards,

Dongshan

 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005601cf7da8$6ea46900$4bed3b00$>