<div dir="ltr"><div>As far i have read the packet reception i have found out that <br>When working in interrupt driven model, the nic registers an<br>interrupt handler;<br>• This interrupt handler will be called when a frame is received;<br>
• Typically in the handler, we allocate sk buff by calling<br>dev alloc skb();<br>• Copies data from nic’s buffer to this struct just created;<br>• nic call generic reception routine netif rx();<br>• netif rx() put frame in per cpu queue;<br>
• if queue is full, drop!<br><br></div>BUT i didn&#39;t found the netif_rx() in the following link <a href="http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c#L2204">http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c#L2204</a><br>
<div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 7, 2013 at 8:52 PM, Rami Rosen <span dir="ltr">&lt;<a href="mailto:roszenrami@gmail.com" target="_blank">roszenrami@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
we have in :<br>
 <a href="http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c" target="_blank">http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c</a><br>
<br>
struct nic {<br>
        /* Begin: frequently used values: keep adjacent for cache effect */<br>
        u32 msg_enable                          ____cacheline_aligned;<br>
        struct net_device *netdev;<br>
         struct pci_dev *pdev;<br>
     ...<br>
     ...<br>
<br>
And indeed  nic-&gt;netdev represents an Ethernet interface, which<br>
is the struct net_device (see: include/linux/netdevice.h)<br>
<br>
Regards,<br>
Rami Rosen<br>
<a href="http://ramirose.wix.com/ramirosen" target="_blank">http://ramirose.wix.com/ramirosen</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Sun, Apr 7, 2013 at 5:52 AM, ishare &lt;<a href="mailto:june.tune.sea@gmail.com">june.tune.sea@gmail.com</a>&gt; wrote:<br>
&gt; On Fri, Apr 05, 2013 at 03:06:37PM +0300, Rami Rosen wrote:<br>
&gt;&gt; Robert,<br>
&gt;&gt; You should look for the request_irq() method in the driver.<br>
&gt;&gt; This method registers an interrupt handler.<br>
&gt;&gt; For example, you can look in:<br>
&gt;&gt; <a href="http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c" target="_blank">http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e100.c</a><br>
&gt;&gt; ...<br>
&gt;&gt; ...<br>
&gt;&gt;     if ((err = request_irq(nic-&gt;pdev-&gt;irq, e100_intr, IRQF_SHARED,<br>
&gt;&gt;                  nic-&gt;netdev-&gt;name, nic-&gt;netdev)))<br>
&gt;&gt;<br>
&gt;&gt; ...<br>
&gt;&gt;<br>
&gt;&gt; This means that e100_intr is registered as an interrupt handler.<br>
&gt;<br>
&gt;   Is this nic-&gt;netdev represent a  Ethernet interface ?<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Best,<br>
&gt;&gt; Rami Rosen<br>
&gt;&gt; <a href="http://ramirose.wix.com/ramirosen" target="_blank">http://ramirose.wix.com/ramirosen</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Apr 5, 2013 at 11:50 AM, Robert Clove &lt;<a href="mailto:cloverobert@gmail.com">cloverobert@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hello All,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am new here.<br>
&gt;&gt; &gt; I want to know the interrupt handler of the ethernet card and where can i<br>
&gt;&gt; &gt; find the definition of it so as i can clear the flow of packet reception.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks<br>
&gt;&gt; &gt; Robert<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Kernelnewbies mailing list<br>
&gt;&gt; &gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt;&gt; &gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Kernelnewbies mailing list<br>
&gt;&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt;&gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br></div>