aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-26 18:54:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-26 18:54:36 -0400
commit13220a94d35708d5378114e96ffcc88d0a74fe99 (patch)
treebe6530677d5f9536c7211e05ba012923e4c0b307 /drivers/infiniband/hw
parent8690d8a9f6c2d5728a9c9f68231f1bb4de109e3a (diff)
parent08abe18af1f78ee80c3c3a5ac47c3e0ae0beadf6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1750 commits) ixgbe: Allow Priority Flow Control settings to survive a device reset net: core: remove unneeded include in net/core/utils.c. e1000e: update version number e1000e: fix close interrupt race e1000e: fix loss of multicast packets e1000e: commonize tx cleanup routine to match e1000 & igb netfilter: fix nf_logger name in ebt_ulog. netfilter: fix warning in ebt_ulog init function. netfilter: fix warning about invalid const usage e1000: fix close race with interrupt e1000: cleanup clean_tx_irq routine so that it completely cleans ring e1000: fix tx hang detect logic and address dma mapping issues bridge: bad error handling when adding invalid ether address bonding: select current active slave when enslaving device for mode tlb and alb gianfar: reallocate skb when headroom is not enough for fcb Bump release date to 25Mar2009 and version to 0.22 r6040: Fix second PHY address qeth: fix wait_event_timeout handling qeth: check for completion of a running recovery qeth: unregister MAC addresses during recovery. ... Manually fixed up conflicts in: drivers/infiniband/hw/cxgb3/cxio_hal.h drivers/infiniband/hw/nes/nes_nic.c
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/amso1100/c2.c41
-rw-r--r--drivers/infiniband/hw/amso1100/c2.h2
-rw-r--r--drivers/infiniband/hw/amso1100/c2_provider.c22
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c3
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.h2
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch.c15
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c2
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c31
8 files changed, 68 insertions, 50 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 113f3c03c5b5..7d79aa361e26 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -76,7 +76,6 @@ static irqreturn_t c2_interrupt(int irq, void *dev_id);
76static void c2_tx_timeout(struct net_device *netdev); 76static void c2_tx_timeout(struct net_device *netdev);
77static int c2_change_mtu(struct net_device *netdev, int new_mtu); 77static int c2_change_mtu(struct net_device *netdev, int new_mtu);
78static void c2_reset(struct c2_port *c2_port); 78static void c2_reset(struct c2_port *c2_port);
79static struct net_device_stats *c2_get_stats(struct net_device *netdev);
80 79
81static struct pci_device_id c2_pci_table[] = { 80static struct pci_device_id c2_pci_table[] = {
82 { PCI_DEVICE(0x18b8, 0xb001) }, 81 { PCI_DEVICE(0x18b8, 0xb001) },
@@ -349,7 +348,7 @@ static void c2_tx_clean(struct c2_port *c2_port)
349 elem->hw_desc + C2_TXP_ADDR); 348 elem->hw_desc + C2_TXP_ADDR);
350 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_DONE), 349 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_DONE),
351 elem->hw_desc + C2_TXP_FLAGS); 350 elem->hw_desc + C2_TXP_FLAGS);
352 c2_port->netstats.tx_dropped++; 351 c2_port->netdev->stats.tx_dropped++;
353 break; 352 break;
354 } else { 353 } else {
355 __raw_writew(0, 354 __raw_writew(0,
@@ -457,7 +456,7 @@ static void c2_rx_error(struct c2_port *c2_port, struct c2_element *elem)
457 elem->hw_desc + C2_RXP_FLAGS); 456 elem->hw_desc + C2_RXP_FLAGS);
458 457
459 pr_debug("packet dropped\n"); 458 pr_debug("packet dropped\n");
460 c2_port->netstats.rx_dropped++; 459 c2_port->netdev->stats.rx_dropped++;
461} 460}
462 461
463static void c2_rx_interrupt(struct net_device *netdev) 462static void c2_rx_interrupt(struct net_device *netdev)
@@ -532,8 +531,8 @@ static void c2_rx_interrupt(struct net_device *netdev)
532 netif_rx(skb); 531 netif_rx(skb);
533 532
534 netdev->last_rx = jiffies; 533 netdev->last_rx = jiffies;
535 c2_port->netstats.rx_packets++; 534 netdev->stats.rx_packets++;
536 c2_port->netstats.rx_bytes += buflen; 535 netdev->stats.rx_bytes += buflen;
537 } 536 }
538 537
539 /* Save where we left off */ 538 /* Save where we left off */
@@ -797,8 +796,8 @@ static int c2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
797 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_READY), 796 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_READY),
798 elem->hw_desc + C2_TXP_FLAGS); 797 elem->hw_desc + C2_TXP_FLAGS);
799 798
800 c2_port->netstats.tx_packets++; 799 netdev->stats.tx_packets++;
801 c2_port->netstats.tx_bytes += maplen; 800 netdev->stats.tx_bytes += maplen;
802 801
803 /* Loop thru additional data fragments and queue them */ 802 /* Loop thru additional data fragments and queue them */
804 if (skb_shinfo(skb)->nr_frags) { 803 if (skb_shinfo(skb)->nr_frags) {
@@ -823,8 +822,8 @@ static int c2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
823 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_READY), 822 __raw_writew((__force u16) cpu_to_be16(TXP_HTXD_READY),
824 elem->hw_desc + C2_TXP_FLAGS); 823 elem->hw_desc + C2_TXP_FLAGS);
825 824
826 c2_port->netstats.tx_packets++; 825 netdev->stats.tx_packets++;
827 c2_port->netstats.tx_bytes += maplen; 826 netdev->stats.tx_bytes += maplen;
828 } 827 }
829 } 828 }
830 829
@@ -845,13 +844,6 @@ static int c2_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
845 return NETDEV_TX_OK; 844 return NETDEV_TX_OK;
846} 845}
847 846
848static struct net_device_stats *c2_get_stats(struct net_device *netdev)
849{
850 struct c2_port *c2_port = netdev_priv(netdev);
851
852 return &c2_port->netstats;
853}
854
855static void c2_tx_timeout(struct net_device *netdev) 847static void c2_tx_timeout(struct net_device *netdev)
856{ 848{
857 struct c2_port *c2_port = netdev_priv(netdev); 849 struct c2_port *c2_port = netdev_priv(netdev);
@@ -880,6 +872,16 @@ static int c2_change_mtu(struct net_device *netdev, int new_mtu)
880 return ret; 872 return ret;
881} 873}
882 874
875static const struct net_device_ops c2_netdev = {
876 .ndo_open = c2_up,
877 .ndo_stop = c2_down,
878 .ndo_start_xmit = c2_xmit_frame,
879 .ndo_tx_timeout = c2_tx_timeout,
880 .ndo_change_mtu = c2_change_mtu,
881 .ndo_set_mac_address = eth_mac_addr,
882 .ndo_validate_addr = eth_validate_addr,
883};
884
883/* Initialize network device */ 885/* Initialize network device */
884static struct net_device *c2_devinit(struct c2_dev *c2dev, 886static struct net_device *c2_devinit(struct c2_dev *c2dev,
885 void __iomem * mmio_addr) 887 void __iomem * mmio_addr)
@@ -894,12 +896,7 @@ static struct net_device *c2_devinit(struct c2_dev *c2dev,
894 896
895 SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev); 897 SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
896 898
897 netdev->open = c2_up; 899 netdev->netdev_ops = &c2_netdev;
898 netdev->stop = c2_down;
899 netdev->hard_start_xmit = c2_xmit_frame;
900 netdev->get_stats = c2_get_stats;
901 netdev->tx_timeout = c2_tx_timeout;
902 netdev->change_mtu = c2_change_mtu;
903 netdev->watchdog_timeo = C2_TX_TIMEOUT; 900 netdev->watchdog_timeo = C2_TX_TIMEOUT;
904 netdev->irq = c2dev->pcidev->irq; 901 netdev->irq = c2dev->pcidev->irq;
905 902
diff --git a/drivers/infiniband/hw/amso1100/c2.h b/drivers/infiniband/hw/amso1100/c2.h
index d12a24a84fd9..f7ff66f98361 100644
--- a/drivers/infiniband/hw/amso1100/c2.h
+++ b/drivers/infiniband/hw/amso1100/c2.h
@@ -369,8 +369,6 @@ struct c2_port {
369 unsigned long mem_size; 369 unsigned long mem_size;
370 370
371 u32 rx_buf_size; 371 u32 rx_buf_size;
372
373 struct net_device_stats netstats;
374}; 372};
375 373
376/* 374/*
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c
index 5119d6508181..f1948fad85d7 100644
--- a/drivers/infiniband/hw/amso1100/c2_provider.c
+++ b/drivers/infiniband/hw/amso1100/c2_provider.c
@@ -708,26 +708,27 @@ static int c2_pseudo_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
708 708
709static int c2_pseudo_change_mtu(struct net_device *netdev, int new_mtu) 709static int c2_pseudo_change_mtu(struct net_device *netdev, int new_mtu)
710{ 710{
711 int ret = 0;
712
713 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) 711 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
714 return -EINVAL; 712 return -EINVAL;
715 713
716 netdev->mtu = new_mtu; 714 netdev->mtu = new_mtu;
717 715
718 /* TODO: Tell rnic about new rmda interface mtu */ 716 /* TODO: Tell rnic about new rmda interface mtu */
719 return ret; 717 return 0;
720} 718}
721 719
720static const struct net_device_ops c2_pseudo_netdev_ops = {
721 .ndo_open = c2_pseudo_up,
722 .ndo_stop = c2_pseudo_down,
723 .ndo_start_xmit = c2_pseudo_xmit_frame,
724 .ndo_change_mtu = c2_pseudo_change_mtu,
725 .ndo_validate_addr = eth_validate_addr,
726};
727
722static void setup(struct net_device *netdev) 728static void setup(struct net_device *netdev)
723{ 729{
724 netdev->open = c2_pseudo_up; 730 netdev->netdev_ops = &c2_pseudo_netdev_ops;
725 netdev->stop = c2_pseudo_down; 731
726 netdev->hard_start_xmit = c2_pseudo_xmit_frame;
727 netdev->get_stats = NULL;
728 netdev->tx_timeout = NULL;
729 netdev->set_mac_address = NULL;
730 netdev->change_mtu = c2_pseudo_change_mtu;
731 netdev->watchdog_timeo = 0; 732 netdev->watchdog_timeo = 0;
732 netdev->type = ARPHRD_ETHER; 733 netdev->type = ARPHRD_ETHER;
733 netdev->mtu = 1500; 734 netdev->mtu = 1500;
@@ -735,7 +736,6 @@ static void setup(struct net_device *netdev)
735 netdev->addr_len = ETH_ALEN; 736 netdev->addr_len = ETH_ALEN;
736 netdev->tx_queue_len = 0; 737 netdev->tx_queue_len = 0;
737 netdev->flags |= IFF_NOARP; 738 netdev->flags |= IFF_NOARP;
738 return;
739} 739}
740 740
741static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev) 741static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev)
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index d4d7204c11ed..a4a82bff7100 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -701,6 +701,9 @@ static int __cxio_tpt_op(struct cxio_rdev *rdev_p, u32 reset_tpt_entry,
701 u32 stag_idx; 701 u32 stag_idx;
702 u32 wptr; 702 u32 wptr;
703 703
704 if (rdev_p->flags)
705 return -EIO;
706
704 stag_state = stag_state > 0; 707 stag_state = stag_state > 0;
705 stag_idx = (*stag) >> 8; 708 stag_idx = (*stag) >> 8;
706 709
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h
index e44dc2289471..094a66d1480c 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.h
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h
@@ -111,6 +111,8 @@ struct cxio_rdev {
111 struct gen_pool *rqt_pool; 111 struct gen_pool *rqt_pool;
112 struct list_head entry; 112 struct list_head entry;
113 struct ch_embedded_info fw_info; 113 struct ch_embedded_info fw_info;
114 u32 flags;
115#define CXIO_ERROR_FATAL 1
114}; 116};
115 117
116static inline int cxio_num_stags(struct cxio_rdev *rdev_p) 118static inline int cxio_num_stags(struct cxio_rdev *rdev_p)
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c
index 4489c89d6710..37a4fc264a07 100644
--- a/drivers/infiniband/hw/cxgb3/iwch.c
+++ b/drivers/infiniband/hw/cxgb3/iwch.c
@@ -51,13 +51,15 @@ cxgb3_cpl_handler_func t3c_handlers[NUM_CPL_CMDS];
51 51
52static void open_rnic_dev(struct t3cdev *); 52static void open_rnic_dev(struct t3cdev *);
53static void close_rnic_dev(struct t3cdev *); 53static void close_rnic_dev(struct t3cdev *);
54static void iwch_err_handler(struct t3cdev *, u32, u32);
54 55
55struct cxgb3_client t3c_client = { 56struct cxgb3_client t3c_client = {
56 .name = "iw_cxgb3", 57 .name = "iw_cxgb3",
57 .add = open_rnic_dev, 58 .add = open_rnic_dev,
58 .remove = close_rnic_dev, 59 .remove = close_rnic_dev,
59 .handlers = t3c_handlers, 60 .handlers = t3c_handlers,
60 .redirect = iwch_ep_redirect 61 .redirect = iwch_ep_redirect,
62 .err_handler = iwch_err_handler
61}; 63};
62 64
63static LIST_HEAD(dev_list); 65static LIST_HEAD(dev_list);
@@ -160,6 +162,17 @@ static void close_rnic_dev(struct t3cdev *tdev)
160 mutex_unlock(&dev_mutex); 162 mutex_unlock(&dev_mutex);
161} 163}
162 164
165static void iwch_err_handler(struct t3cdev *tdev, u32 status, u32 error)
166{
167 struct cxio_rdev *rdev = tdev->ulp;
168
169 if (status == OFFLOAD_STATUS_DOWN)
170 rdev->flags = CXIO_ERROR_FATAL;
171
172 return;
173
174}
175
163static int __init iwch_init_module(void) 176static int __init iwch_init_module(void)
164{ 177{
165 int err; 178 int err;
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 9a51f25c6cee..52e734042b8e 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2550,7 +2550,7 @@ static void nes_nic_napi_ce_handler(struct nes_device *nesdev, struct nes_hw_nic
2550{ 2550{
2551 struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq); 2551 struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
2552 2552
2553 netif_rx_schedule(&nesvnic->napi); 2553 napi_schedule(&nesvnic->napi);
2554} 2554}
2555 2555
2556 2556
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 025ed9f7d9c2..8d3e4c6f237e 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -111,7 +111,7 @@ static int nes_netdev_poll(struct napi_struct *napi, int budget)
111 nes_nic_ce_handler(nesdev, nescq); 111 nes_nic_ce_handler(nesdev, nescq);
112 112
113 if (nescq->cqes_pending == 0) { 113 if (nescq->cqes_pending == 0) {
114 netif_rx_complete(napi); 114 napi_complete(napi);
115 /* clear out completed cqes and arm */ 115 /* clear out completed cqes and arm */
116 nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT | 116 nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT |
117 nescq->cq_number | (nescq->cqe_allocs_pending << 16)); 117 nescq->cq_number | (nescq->cqe_allocs_pending << 16));
@@ -1551,6 +1551,19 @@ static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct vlan_g
1551 spin_unlock_irqrestore(&nesadapter->phy_lock, flags); 1551 spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
1552} 1552}
1553 1553
1554static const struct net_device_ops nes_netdev_ops = {
1555 .ndo_open = nes_netdev_open,
1556 .ndo_stop = nes_netdev_stop,
1557 .ndo_start_xmit = nes_netdev_start_xmit,
1558 .ndo_get_stats = nes_netdev_get_stats,
1559 .ndo_tx_timeout = nes_netdev_tx_timeout,
1560 .ndo_set_mac_address = nes_netdev_set_mac_address,
1561 .ndo_set_multicast_list = nes_netdev_set_multicast_list,
1562 .ndo_change_mtu = nes_netdev_change_mtu,
1563 .ndo_set_mac_address = eth_mac_addr,
1564 .ndo_validate_addr = eth_validate_addr,
1565 .ndo_vlan_rx_register = nes_netdev_vlan_rx_register,
1566};
1554 1567
1555/** 1568/**
1556 * nes_netdev_init - initialize network device 1569 * nes_netdev_init - initialize network device
@@ -1559,7 +1572,7 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1559 void __iomem *mmio_addr) 1572 void __iomem *mmio_addr)
1560{ 1573{
1561 u64 u64temp; 1574 u64 u64temp;
1562 struct nes_vnic *nesvnic = NULL; 1575 struct nes_vnic *nesvnic;
1563 struct net_device *netdev; 1576 struct net_device *netdev;
1564 struct nic_qp_map *curr_qp_map; 1577 struct nic_qp_map *curr_qp_map;
1565 u32 u32temp; 1578 u32 u32temp;
@@ -1571,22 +1584,12 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1571 printk(KERN_ERR PFX "nesvnic etherdev alloc failed"); 1584 printk(KERN_ERR PFX "nesvnic etherdev alloc failed");
1572 return NULL; 1585 return NULL;
1573 } 1586 }
1587 nesvnic = netdev_priv(netdev);
1574 1588
1575 nes_debug(NES_DBG_INIT, "netdev = %p, %s\n", netdev, netdev->name); 1589 nes_debug(NES_DBG_INIT, "netdev = %p, %s\n", netdev, netdev->name);
1576 1590
1577 SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev); 1591 SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev);
1578 1592
1579 nesvnic = netdev_priv(netdev);
1580 memset(nesvnic, 0, sizeof(*nesvnic));
1581
1582 netdev->open = nes_netdev_open;
1583 netdev->stop = nes_netdev_stop;
1584 netdev->hard_start_xmit = nes_netdev_start_xmit;
1585 netdev->get_stats = nes_netdev_get_stats;
1586 netdev->tx_timeout = nes_netdev_tx_timeout;
1587 netdev->set_mac_address = nes_netdev_set_mac_address;
1588 netdev->set_multicast_list = nes_netdev_set_multicast_list;
1589 netdev->change_mtu = nes_netdev_change_mtu;
1590 netdev->watchdog_timeo = NES_TX_TIMEOUT; 1593 netdev->watchdog_timeo = NES_TX_TIMEOUT;
1591 netdev->irq = nesdev->pcidev->irq; 1594 netdev->irq = nesdev->pcidev->irq;
1592 netdev->mtu = ETH_DATA_LEN; 1595 netdev->mtu = ETH_DATA_LEN;
@@ -1594,11 +1597,13 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1594 netdev->addr_len = ETH_ALEN; 1597 netdev->addr_len = ETH_ALEN;
1595 netdev->type = ARPHRD_ETHER; 1598 netdev->type = ARPHRD_ETHER;
1596 netdev->features = NETIF_F_HIGHDMA; 1599 netdev->features = NETIF_F_HIGHDMA;
1600 netdev->netdev_ops = &nes_netdev_ops;
1597 netdev->ethtool_ops = &nes_ethtool_ops; 1601 netdev->ethtool_ops = &nes_ethtool_ops;
1598 netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128); 1602 netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
1599 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n"); 1603 nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
1600 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1604 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1601 netdev->vlan_rx_register = nes_netdev_vlan_rx_register; 1605 netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
1606 netdev->features |= NETIF_F_LLTX;
1602 1607
1603 /* Fill in the port structure */ 1608 /* Fill in the port structure */
1604 nesvnic->netdev = netdev; 1609 nesvnic->netdev = netdev;