Re: OS throws away large packets

2008-05-06 Thread Mr Y

Hi all,
  
   I'm trying to implement Large Recieve Offload for an
  
   Ethernet driver
  
   on FreeBSD 6.3, but all my MTU packets are being thrown
  by the OS.
   I'm using mbuf chains in this imlpementation, each mbuf is
  
   a cluster
  
   of MCLBYTES bytes. They are linked by the m_next pointer.
   The first packet being thrown away is 2945 bytes long.
  
   Wireshark shows
  
   the packet that is being passed to the OS is correct.
  
   Do I need to set some OS parameter to make it recieve mbuf chains?
  
   Please help.
  
  
   Hi Yony,
  
   I seem to remember some discussion about this list last
  year see the
   following threads:
  
  
  
  
 
 http://lists.freebsd.org/pipermail/freebsd-net/2007-September/015250.htm
 l
  
  
 
 http://lists.freebsd.org/pipermail/freebsd-net/2007-September/015350.htm
 l
  
   From my limited reading of these threads just now and possibly bad
   memory.  It would seem that the MRU to MTU relationship is
  defined in
   the nic driver rather than
  
   enforced further up the stack or at least that seamed to
  be the case
  
   with the bce driver.
  
   Hope this is helpful,
  
   Tom
  
  
   Hi Tom,
  
   From what I understand these threads are referring to the bce
   hardware
   configuration (bus configuration) and driver mbuf
  allocation size. Am
   I correct?
   In my case I'm not trying to receive packets MTU from the
  HW, but to
   chain mbuf clusters, each is MCLBYTES long, and pass the
  mbuf chain to
   the OS.
   Since tcpdump (analyzed by wireshark) catches the packets above the
   driver and reports a good packet (and 2945 bytes long), I assume my
   driver functionality is ok. From what I know tcpdump is supposed to
   immitate the way the stack sees the packet, yet it is discarded.
   My logic says there is an OS parameter handled by the
  driver (at net
   device init time for example) that will set the OS to receive large
   mbuf chains, or a kernel tcp parameter. Is the tcp stack
  submitted to
   the mtu somehow?
  
  
  I don't see where you've identified what version of the os you're
  working with.  There's a check in the 802.3 input path on earlier
  systems to discard frames mtu.  This was removed not too long ago
  with LRO in mind; check the history of sys/net/if_ethersubr.c.
 
  Sam
 

 Hi Sam, I have mentioned working on 6.3.

 FreeBSD 6.2 had this check in if_ethersubr.c / ether_input:

 539 if (m-m_pkthdr.len 
 540 ETHER_MAX_FRAME(ifp, etype, m-m_flags  M_HASFCS)) {
 541 if_printf(ifp, discard oversize frame 
 542 (ether type %x flags %x len %u 
 max %lu)\n,
 543 etype, m-m_flags, m-m_pkthdr.len,
 544 ETHER_MAX_FRAME(ifp, etype,
 545 m-m_flags 
 M_HASFCS));
 546 ifp-if_ierrors++;
 547 m_freem(m);
 548 return;
 549 }

 Patching it was explained by neterion in
 http://trac.neterion.com/cgi-bin/trac.cgi/wiki/FreeBSD.
 This check no longer exists in 6.3, nor any other oversize packet
 handling (I couldn't find any so far).
 I also get no error prints from the OS.


The problem was in my packet, after I put some traces in netinet/ip_input.c
I found out my m_pkthdr.len was not properly updated.

Thanks
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


OS throws away large packets

2008-04-28 Thread Mr Y
Hi all,

I'm trying to implement Large Recieve Offload for an Ethernet driver on
FreeBSD 6.3, but all my MTU packets are being thrown by the OS.
I'm using mbuf chains in this imlpementation, each mbuf is a cluster of
MCLBYTES bytes. They are linked by the m_next pointer.
The first packet being thrown away is 2945 bytes long. Wireshark shows the
packet that is being passed to the OS is correct.

Do I need to set some OS parameter to make it recieve mbuf chains?

Please help.

- Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


MSI-X on FreeBSD 6.3

2008-04-17 Thread Mr Y
i'm having problems enabling MSI-X for my Ethernet driver on 6.3.

my problem is that pci_msix_count(dev) returns 0, as if my device does not
support MSI-X.

where should I publish my device's MSI-X capabilities?

Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


mbuf chains / records in networking

2008-04-15 Thread Mr Y
I'm porting an Ethernet driver LRO mechanism (Large Recieve Offload) from
Linux to FreeBSD.

I learned a bit about mbuf chains and records, but i couldn't understand
whether the OS is capable of eating a whole mbuf record (mbuf linked using
m_cat, by their m_nextpkt pointer) on the RX side.

Can I simply concat my incoming network mbufs, each one with his own TCP/IP
headers, and push the whole record up the stack in one operation?
or should I strip all the packets and build a single TCP/IP header in the
first mbuf before I push the record up?

Thanks
-Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


tcp tuning and oprofile

2008-04-13 Thread Mr Y
Hello,

I'm trying to improve my 10GigE driver performance on FreeBSD 6.3.
till now I found the following tcp parameters and set them:
# sysctl net.inet.tcp.sack.enable=0
# sysctl kern.ipc.maxsockbuf=16777216
is there anything else I should think about regarding tcp parameters?

2nd question:

I'm getting quite a high cpu utilization, about 75% for an iperf test.
I'm looking for a tool such as oprofile that will help me find the problem.
does anybody know something like that?

Thanks,
-Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


working with kdb/ddb

2008-04-09 Thread Mr Y
Hi,

 i'm trying to extract some memory values of my variables, but the debugger
doesn't know any of my variables, saying unknown symbol or something like
that.
i get the function names in the 'trace' though, so the symbols are there.

does anybody know how to read the variables after the crash?

e.g.

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x1
fault code  = supervisor read data, page not present
instruction pointer = 0x8:0x806b0b17
stack pointer   = 0x10:0xbc17eae0
frame pointer   = 0x10:0xbc17eb20
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 1269 (mtnic0 taskq)
[thread pid 1269 tid 100087 ]
Stopped at  _bus_dmamap_unload+0x17:movq(%rsi),%rax
db trace
Tracing pid 1269 tid 100087 td 0xff00beaf3be0
_bus_dmamap_unload() at _bus_dmamap_unload+0x17
mtnic_free_pages() at mtnic_free_pages+0x5c
mtnic_init_nic() at mtnic_init_nic+0xa5
mtnic_restart_nic() at mtnic_restart_nic+0xa3
taskqueue_run() at taskqueue_run+0xd7
taskqueue_thread_loop() at taskqueue_thread_loop+0x85
fork_exit() at fork_exit+0x86
fork_trampoline() at fork_trampoline+0xe
--- trap 0, rip = 0, rsp = 0xbc17ed00, rbp = 0 ---
db
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Does FreeBSD 6.3 network support TSO/LSO?

2008-04-07 Thread Mr Y
Sorry about that man.

On Mon, Apr 7, 2008 at 5:32 PM, Jerry McAllister [EMAIL PROTECTED] wrote:

 On Sun, Apr 06, 2008 at 05:54:37PM +0300, Mr Y wrote:


 Where is your message?

 It is impolite to just stick something in a subject line and
 fail to put the information or question in the body of the message.

 In addition, many Email readers do not repeat the subject while
 displaying the message body.So, now to see what you were asking,
 I have to get back out of the reply and look at the subject and
 then get back in to the edit to respond.   Forget it, I don't
 have time for that.

 jerry


  Thanks,
 
  Yony
  ___
  freebsd-questions@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/freebsd-questions
  To unsubscribe, send any mail to 
 [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Does FreeBSD 6.3 network support TSO/LSO?

2008-04-06 Thread Mr Y
Thanks,

Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: kldload: unexpected relocation type 10

2008-04-06 Thread Mr Y

 I really don't know how to get rid of this message..
  
   I get millions of these during kldload of a driver:
  
   kldload: unexpected relocation type 10
  
   can't see anything wrong with my Makefile, like the google threads
 say,
  so
   PLEASE HELP.
 
  The kernel module was built along with the kernel?
 
 
  No, seperately.
 
 
 
  Does it matter which module, or are you getting this with any loadable
  module?
 
 
  didn't try any other module, this driver is my first work with FreeBSD..

 I see.  I had not understood that the module was something you were
 writing.

 You might want to try freebsd-hackers.  I'm a bit out of date on
 kernel coding (in fact, I thought that relocations weren't needed any
 more, at least on new platforms).


I suddenly noticed that this message appears only when I'm compiling in
debug mode, meaning I'm adding the -g flag plus some -DMY_OWN_DEBUG_DEFINES
to the compilation.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: kldload: unexpected relocation type 10

2008-04-02 Thread Mr Y

   I really don't know how to get rid of this message..
 
  I get millions of these during kldload of a driver:
 
  kldload: unexpected relocation type 10
 
  can't see anything wrong with my Makefile, like the google threads say,
 so
  PLEASE HELP.

 The kernel module was built along with the kernel?


No, seperately.



 Does it matter which module, or are you getting this with any loadable
 module?


didn't try any other module, this driver is my first work with FreeBSD..
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


kldload: unexpected relocation type 10

2008-04-01 Thread Mr Y
Hi,

I really don't know how to get rid of this message..

I get millions of these during kldload of a driver:

kldload: unexpected relocation type 10

can't see anything wrong with my Makefile, like the google threads say, so
PLEASE HELP.

Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bus_dmamem_alloc

2008-03-23 Thread Mr Y
Hi Mark,
Actualy I'm not getting any error from bus_dmamem_alloc, that's the strange
thing.
Yet printing the dma_map pointer shows 0 unless I use bus_dmamap_create
after bus_dmamem_alloc.
bus_mamap_load doesn't fail in both cases.

I'm working on an Ethernet driver for FreeBSD, pinging messages larger than
MTU crash the kernel at some point, I'm investigating the dma direction at
the moment.

--Yony


On Thu, Mar 20, 2008 at 7:29 PM, Mark Tinguely [EMAIL PROTECTED]
wrote:

   so I'm running:
 
   err =
   bus_dmamem_alloc(ring-dma_tag, ring-buf,
   BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, ring-dma_map);
 
   but after calling bus_dmamem_allloc the dma_map variable is still NULL.
 is
   this OK?

 Sure, you are allocating with BUS_DMA_NOWAIT. err is probably equal to
 ENOMEM.

 If allocation size is larger than a PAGE_SIZE or specific alignment is
 require then contigmalloc() is called to satisfy the allocation.
 contigmalloc() can fail even when specifying WAITOK.

 --Mark Tinguely.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


bus_dmamem_alloc

2008-03-20 Thread Mr Y
I'm trying to use bus_dmamem_alloc. The function man says:

/*
 * Allocate a piece of memory that can be efficiently mapped into
 * bus device space based on the constraints listed in the dma tag.
 * A dmamap to for use with dmamap_load is also allocated.
 */

so I'm running:

err =
bus_dmamem_alloc(ring-dma_tag, ring-buf,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, ring-dma_map);

but after calling bus_dmamem_allloc the dma_map variable is still NULL. is
this OK?

Thx, Yony
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]