From owner-freebsd-net@FreeBSD.ORG Sun Jun 1 18:59:31 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76D6D18D for ; Sun, 1 Jun 2014 18:59:31 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C6226B8 for ; Sun, 1 Jun 2014 18:59:30 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id x48so4050917wes.8 for ; Sun, 01 Jun 2014 11:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=737o6sXUAm0wkvCHjH5ddh/lAhxk5gv2aBe5ZhLObao=; b=tN5lyimps62RkuJu+XWE1sriHwwByM1U4mstQa7CsiJ1flQWiE0W7GXOX1S/6Z2ZTW L3sCAVbJ/nr9ALGHedi9EHleLXD6Kd7X95uhPZjOJg/g08nrHLhuyAqQBxZ+DupVH/qI w4ahjr7kcT0xWTClfCCHYPQogootJC4ul3cgpNvdmfxDzpqiPsZvzsGAjUDp9pvkybxs QxtDNYqWxn7uN0fEkGHP4iCFRyBz2+4VVbRAeD7AfWHxTBoSf0lZA5jp2liy0rKXohOL ZDRZqn8AzRZBAl3m7pBaiOKw4B+ys5dHA4yWI9oI8IZ5yiRhqOeHnKmUmzf0oYL8Wz1k fQ+g== MIME-Version: 1.0 X-Received: by 10.194.246.234 with SMTP id xz10mr42782051wjc.77.1401649169260; Sun, 01 Jun 2014 11:59:29 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.194.246.130 with HTTP; Sun, 1 Jun 2014 11:59:29 -0700 (PDT) In-Reply-To: <006501cf7da8$f2f23110$d8d69330$@126.com> References: <006501cf7da8$f2f23110$d8d69330$@126.com> Date: Sun, 1 Jun 2014 20:59:29 +0200 X-Google-Sender-Auth: ZcKW9ividbqFiLJy4yvvD0RvhUc Message-ID: Subject: Re: problem of netmap running on PowerPC platform board From: Luigi Rizzo To: dongshan Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 18:59:31 -0000 On Sunday, June 1, 2014, dongshan wrote: > 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 > As you probably figured out, it is an endianness issue (I have not had a > chance to test netmap on a bigendian machine). To further track down the problem could you try and see if using vale:xx as interface name still gives a segfault ? This would help me identify what part of the code to look at. Also what network interface are you using (nic model/driver) ? Thanks Luigi > > 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, kernel: linux 3.8. I > am not whether it effects the outcome. > > > > Best regards, > > Dongshan > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org > " > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------