enic: updates to version 1.3.1.1
Subsystems (2)
cover enic: updates to version 1.3.1.1
The following series implements enic driver updates:
1/5 - Bug Fix: Fix hardware descriptor reads
2/5 - Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations 3/5 - Do not advertise NETIF_F_HW_VLAN_RX
4/5 - Clean up: Add wrapper functions
5/5 - Clean up: Change driver description; Fix tab space; Update MAINTAINERS
PATCH 1/5 enic: Bug Fix: Fix hardware descriptor reads
From: Vasanthy Kolluri <[email protected]>
The last bit written to a completion descriptor by hardware is the color bit. Driver must read all other descriptor fields only after reading the color bit to avoid reading stale descriptor fields. There is a rmb() after reading the color bit to avoid any compiler/cpu reordering of the reads. The color bit is the generation bit that toggles each pass through the completion descriptor ring.
--- drivers/net/enic/cq_enet_desc.h | 12 ++++++++---- drivers/net/enic/enic.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-)
drivers/net/enic/cq_enet_desc.h +8 -4
@@ -101,14 +101,18 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, u8 *tcp_udp_csum_ok, u8 *udp, u8 *tcp, u8 *ipv4_csum_ok, u8 *ipv6, u8 *ipv4, u8 *ipv4_fragment, u8 *fcs_ok) { -u16 completed_index_flags =le16_to_cpu (desc->completed_index_flags); -u16 q_number_rss_type_flags = -le16_to_cpu (desc->q_number_rss_type_flags); -u16 bytes_written_flags =le16_to_cpu (desc->bytes_written_flags); +u16 completed_index_flags; +u16 q_number_rss_type_flags; +u16 bytes_written_flags;cq_desc_dec ((struct cq_desc *)desc, type, color, q_number, completed_index); + completed_index_flags =le16_to_cpu (desc->completed_index_flags); + q_number_rss_type_flags = +le16_to_cpu (desc->q_number_rss_type_flags); + bytes_written_flags =le16_to_cpu (desc->bytes_written_flags); + *ingress_port = (completed_index_flags &CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT ) ?1 :0 ; *fcoe = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_FCOE) ?
drivers/net/enic/enic.h +1 -1
@@ -34,7 +34,7 @@#define DRV_NAME "enic"#define DRV_DESCRIPTION "Cisco 10G Ethernet Driver" -#define DRV_VERSION "1.1.0.241a" +#define DRV_VERSION "1.3.1.1"#define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc"#define PFX DRV_NAME ": "
PATCH 2/5 enic: Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
The timeout for hardware Tx and Rx queue disable operations is increased to work-around an erratum for "unnamed" chipset where a DMA completion may take upto 10ms. We have to wait atleast this long for hardware to signal that Tx and Rx queues are quiesced.
--- drivers/net/enic/vnic_rq.c | 4 ++-- drivers/net/enic/vnic_wq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/enic/vnic_rq.c +2 -2
@@ -167,10 +167,10 @@ int vnic_rq_disable(struct vnic_rq *rq)iowrite32 (0 , &rq->ctrl->enable);/* Wait for HW to ACK disable request */ -for (wait =0 ; wait <100 ; wait++) { +for (wait =0 ; wait <1000 ; wait++) {if (!(ioread32 (&rq->ctrl->running)))return 0 ; -udelay (1 ); +udelay (10 ); }printk (KERN_ERR "Failed to disable RQ[%d]\n" , rq->index);
drivers/net/enic/vnic_wq.c +2 -2
@@ -160,10 +160,10 @@ int vnic_wq_disable(struct vnic_wq *wq)iowrite32 (0 , &wq->ctrl->enable);/* Wait for HW to ACK disable request */ -for (wait =0 ; wait <100 ; wait++) { +for (wait =0 ; wait <1000 ; wait++) {if (!(ioread32 (&wq->ctrl->running)))return 0 ; -udelay (1 ); +udelay (10 ); }printk (KERN_ERR "Failed to disable WQ[%d]\n" , wq->index);
PATCH 3/5 enic: Do not advertise NETIF_F_HW_VLAN_RX
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Hardware does not honor vlan filters from the host and so the driver does not need to advertise this.
--- drivers/net/enic/enic_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/enic/enic_main.c +1 -2
@@ -2058,8 +2058,7 @@ static int __devinit enic_probe(struct pci_dev *pdev, netdev->watchdog_timeo =2 *HZ ; netdev->ethtool_ops = &enic_ethtool_ops; - netdev->features |=NETIF_F_HW_VLAN_TX | -NETIF_F_HW_VLAN_RX |NETIF_F_HW_VLAN_FILTER ; + netdev->features |=NETIF_F_HW_VLAN_TX |NETIF_F_HW_VLAN_RX ;if (ENIC_SETTING (enic,TXCSUM )) netdev->features |=NETIF_F_SG |NETIF_F_HW_CSUM ;if (ENIC_SETTING (enic,TSO ))
PATCH 4/5 enic: Clean up: Add wrapper functions
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Add wrapper functions vnic_dev_notify_setcmd and vnic_dev_notify_unsetcmd for firmware notify commands.
--- drivers/net/enic/vnic_dev.c | 52 ++++++++++++++++++++++++++++++++++--------- drivers/net/enic/vnic_dev.h | 3 ++ 2 files changed, 44 insertions(+), 11 deletions(-)
drivers/net/enic/vnic_dev.c +41 -11
@@ -573,22 +573,18 @@ int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr)return err; } -int vnic_dev_notify_set (struct vnic_dev *vdev,u16 intr) +int vnic_dev_notify_setcmd (struct vnic_dev *vdev, +void *notify_addr,dma_addr_t notify_pa,u16 intr) {u64 a0, a1;int wait =1000 ;int r; -if (!vdev->notify) { - vdev->notify =pci_alloc_consistent (vdev->pdev, -sizeof (struct vnic_devcmd_notify ), - &vdev->notify_pa); -if (!vdev->notify) -return -ENOMEM ; -memset (vdev->notify,0 ,sizeof (struct vnic_devcmd_notify )); - } +memset (notify_addr,0 ,sizeof (struct vnic_devcmd_notify )); + vdev->notify = notify_addr; + vdev->notify_pa = notify_pa; - a0 = vdev->notify_pa; + a0 = (u64 )notify_pa; a1 = ((u64 )intr <<32 ) &0x0000ffff00000000ULL ; a1 +=sizeof (struct vnic_devcmd_notify );
@@ -597,7 +593,27 @@ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)return r; } -void vnic_dev_notify_unset (struct vnic_dev *vdev) +int vnic_dev_notify_set (struct vnic_dev *vdev,u16 intr) +{ +void *notify_addr; +dma_addr_t notify_pa; + +if (vdev->notify || vdev->notify_pa) { +printk (KERN_ERR "notify block %p still allocated" , + vdev->notify); +return -EINVAL ; + } + + notify_addr =pci_alloc_consistent (vdev->pdev, +sizeof (struct vnic_devcmd_notify ), + ¬ify_pa); +if (!notify_addr) +return -ENOMEM ; + +return vnic_dev_notify_setcmd (vdev, notify_addr, notify_pa, intr); +} + +void vnic_dev_notify_unsetcmd (struct vnic_dev *vdev) {u64 a0, a1;int wait =1000 ;
@@ -607,9 +623,23 @@ void vnic_dev_notify_unset(struct vnic_dev *vdev) a1 +=sizeof (struct vnic_devcmd_notify );vnic_dev_cmd (vdev,CMD_NOTIFY , &a0, &a1, wait); + vdev->notify =NULL ; + vdev->notify_pa =0 ; vdev->notify_sz =0 ; } +void vnic_dev_notify_unset (struct vnic_dev *vdev) +{ +if (vdev->notify) { +pci_free_consistent (vdev->pdev, +sizeof (struct vnic_devcmd_notify ), + vdev->notify, + vdev->notify_pa); + } + +vnic_dev_notify_unsetcmd (vdev); +} +static int vnic_dev_notify_ready (struct vnic_dev *vdev) {u32 *words;
drivers/net/enic/vnic_dev.h +3 -0
@@ -107,7 +107,10 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr);void vnic_dev_del_addr (struct vnic_dev *vdev,u8 *addr);int vnic_dev_mac_addr (struct vnic_dev *vdev,u8 *mac_addr);int vnic_dev_raise_intr (struct vnic_dev *vdev,u16 intr); +int vnic_dev_notify_setcmd (struct vnic_dev *vdev, +void *notify_addr,dma_addr_t notify_pa,u16 intr);int vnic_dev_notify_set (struct vnic_dev *vdev,u16 intr); +void vnic_dev_notify_unsetcmd (struct vnic_dev *vdev);void vnic_dev_notify_unset (struct vnic_dev *vdev);int vnic_dev_link_status (struct vnic_dev *vdev);u32 vnic_dev_port_speed (struct vnic_dev *vdev);
PATCH 5/5 enic: Clean up: Change driver description; Fix tab space; Update MAINTAINERS
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
1) Change enic driver description to "Cisco VIC Ethernet NIC Driver"
2) Fix tab space
3) Update MAINTAINERS list
--- MAINTAINERS | 5 +++-- drivers/net/Kconfig | 4 ++-- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_main.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-)
MAINTAINERS +3 -2
@@ -1482,9 +1482,10 @@ M: Andy Whitcroft <[email protected]> S: Supported F: scripts/checkpatch.pl -CISCO 10G ETHERNET DRIVER +CISCO VIC ETHERNET NIC DRIVER M: Scott Feldman <[email protected]> -M: Joe Eykholt <[email protected]> +M: Vasanthy Kolluri <[email protected]> +M: Roopa Prabhu <[email protected]> S: Supported F: drivers/net/enic/
drivers/net/Kconfig +2 -2
@@ -2593,11 +2593,11 @@ config EHEA will be called ehea. config ENIC - tristate "Cisco 10G Ethernet NIC support" + tristate "Cisco VIC Ethernet NIC Support" depends on PCI && INET select INET_LRO help - This enables the support for the Cisco 10G Ethernet card. + This enables the support for the Cisco VIC Ethernet card. config IXGBE tristate "Intel(R) 10GbE PCI Express adapters support"
drivers/net/enic/enic.h +1 -1
@@ -33,7 +33,7 @@#include "vnic_rss.h" #define DRV_NAME "enic" -#define DRV_DESCRIPTION "Cisco 10G Ethernet Driver" +#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"#define DRV_VERSION "1.3.1.1"#define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc"#define PFX DRV_NAME ": "
drivers/net/enic/enic_main.c +1 -1
@@ -829,7 +829,7 @@ static void enic_set_multicast_list(struct net_device *netdev)int promisc = (netdev->flags &IFF_PROMISC ) ?1 :0 ;unsigned int mc_count =netdev_mc_count (netdev);int allmulti = (netdev->flags &IFF_ALLMULTI ) || - mc_count >ENIC_MULTICAST_PERFECT_FILTERS ; + mc_count >ENIC_MULTICAST_PERFECT_FILTERS ;unsigned int flags = netdev->flags | (allmulti ?IFF_ALLMULTI :0 );u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS ][ETH_ALEN ];unsigned int i, j;
David Miller
maintainerFrom: Vasanthy Kolluri <[email protected]>
Date: Thu, 18 Mar 2010 19:19:38 -0700
Quoted 11 lines
The following series implements enic driver updates:
1/5 - Bug Fix: Fix hardware descriptor reads
2/5 - Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations 3/5 - Do not advertiseNETIF_F_HW_VLAN_RX
4/5 - Clean up: Add wrapper functions
5/5 - Clean up: Change driver description; Fix tab space; UpdateMAINTAINERSSigned-off-by Scott Feldman <[email protected]>Signed-off-by Vasanthy Kolluri <[email protected]>Signed-off-by Roopa Prabhu <[email protected]>
All applied to net-next-2.6, thanks.