dev_queue_xmit() usage

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

 



Dear all,

I'm trying to send a custom build skb. After passing it to the
dev_queue_xmit() i got result NET_XMIT_DROP, but the skb is consumed
already and must be rebuild. What should be done in order to retry the
send without stressing the CPU. ( while (!OK) { rebuild();
dev_queue_xmit() } would be very ugly I think.

Other option would be checking if the netif_queue_stopped() and send
skb's only when there is no congestion, but again - while
(netif_queue_stopped()) schedule() / cpu_relax() / usleep(10) consumes
too much CPU time. Is there any API to get notified when the queue is
free again ? The "Understanding Linux network internals " says that
netif_wake_queue() checks if there is anything in the queues to be
transmitted, but the skb is dropped already. In the comment of the
source code stands that the user can hold reference to the skb and
later reuse it, but in the book stands that BUG() checks if the
reference coutner is 1.  Should I use hard_start_xmit() instead ? Any
idea or example code where the send function waits until the queue is
unlocked will be appreciated - I try to read ip_finish_output2() but
it finishes into the neighboring system where I got stuck in the
virtual functions :). In net/packet/af_packet.c packet_sendmsg_spkt()
sends the packets without any special care about return value from
dev_queue_xmit() and I guess that in this case the user is responsible
for throttling the packets.

Best regards
Ivan
-
To unsubscribe from this list: 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