Using NAPI for a new driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm implementing a new network driver.  In reading other drivers and
the documentation, I'm finding that there is a new (-er) interface
that is recommended.

The target is an embedded MAC of an ARM7 CPU with an integrated DMA
controller.

  1) Is there any reason not mentioned in the HOWTO for not
     implementing NAPI?

  2) I've read that it is a bad idea to hang-on to SKBs.  With DMA
     this CPU can eliminate the packet copying, but that means that
     the receive queue will have SKBs laying around.  Is this
     acceptable?

  3) In the prerequisites (from the HOWTO)

      B) Ability to turn off interrupts or maybe events that send
	 packets up the stack.

     What does this sentence mean?

  4) I'm presently DMAing into an SKB.  While there are other
     problems that challeng the driver, it looks like buffers are
     not being properly received by netif.

     Here's what I'm doing when a packet comes in: 

   struct sk_buff* skb = emac->rg_rx_skb[emac->head_rx];
   size_t packet_len = emac->rg_rx_descriptor[emac->head_rx *2+1] & 0x7ff;
   net_d->last_rx = jiffies;
   skb->protocol = eth_type_trans (skb, net_d);
   skb_put (skb, packet_len);
   PRINT_PKT (skb->data, packet_len > 64 ? 64 : packet_len);
   netif_rx (skb);

     I've not found a good example.  Is this right using the old interface?

Cheers.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux