diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-03-20 09:25:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-21 22:06:55 -0400 |
commit | bb145a9e28c32a37f35308bb32180b59e358a3a1 (patch) | |
tree | fae2b23b306e31aa4264eee1a3085daf5158a853 /drivers/net/sfc/tx.c | |
parent | e84665c9cb4db963393fafad6fefe5efdd7e4a09 (diff) |
sfc: Pad packets to 33 bytes to prevent TX packet parser lockup
The packet parser used in the TX data path for locating checksum
fields can lose synchronisation with the TX queue manager when
handling packets that look like IPv4 but are too short (17-32 bytes).
Work around this by padding to 33 bytes.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/tx.c')
-rw-r--r-- | drivers/net/sfc/tx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index b1e190779073..d6681edb7014 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -162,6 +162,14 @@ static int efx_enqueue_skb(struct efx_tx_queue *tx_queue, | |||
162 | /* Get size of the initial fragment */ | 162 | /* Get size of the initial fragment */ |
163 | len = skb_headlen(skb); | 163 | len = skb_headlen(skb); |
164 | 164 | ||
165 | /* Pad if necessary */ | ||
166 | if (EFX_WORKAROUND_15592(efx) && skb->len <= 32) { | ||
167 | EFX_BUG_ON_PARANOID(skb->data_len); | ||
168 | len = 32 + 1; | ||
169 | if (skb_pad(skb, len - skb->len)) | ||
170 | return NETDEV_TX_OK; | ||
171 | } | ||
172 | |||
165 | fill_level = tx_queue->insert_count - tx_queue->old_read_count; | 173 | fill_level = tx_queue->insert_count - tx_queue->old_read_count; |
166 | q_space = efx->type->txd_ring_mask - 1 - fill_level; | 174 | q_space = efx->type->txd_ring_mask - 1 - fill_level; |
167 | 175 | ||