diff options
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 8ea72dc60f79..91191f761fba 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -1436,18 +1436,32 @@ static void ql_process_mac_rx_intr(struct ql_adapter *qdev, | |||
1436 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) { | 1436 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) { |
1437 | QPRINTK(qdev, RX_STATUS, DEBUG, "Promiscuous Packet.\n"); | 1437 | QPRINTK(qdev, RX_STATUS, DEBUG, "Promiscuous Packet.\n"); |
1438 | } | 1438 | } |
1439 | if (ib_mac_rsp->flags1 & (IB_MAC_IOCB_RSP_IE | IB_MAC_IOCB_RSP_TE)) { | 1439 | |
1440 | QPRINTK(qdev, RX_STATUS, ERR, | 1440 | skb->protocol = eth_type_trans(skb, ndev); |
1441 | "Bad checksum for this %s packet.\n", | 1441 | skb->ip_summed = CHECKSUM_NONE; |
1442 | ((ib_mac_rsp-> | 1442 | |
1443 | flags2 & IB_MAC_IOCB_RSP_T) ? "TCP" : "UDP")); | 1443 | /* If rx checksum is on, and there are no |
1444 | skb->ip_summed = CHECKSUM_NONE; | 1444 | * csum or frame errors. |
1445 | } else if (qdev->rx_csum && | 1445 | */ |
1446 | ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) || | 1446 | if (qdev->rx_csum && |
1447 | ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) && | 1447 | !(ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) && |
1448 | !(ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_NU)))) { | 1448 | !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) { |
1449 | QPRINTK(qdev, RX_STATUS, DEBUG, "RX checksum done!\n"); | 1449 | /* TCP frame. */ |
1450 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1450 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) { |
1451 | QPRINTK(qdev, RX_STATUS, DEBUG, | ||
1452 | "TCP checksum done!\n"); | ||
1453 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
1454 | } else if ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) && | ||
1455 | (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_V4)) { | ||
1456 | /* Unfragmented ipv4 UDP frame. */ | ||
1457 | struct iphdr *iph = (struct iphdr *) skb->data; | ||
1458 | if (!(iph->frag_off & | ||
1459 | cpu_to_be16(IP_MF|IP_OFFSET))) { | ||
1460 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
1461 | QPRINTK(qdev, RX_STATUS, DEBUG, | ||
1462 | "TCP checksum done!\n"); | ||
1463 | } | ||
1464 | } | ||
1451 | } | 1465 | } |
1452 | qdev->stats.rx_packets++; | 1466 | qdev->stats.rx_packets++; |
1453 | qdev->stats.rx_bytes += skb->len; | 1467 | qdev->stats.rx_bytes += skb->len; |
@@ -1927,6 +1941,9 @@ static int qlge_send(struct sk_buff *skb, struct net_device *ndev) | |||
1927 | 1941 | ||
1928 | tx_ring = &qdev->tx_ring[tx_ring_idx]; | 1942 | tx_ring = &qdev->tx_ring[tx_ring_idx]; |
1929 | 1943 | ||
1944 | if (skb_padto(skb, ETH_ZLEN)) | ||
1945 | return NETDEV_TX_OK; | ||
1946 | |||
1930 | if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) { | 1947 | if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) { |
1931 | QPRINTK(qdev, TX_QUEUED, INFO, | 1948 | QPRINTK(qdev, TX_QUEUED, INFO, |
1932 | "%s: shutting down tx queue %d du to lack of resources.\n", | 1949 | "%s: shutting down tx queue %d du to lack of resources.\n", |
@@ -2970,9 +2987,9 @@ static int ql_adapter_initialize(struct ql_adapter *qdev) | |||
2970 | mask = value << 16; | 2987 | mask = value << 16; |
2971 | ql_write32(qdev, SYS, mask | value); | 2988 | ql_write32(qdev, SYS, mask | value); |
2972 | 2989 | ||
2973 | /* Set the default queue. */ | 2990 | /* Set the default queue, and VLAN behavior. */ |
2974 | value = NIC_RCV_CFG_DFQ; | 2991 | value = NIC_RCV_CFG_DFQ | NIC_RCV_CFG_RV; |
2975 | mask = NIC_RCV_CFG_DFQ_MASK; | 2992 | mask = NIC_RCV_CFG_DFQ_MASK | (NIC_RCV_CFG_RV << 16); |
2976 | ql_write32(qdev, NIC_RCV_CFG, (mask | value)); | 2993 | ql_write32(qdev, NIC_RCV_CFG, (mask | value)); |
2977 | 2994 | ||
2978 | /* Set the MPI interrupt to enabled. */ | 2995 | /* Set the MPI interrupt to enabled. */ |
@@ -3149,6 +3166,11 @@ static int ql_adapter_down(struct ql_adapter *qdev) | |||
3149 | 3166 | ||
3150 | ql_tx_ring_clean(qdev); | 3167 | ql_tx_ring_clean(qdev); |
3151 | 3168 | ||
3169 | /* Call netif_napi_del() from common point. | ||
3170 | */ | ||
3171 | for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++) | ||
3172 | netif_napi_del(&qdev->rx_ring[i].napi); | ||
3173 | |||
3152 | spin_lock(&qdev->hw_lock); | 3174 | spin_lock(&qdev->hw_lock); |
3153 | status = ql_adapter_reset(qdev); | 3175 | status = ql_adapter_reset(qdev); |
3154 | if (status) | 3176 | if (status) |
@@ -3853,7 +3875,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3853 | { | 3875 | { |
3854 | struct net_device *ndev = pci_get_drvdata(pdev); | 3876 | struct net_device *ndev = pci_get_drvdata(pdev); |
3855 | struct ql_adapter *qdev = netdev_priv(ndev); | 3877 | struct ql_adapter *qdev = netdev_priv(ndev); |
3856 | int err, i; | 3878 | int err; |
3857 | 3879 | ||
3858 | netif_device_detach(ndev); | 3880 | netif_device_detach(ndev); |
3859 | 3881 | ||
@@ -3863,9 +3885,6 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3863 | return err; | 3885 | return err; |
3864 | } | 3886 | } |
3865 | 3887 | ||
3866 | for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++) | ||
3867 | netif_napi_del(&qdev->rx_ring[i].napi); | ||
3868 | |||
3869 | err = pci_save_state(pdev); | 3888 | err = pci_save_state(pdev); |
3870 | if (err) | 3889 | if (err) |
3871 | return err; | 3890 | return err; |