From owner-freebsd-net@FreeBSD.ORG Mon Feb 2 23:43:45 2015 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7561AAEF for ; Mon, 2 Feb 2015 23:43:45 +0000 (UTC) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (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 4167386F for ; Mon, 2 Feb 2015 23:43:45 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id ey11so88510952pad.7 for ; Mon, 02 Feb 2015 15:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=X3GMIAU5ls5U75qbMTK3Ip8PKvNwVhrDKFNOS6nuu0s=; b=lUGw/V3XbXrxKpxN1TUXlpBstr40BHlyQ/fq+hjzMtCK/naRY6awjf0QKSaMj4NSqG tcDegoXjgjStjqe+o7+C24zn5vBg17jQyHsb8h0dk3vRNUxQ3nAubAoNDK2SuegRY4zK VmQKpb3GtJt5aNrp5RQJSBTvYhk1QgqtGSkbKVdLMN4+IFU7SFenx432Oa8HcpEE/Wc5 ZdmTLPOTvb/DJ3PseSLdeNxz4iQy7hQ83z0Ydvjcz3p1NB7vI/mgJpcUx93ZAqF1gYJY ENUI04k+gCTh05GXabSxi14A6GMAW0dhKTXEYAWKiLDTYWp/evicle+9RqJ99T8D7iOB 8dIg== MIME-Version: 1.0 X-Received: by 10.66.101.66 with SMTP id fe2mr33305751pab.118.1422920624794; Mon, 02 Feb 2015 15:43:44 -0800 (PST) Received: by 10.70.12.67 with HTTP; Mon, 2 Feb 2015 15:43:44 -0800 (PST) Date: Mon, 2 Feb 2015 17:43:44 -0600 Message-ID: Subject: netmap nic to host stack forwarding From: Xiaoye Sun To: net@freebsd.org, Luigi Rizzo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "yx15@rice.edu" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 23:43:45 -0000 Hi, I am new to netmap. What I want to do with netmap is to implement file transfer protocol so that netmap can help achieve fast network IO. In the netmap client program, I want that the unrelated packets are forwarded to the linux host stack and all the packets from the host stack are forwarded to the NIC also. That is, besides the netmap client achieving our file transfer protocol, all the other netowrk applications running on top of the host stack are not affected. Our machine configuration is as follows: Linux 3.11 + Myricom 10G nic + original Myricom driver coming in the linux kernel, not the modified one. We start to play with the bridge.c example in the netmap google code repository. We want to use it in a way so that the netmap client forwards packets from nic to the host stack and vice versa. So we use the command as follows sudo ./bridge -i netmap:eth3 to run the bridge netmap client. We did not change anything in the bridge.c code and the netmap source code. We test the functionality with the ping command line in linux. In our setting, another machine (not running netmap) sends ping request message to the netmap client machine and waits for the reply message. By looking at the tcpdump, we found that all the packets got a copy. That is, in the tcpdump results, there is a duplicate for each packet. Here is the output of tcpdump -i eth3: 17:40:32.708585 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 1, length 64 17:40:32.708647 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 1, length 64 17:40:32.708721 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 1, length 64 17:40:32.708760 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 1, length 64 17:40:33.708410 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 2, length 64 17:40:33.708454 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 2, length 64 17:40:33.708507 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 2, length 64 17:40:33.708540 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 2, length 64 17:40:34.708400 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 3, length 64 17:40:34.708441 IP 10.10.10.74 > 10.10.10.52: ICMP echo request, id 19910, seq 3, length 64 17:40:34.708488 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 3, length 64 17:40:34.708516 IP 10.10.10.52 > 10.10.10.74: ICMP echo reply, id 19910, seq 3, length 64 Here is the output of the bridge.c in verbose mode 420.122815 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 422.625336 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 425.127857 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 427.630354 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 430.132872 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 432.635393 main [749] poll timeout [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 0 rx 0@0 tx 1023 432.708611 main [749] poll ok [0] ev 1 0 rx 0@0 tx 1023, [1] ev 1 1 rx 1@0 tx 1023 432.708635 main [749] poll ok [0] ev 5 4 rx 0@0 tx 1023, [1] ev 0 0 rx 1@0 tx 1023 432.708641 process_rings [562] net->host sent 1 packets to 0x7fef1aeaa000 432.708743 main [749] poll ok [0] ev 1 1 rx 1@0 tx 1023, [1] ev 1 0 rx 0@1 tx 1023 432.708751 main [749] poll ok [0] ev 0 0 rx 1@0 tx 1023, [1] ev 5 4 rx 0@1 tx 1023 432.708755 process_rings [562] net->host sent 1 packets to 0x7fef1aea1000 433.708430 main [749] poll ok [0] ev 1 0 rx 0@1 tx 1023, [1] ev 1 1 rx 1@1 tx 1022 433.708445 main [749] poll ok [0] ev 5 4 rx 0@1 tx 1023, [1] ev 0 0 rx 1@1 tx 1022 433.708449 process_rings [562] net->host sent 1 packets to 0x7fef1aeaa000 433.708525 main [749] poll ok [0] ev 1 1 rx 1@1 tx 1023, [1] ev 1 0 rx 0@2 tx 1022 433.708532 main [749] poll ok [0] ev 0 0 rx 1@1 tx 1023, [1] ev 5 4 rx 0@2 tx 1022 433.708536 process_rings [562] net->host sent 1 packets to 0x7fef1aea1000 434.708416 main [749] poll ok [0] ev 1 0 rx 0@2 tx 1023, [1] ev 1 1 rx 1@2 tx 1022 434.708432 main [749] poll ok [0] ev 5 4 rx 0@2 tx 1023, [1] ev 0 0 rx 1@2 tx 1022 434.708437 process_rings [562] net->host sent 1 packets to 0x7fef1aeaa000 434.708497 main [749] poll ok [0] ev 1 1 rx 1@2 tx 1023, [1] ev 1 0 rx 0@3 tx 1022 434.708505 main [749] poll ok [0] ev 0 0 rx 1@2 tx 1023, [1] ev 5 4 rx 0@3 tx 1022 434.708511 process_rings [562] net->host sent 1 packets to 0x7fef1aea1000 437.211025 main [749] poll timeout [0] ev 1 0 rx 0@3 tx 1023, [1] ev 1 0 rx 0@3 tx 1022 437.709106 main [749] poll ok [0] ev 1 1 rx 1@3 tx 1023, [1] ev 1 0 rx 0@3 tx 1022 437.709116 main [749] poll ok [0] ev 0 0 rx 1@3 tx 1023, [1] ev 5 4 rx 0@3 tx 1022 437.709121 process_rings [562] net->host sent 1 packets to 0x7fef1aea1000 437.709226 main [749] poll ok [0] ev 1 0 rx 0@4 tx 1023, [1] ev 1 1 rx 1@3 tx 1022 437.709235 main [749] poll ok [0] ev 5 4 rx 0@4 tx 1023, [1] ev 0 0 rx 1@3 tx 1022 437.709240 process_rings [562] net->host sent 1 packets to 0x7fef1aeaa000 440.211745 main [749] poll timeout [0] ev 1 0 rx 0@4 tx 1023, [1] ev 1 0 rx 0@4 tx 1022 442.714271 main [749] poll timeout [0] ev 1 0 rx 0@4 tx 1023, [1] ev 1 0 rx 0@4 tx 1022 444.026300 main [749] poll timeout [0] ev 1 0 rx 0@4 tx 1023, [1] ev 1 0 rx 0@4 tx 1022 I am wondering if the output looks normal. In particular, is this the expected behavior of the bridge.c example? In addition, how to make the netmap client only send one copy of the packets to the network host stack and how to drop the packets in the netmap client? Do you think the problem is due to the unmodified Myricom driver? Thanks! Best, Xiaoye -- Xiaoye Steven Sun, Ph.D. Student 6100 Main St. MS-366 Department of Electrical and Computer Engineering (ECE) & Department of Computer Science (CS) George R. Brown School of Engineering Rice University, Houston, Texas, USA