]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/sfc/rx.c
[netdrvr] sfc: sfc: Add self-test support
[linux-2.6-omap-h63xx.git] / drivers / net / sfc / rx.c
index 9fd198442e8d756c28dd4078ae5bf1dc2d63d9c5..670622373ddf027b1456ad17b69132331332396f 100644 (file)
@@ -19,6 +19,7 @@
 #include "rx.h"
 #include "efx.h"
 #include "falcon.h"
+#include "selftest.h"
 #include "workarounds.h"
 
 /* Number of RX descriptors pushed at once. */
@@ -683,6 +684,15 @@ void __efx_rx_packet(struct efx_channel *channel,
        struct sk_buff *skb;
        int lro = efx->net_dev->features & NETIF_F_LRO;
 
+       /* If we're in loopback test, then pass the packet directly to the
+        * loopback layer, and free the rx_buf here
+        */
+       if (unlikely(efx->loopback_selftest)) {
+               efx_loopback_rx_packet(efx, rx_buf->data, rx_buf->len);
+               efx_free_rx_buffer(efx, rx_buf);
+               goto done;
+       }
+
        if (rx_buf->skb) {
                prefetch(skb_shinfo(rx_buf->skb));