diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-03-05 20:13:54 +0000 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-03-07 20:21:54 +0000 |
commit | 4a74dc65e3ad825a66dfbcb256f98c550f96445b (patch) | |
tree | 97f5e5ef4efaf339c59de29f1ac1475af398508b /drivers/net/ethernet/sfc/rx.c | |
parent | 86c2da58a70e02ece910a3bba3da86d61b6aeefd (diff) |
sfc: Allow efx_channel_type::receive_skb() to reject a packet
Instead of having efx_ptp_rx() call netif_receive_skb() for an invalid
PTP packet, make it return false for rejected packets and have
efx_rx_deliver() pass them up.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/rx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index bb579a6128c8..f31c23ea2a07 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -575,12 +575,14 @@ static void efx_rx_deliver(struct efx_channel *channel, /* Record the rx_queue */ skb_record_rx_queue(skb, channel->rx_queue.core_index); - /* Pass the packet up */ if (channel->type->receive_skb) - channel->type->receive_skb(channel, skb); - else - netif_receive_skb(skb); + if (channel->type->receive_skb(channel, skb)) + goto handled; + + /* Pass the packet up */ + netif_receive_skb(skb); +handled: /* Update allocation strategy method */ channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB; } |