]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/enic/enic_main.c
enic: bug fix: return notify intr credits
[linux-2.6-omap-h63xx.git] / drivers / net / enic / enic_main.c
index d039e16f276355a1552e4b6be6a7aecdf1bd0b66..e9bc79a6f303ee87cb85d0196b4899868a2cd761 100644 (file)
@@ -400,10 +400,13 @@ static irqreturn_t enic_isr_legacy(int irq, void *data)
                return IRQ_NONE;        /* not our interrupt */
        }
 
-       if (ENIC_TEST_INTR(pba, ENIC_INTX_NOTIFY))
+       if (ENIC_TEST_INTR(pba, ENIC_INTX_NOTIFY)) {
+               vnic_intr_return_all_credits(&enic->intr[ENIC_INTX_NOTIFY]);
                enic_notify_check(enic);
+       }
 
        if (ENIC_TEST_INTR(pba, ENIC_INTX_ERR)) {
+               vnic_intr_return_all_credits(&enic->intr[ENIC_INTX_ERR]);
                enic_log_q_error(enic);
                /* schedule recovery from WQ/RQ error */
                schedule_work(&enic->reset);
@@ -411,8 +414,8 @@ static irqreturn_t enic_isr_legacy(int irq, void *data)
        }
 
        if (ENIC_TEST_INTR(pba, ENIC_INTX_WQ_RQ)) {
-               if (netif_rx_schedule_prep(&enic->napi))
-                       __netif_rx_schedule(&enic->napi);
+               if (napi_schedule_prep(&enic->napi))
+                       __napi_schedule(&enic->napi);
        } else {
                vnic_intr_unmask(&enic->intr[ENIC_INTX_WQ_RQ]);
        }
@@ -440,7 +443,7 @@ static irqreturn_t enic_isr_msi(int irq, void *data)
         * writes).
         */
 
-       netif_rx_schedule(&enic->napi);
+       napi_schedule(&enic->napi);
 
        return IRQ_HANDLED;
 }
@@ -450,7 +453,7 @@ static irqreturn_t enic_isr_msix_rq(int irq, void *data)
        struct enic *enic = data;
 
        /* schedule NAPI polling for RQ cleanup */
-       netif_rx_schedule(&enic->napi);
+       napi_schedule(&enic->napi);
 
        return IRQ_HANDLED;
 }
@@ -476,6 +479,8 @@ static irqreturn_t enic_isr_msix_err(int irq, void *data)
 {
        struct enic *enic = data;
 
+       vnic_intr_return_all_credits(&enic->intr[ENIC_MSIX_ERR]);
+
        enic_log_q_error(enic);
 
        /* schedule recovery from WQ/RQ error */
@@ -488,8 +493,8 @@ static irqreturn_t enic_isr_msix_notify(int irq, void *data)
 {
        struct enic *enic = data;
 
+       vnic_intr_return_all_credits(&enic->intr[ENIC_MSIX_NOTIFY]);
        enic_notify_check(enic);
-       vnic_intr_unmask(&enic->intr[ENIC_MSIX_NOTIFY]);
 
        return IRQ_HANDLED;
 }
@@ -570,11 +575,11 @@ static inline void enic_queue_wq_skb_tso(struct enic *enic,
         * to each TCP segment resulting from the TSO.
         */
 
-       if (skb->protocol == __constant_htons(ETH_P_IP)) {
+       if (skb->protocol == cpu_to_be16(ETH_P_IP)) {
                ip_hdr(skb)->check = 0;
                tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
                        ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0);
-       } else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
+       } else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) {
                tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
                        &ipv6_hdr(skb)->daddr, 0, IPPROTO_TCP, 0);
        }
@@ -616,7 +621,7 @@ static inline void enic_queue_wq_skb(struct enic *enic,
                        vlan_tag_insert, vlan_tag);
 }
 
-/* netif_tx_lock held, process context with BHs disabled */
+/* netif_tx_lock held, process context with BHs disabled, or BH */
 static int enic_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
        struct enic *enic = netdev_priv(netdev);
@@ -1068,8 +1073,8 @@ static int enic_poll(struct napi_struct *napi, int budget)
                if (netdev->features & NETIF_F_LRO)
                        lro_flush_all(&enic->lro_mgr);
 
-               netif_rx_complete(napi);
-               vnic_intr_unmask(&enic->intr[ENIC_MSIX_RQ]);
+               napi_complete(napi);
+               vnic_intr_unmask(&enic->intr[ENIC_INTX_WQ_RQ]);
        }
 
        return rq_work_done;
@@ -1095,9 +1100,9 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)
 
                vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);
 
-               /* Accumulate intr event credits for this polling
+               /* Return intr event credits for this polling
                 * cycle.  An intr event is the completion of a
-                * a WQ or RQ packet.
+                * RQ packet.
                 */
 
                vnic_intr_return_credits(&enic->intr[ENIC_MSIX_RQ],
@@ -1112,7 +1117,7 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)
                if (netdev->features & NETIF_F_LRO)
                        lro_flush_all(&enic->lro_mgr);
 
-               netif_rx_complete(napi);
+               napi_complete(napi);
                vnic_intr_unmask(&enic->intr[ENIC_MSIX_RQ]);
        }
 
@@ -1599,6 +1604,7 @@ static const struct net_device_ops enic_netdev_ops = {
        .ndo_start_xmit         = enic_hard_start_xmit,
        .ndo_get_stats          = enic_get_stats,
        .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
        .ndo_set_multicast_list = enic_set_multicast_list,
        .ndo_change_mtu         = enic_change_mtu,
        .ndo_vlan_rx_register   = enic_vlan_rx_register,