From owner-freebsd-net@FreeBSD.ORG Tue Feb 12 17:59:42 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6176616A417 for ; Tue, 12 Feb 2008 17:59:42 +0000 (UTC) (envelope-from tofig@freebsd.az) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.190]) by mx1.freebsd.org (Postfix) with ESMTP id 026B813C447 for ; Tue, 12 Feb 2008 17:59:41 +0000 (UTC) (envelope-from tofig@freebsd.az) Received: by rv-out-0910.google.com with SMTP id g13so3993825rvb.43 for ; Tue, 12 Feb 2008 09:59:41 -0800 (PST) Received: by 10.140.88.11 with SMTP id l11mr1142168rvb.156.1202839181096; Tue, 12 Feb 2008 09:59:41 -0800 (PST) Received: by 10.140.194.14 with HTTP; Tue, 12 Feb 2008 09:59:41 -0800 (PST) Message-ID: <342414370802120959q3c345dc3g9a05863cbc8cd528@mail.gmail.com> Date: Tue, 12 Feb 2008 21:59:41 +0400 From: "Tofig Suleymanov" To: "gnn@freebsd.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47AB2798.6010202@freebsd.az> Cc: net@freebsd.org Subject: Re: if_start() and send queue question X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2008 17:59:42 -0000 On 2/12/08, gnn@freebsd.org wrote: > At Thu, 07 Feb 2008 19:45:28 +0400, > Tofig Suleymanov wrote: > > > > Hello list, > > > > I will be grateful if someone could point me to the right direction > > regarding the question below. > > > > My device driver is getting incoming packets fine, but for some reason I > > am not able to send a single packet. Here is the source code: > > http://www.freebsd.az/if_ib.c > > > > I've added several debug messages to the source and here is the output: > > / > > /(bringing interface up and assigning the ip/netmask combination) > > / > > ifconfig ib0 192.168.0.6 netmask 255.255.255.0 up > > > > /(and here is what I get in /var/log/messages /; /it seems to be a > > standard arp broadcast) > > / > > Feb 7 19:14:32 schizo kernel: ib_init entered > > Feb 7 19:14:32 schizo kernel: ib_start entered > > Feb 7 19:14:32 schizo kernel: ib_encap entered > > Feb 7 19:14:32 schizo kernel: DHOST ff ff ff ff ff ff > > Feb 7 19:14:32 schizo kernel: SHOST 0 c0 ee 22 3 14 > > Feb 7 19:14:32 schizo kernel: txeof entered > > Feb 7 19:14:32 schizo kernel: txeof exiting > > > > /(now I try pinging, but no joy . I've added extra debug messages inside > > ping.c) > > > > /schizo# ping 192.168.0.1 > > PING 192.168.0.1 (192.168.0.1): 56 data bytes > > packets sent: -1 > > ping: sendto: Invalid argument > > packets sent: -1 > > ping: sendto: Invalid argument > > packets sent: -1 > > ping: sendto: Invalid argument > > ^C > > --- 192.168.0.1 ping statistics --- > > 3 packets transmitted, 0 packets received, 100% packet loss > > / > > > > I have also tied to add debug messages to sys/net/if.c and > > sys/net/netisr.c and it seems that the kernel doesn't even try to run my > > ib_start() function. > > > > Some things to try: > > 1) Add debug statements to the ib_start() routine. > > 2) See if bpf works (tcpdump -i ib0) > > 3) Show us the output of: > > ifconfig ib0 > > netstat -i > > Best, > George > Hello George, thanks for you reply. There is a debug output right after beginning of the ib_start() routine. According to it ib_start() is executed only once when I assign an ip address to the interface (it appears to be a so called gratuitous arp who-has request). This routine doesn't execute when I try to ping. I have tried to tcpdump the interface, but hadn't seen any packets while pinging. Please note that tcpdump shows the arp who-has request right after I assign the ip address. ifconfig ib0 shows the following: ib0: flags=1008c3 mtu 1500 inet 192.168.0.5 netmask 0xffffff00 broadcast 192.168.0.255 ether 00:c0:ee:22:03:14 media: Ethernet 10baseT/UTP status: active netstat -in shows the following output: Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll bge0* 1500 00:16:41:52:fb:1e 0 0 0 0 0 iwi0 1500 00:13:ce:cc:b8:10 3065 0 2856 0 0 iwi0 1500 192.168.1 192.168.1.5 3034 - 2825 - - lo0 16384 8 0 8 0 0 lo0 16384 127 127.0.0.1 8 - 8 - - ib0 1500 00:c0:ee:22:03:14 4 0 2 0 0 ib0 1500 192.168.0 192.168.0.5 0 - 3 - - Any ideas ? Thanks, Tofig.