mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user