Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - m_buf allocation for Rx: (3 Items)
   
m_buf allocation for Rx  
Hi,
I am implementing a net-driver for testing purpose. This is based on sam.c (sample network driver).
But instead of using interrupts for looping back the packets, they are looped back by another process in my setup.
Tx part is done, but in Rx I have some difficulties -
1.      Can timer interrupt be replaced by Signal? I mean whenever io-pkt net-driver would receive SIG_USR1, Rx routine 
is triggered. Is this valid approach?
2.      How do I allocate/get m_buf from io-pkt rx thread pool? Sample net-driver uses -
      m = m_getcl_wtp(M_DONTWAIT, MT_DATA, M_PKTHDR, wtp);
But in this case I don't have wtp.

How this situation could be resolved?

Any help is much appreciated. Thanks!

Cheers,
Pratik



Re: m_buf allocation for Rx  
On Wed, Jan 18, 2012 at 09:02:52AM -0500, Pratik Khade wrote:
> Hi,
> I am implementing a net-driver for testing purpose. This is based on sam.c (sample network driver).
> But instead of using interrupts for looping back the packets, they are looped back by another process in my setup.
> Tx part is done, but in Rx I have some difficulties -
> 1.      Can timer interrupt be replaced by Signal? I mean whenever io-pkt net-driver would receive SIG_USR1, Rx 
routine is triggered. Is this valid approach?

No.

> 2.      How do I allocate/get m_buf from io-pkt rx thread pool? Sample net-driver uses -
>       m = m_getcl_wtp(M_DONTWAIT, MT_DATA, M_PKTHDR, wtp);

Use m_getcl().

> But in this case I don't have wtp.
> 
> How this situation could be resolved?
> 
> Any help is much appreciated. Thanks!
> 
> Cheers,
> Pratik
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> Networking Drivers
> http://community.qnx.com/sf/go/post90977
> 
RE: m_buf allocation for Rx  
Hi,

The reason to have this kind of mechanism is, we are using shared memory for L1 driver and there is different kind of 
traffic that is sent over L1, IP being one of them.
So our process has to identify what is the type of traffic and if it is IP then it forwards it to Network driver.
What can be done in this case? Could it be possible to trigger a Software Interrupt? Could you please help with some 
pointers?

Thanks,
Pratik



-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: 18 January, 2012 19:45
To: drivers-networking
Subject: Re: m_buf allocation for Rx

On Wed, Jan 18, 2012 at 09:02:52AM -0500, Pratik Khade wrote:
> Hi,
> I am implementing a net-driver for testing purpose. This is based on sam.c (sample network driver).
> But instead of using interrupts for looping back the packets, they are looped back by another process in my setup.
> Tx part is done, but in Rx I have some difficulties -
> 1.      Can timer interrupt be replaced by Signal? I mean whenever io-pkt net-driver would receive SIG_USR1, Rx 
routine is triggered. Is this valid approach?

No.

> 2.      How do I allocate/get m_buf from io-pkt rx thread pool? Sample net-driver uses -
>       m = m_getcl_wtp(M_DONTWAIT, MT_DATA, M_PKTHDR, wtp);

Use m_getcl().

> But in this case I don't have wtp.
> 
> How this situation could be resolved?
> 
> Any help is much appreciated. Thanks!
> 
> Cheers,
> Pratik
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> Networking Drivers
> http://community.qnx.com/sf/go/post90977
> 



_______________________________________________

Networking Drivers
http://community.qnx.com/sf/go/post90978