sfc: Wrap __efx_rx_packet() with efx_rx_flush_packet()
authorBen Hutchings <bhutchings@solarflare.com>
Tue, 29 Jan 2013 23:33:14 +0000 (23:33 +0000)
committerBen Hutchings <bhutchings@solarflare.com>
Thu, 7 Mar 2013 20:22:08 +0000 (20:22 +0000)
The pipeline mechanism will need to change a bit for scattered
packets.  Add a wrapper to insulate efx_process_channel() from this.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/efx.h
drivers/net/ethernet/sfc/rx.c

index 34b56ec87fba57179e9498b59aeffcf2c0160e4d..f8013c3ea37cd45fefc3e70cba9fcc3f1f7ca91b 100644 (file)
@@ -250,11 +250,7 @@ static int efx_process_channel(struct efx_channel *channel, int budget)
                struct efx_rx_queue *rx_queue =
                        efx_channel_get_rx_queue(channel);
 
-               /* Deliver last RX packet. */
-               if (channel->rx_pkt) {
-                       __efx_rx_packet(channel, channel->rx_pkt);
-                       channel->rx_pkt = NULL;
-               }
+               efx_rx_flush_packet(channel);
                if (rx_queue->enabled)
                        efx_fast_push_rx_descriptors(rx_queue);
        }
index 64c555e493be3943cdf09a0163768fb889db60f1..00e7077fa1d8faec6f0e202372536f8b02f4b444 100644 (file)
@@ -43,6 +43,13 @@ extern void __efx_rx_packet(struct efx_channel *channel,
                            struct efx_rx_buffer *rx_buf);
 extern void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
                          unsigned int len, u16 flags);
+static inline void efx_rx_flush_packet(struct efx_channel *channel)
+{
+       if (channel->rx_pkt) {
+               __efx_rx_packet(channel, channel->rx_pkt);
+               channel->rx_pkt = NULL;
+       }
+}
 extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
 
 #define EFX_MAX_DMAQ_SIZE 4096UL
index 31361db28f9129111ddc187ec82eb5978c026df5..60f4eb7cebc64a7bb8eb901533e55bf8a1b51ba1 100644 (file)
@@ -465,8 +465,7 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
         */
        rx_buf->len = len - efx->type->rx_buffer_hash_size;
 out:
-       if (channel->rx_pkt)
-               __efx_rx_packet(channel, channel->rx_pkt);
+       efx_rx_flush_packet(channel);
        channel->rx_pkt = rx_buf;
 }