aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@marvell.com>2008-11-20 06:58:46 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 06:58:46 -0500
commitf61e5547763338b793ed291f3de3130216d00430 (patch)
treea797f1b73ad2f6a596be7cef845c67cb086a2e5b
parent66e63ffbc04706568d8789cbb00eaa8ddbcae648 (diff)
mv643xx_eth: move receive error handling out of line
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/mv643xx_eth.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 9f3ee7d6a5bc..d56724add175 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -543,35 +543,38 @@ static int rxq_process(struct rx_queue *rxq, int budget)
543 * on, or the error summary bit is set, the packet needs 543 * on, or the error summary bit is set, the packet needs
544 * to be dropped. 544 * to be dropped.
545 */ 545 */
546 if (((cmd_sts & (RX_FIRST_DESC | RX_LAST_DESC)) != 546 if ((cmd_sts & (RX_FIRST_DESC | RX_LAST_DESC | ERROR_SUMMARY))
547 (RX_FIRST_DESC | RX_LAST_DESC)) 547 != (RX_FIRST_DESC | RX_LAST_DESC))
548 || (cmd_sts & ERROR_SUMMARY)) { 548 goto err;
549 stats->rx_dropped++;
550
551 if ((cmd_sts & (RX_FIRST_DESC | RX_LAST_DESC)) !=
552 (RX_FIRST_DESC | RX_LAST_DESC)) {
553 if (net_ratelimit())
554 dev_printk(KERN_ERR, &mp->dev->dev,
555 "received packet spanning "
556 "multiple descriptors\n");
557 }
558 549
559 if (cmd_sts & ERROR_SUMMARY) 550 /*
560 stats->rx_errors++; 551 * The -4 is for the CRC in the trailer of the
552 * received packet
553 */
554 skb_put(skb, byte_cnt - 2 - 4);
561 555
562 dev_kfree_skb(skb); 556 if (cmd_sts & LAYER_4_CHECKSUM_OK)
563 } else { 557 skb->ip_summed = CHECKSUM_UNNECESSARY;
564 /* 558 skb->protocol = eth_type_trans(skb, mp->dev);
565 * The -4 is for the CRC in the trailer of the 559 netif_receive_skb(skb);
566 * received packet 560
567 */ 561 continue;
568 skb_put(skb, byte_cnt - 2 - 4); 562
569 563err:
570 if (cmd_sts & LAYER_4_CHECKSUM_OK) 564 stats->rx_dropped++;
571 skb->ip_summed = CHECKSUM_UNNECESSARY; 565
572 skb->protocol = eth_type_trans(skb, mp->dev); 566 if ((cmd_sts & (RX_FIRST_DESC | RX_LAST_DESC)) !=
573 netif_receive_skb(skb); 567 (RX_FIRST_DESC | RX_LAST_DESC)) {
568 if (net_ratelimit())
569 dev_printk(KERN_ERR, &mp->dev->dev,
570 "received packet spanning "
571 "multiple descriptors\n");
574 } 572 }
573
574 if (cmd_sts & ERROR_SUMMARY)
575 stats->rx_errors++;
576
577 dev_kfree_skb(skb);
575 } 578 }
576 579
577 if (rx < budget) 580 if (rx < budget)