From a7ef59332b33cb1924ea76cce2aa620a32bb0d7a Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 4 Mar 2009 09:52:37 +0000 Subject: sfc: Reject packets from the kernel TX queue during a loopback self-test Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller --- drivers/net/sfc/tx.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/sfc/tx.c') diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index da3e9ff339f..9f97e44840b 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c @@ -376,6 +376,9 @@ int efx_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) struct efx_nic *efx = netdev_priv(net_dev); struct efx_tx_queue *tx_queue; + if (unlikely(efx->port_inhibited)) + return NETDEV_TX_BUSY; + if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) tx_queue = &efx->tx_queue[EFX_TX_QUEUE_OFFLOAD_CSUM]; else -- cgit v1.2.3 From 32d760073eacd41ecc815db1e958f0e1e0b82d57 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 4 Mar 2009 09:53:15 +0000 Subject: sfc: Don't wake TX queues while they're being flushed Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller --- drivers/net/sfc/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/sfc/tx.c') diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 9f97e44840b..b1e19077907 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c @@ -400,7 +400,7 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) * separates the update of read_count from the test of * stopped. */ smp_mb(); - if (unlikely(tx_queue->stopped)) { + if (unlikely(tx_queue->stopped) && likely(efx->port_enabled)) { fill_level = tx_queue->insert_count - tx_queue->read_count; if (fill_level < EFX_NETDEV_TX_THRESHOLD(tx_queue)) { EFX_BUG_ON_PARANOID(!efx_dev_registered(efx)); -- cgit v1.2.3 From bb145a9e28c32a37f35308bb32180b59e358a3a1 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 20 Mar 2009 13:25:39 +0000 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/sfc/tx.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/net/sfc/tx.c') diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index b1e19077907..d6681edb701 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, /* Get size of the initial fragment */ len = skb_headlen(skb); + /* Pad if necessary */ + if (EFX_WORKAROUND_15592(efx) && skb->len <= 32) { + EFX_BUG_ON_PARANOID(skb->data_len); + len = 32 + 1; + if (skb_pad(skb, len - skb->len)) + return NETDEV_TX_OK; + } + fill_level = tx_queue->insert_count - tx_queue->old_read_count; q_space = efx->type->txd_ring_mask - 1 - fill_level; -- cgit v1.2.3