* [net-next PATCH 1/5] enic: Bug Fix: Fix hardware descriptor reads
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
@ 2010-03-19 2:19 ` Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 2/5] enic: Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations Vasanthy Kolluri
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Vasanthy Kolluri @ 2010-03-19 2:19 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
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.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
---
drivers/net/enic/cq_enet_desc.h | 12 ++++++++----
drivers/net/enic/enic.h | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/enic/cq_enet_desc.h b/drivers/net/enic/cq_enet_desc.h
index 03dce9e..337d194 100644
--- a/drivers/net/enic/cq_enet_desc.h
+++ b/drivers/net/enic/cq_enet_desc.h
@@ -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) ?
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index ee01f5a..9f5ed3e 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -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 ": "
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next PATCH 2/5] enic: Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 1/5] enic: Bug Fix: Fix hardware descriptor reads Vasanthy Kolluri
@ 2010-03-19 2:19 ` Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 3/5] enic: Do not advertise NETIF_F_HW_VLAN_RX Vasanthy Kolluri
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Vasanthy Kolluri @ 2010-03-19 2:19 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
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.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
---
drivers/net/enic/vnic_rq.c | 4 ++--
drivers/net/enic/vnic_wq.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/enic/vnic_rq.c b/drivers/net/enic/vnic_rq.c
index 7558397..7bcd903 100644
--- a/drivers/net/enic/vnic_rq.c
+++ b/drivers/net/enic/vnic_rq.c
@@ -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);
diff --git a/drivers/net/enic/vnic_wq.c b/drivers/net/enic/vnic_wq.c
index d2e00e5..44fc323 100644
--- a/drivers/net/enic/vnic_wq.c
+++ b/drivers/net/enic/vnic_wq.c
@@ -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);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next PATCH 3/5] enic: Do not advertise NETIF_F_HW_VLAN_RX
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 1/5] enic: Bug Fix: Fix hardware descriptor reads Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 2/5] enic: Bug Fix: Fix timeout for hardware Tx and Rx queue disable operations Vasanthy Kolluri
@ 2010-03-19 2:19 ` Vasanthy Kolluri
2010-03-19 2:19 ` [net-next PATCH 4/5] enic: Clean up: Add wrapper functions Vasanthy Kolluri
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Vasanthy Kolluri @ 2010-03-19 2:19 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
Hardware does not honor vlan filters from the host and so the driver does
not need to advertise this.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
---
drivers/net/enic/enic_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index cf098bb..18c043a 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -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))
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next PATCH 4/5] enic: Clean up: Add wrapper functions
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
` (2 preceding siblings ...)
2010-03-19 2:19 ` [net-next PATCH 3/5] enic: Do not advertise NETIF_F_HW_VLAN_RX Vasanthy Kolluri
@ 2010-03-19 2:19 ` Vasanthy Kolluri
2010-03-19 2:20 ` [net-next PATCH 5/5] enic: Clean up: Change driver description; Fix tab space; Update MAINTAINERS Vasanthy Kolluri
2010-03-19 4:23 ` [net-next PATCH 0/5] enic: updates to version 1.3.1.1 David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Vasanthy Kolluri @ 2010-03-19 2:19 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
Add wrapper functions vnic_dev_notify_setcmd and vnic_dev_notify_unsetcmd
for firmware notify commands.
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
---
drivers/net/enic/vnic_dev.c | 52 ++++++++++++++++++++++++++++++++++---------
drivers/net/enic/vnic_dev.h | 3 ++
2 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c
index 69b9b70..cbc0ba9 100644
--- a/drivers/net/enic/vnic_dev.c
+++ b/drivers/net/enic/vnic_dev.c
@@ -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;
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h
index fc5e3eb..f5be640 100644
--- a/drivers/net/enic/vnic_dev.h
+++ b/drivers/net/enic/vnic_dev.h
@@ -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);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next PATCH 5/5] enic: Clean up: Change driver description; Fix tab space; Update MAINTAINERS
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
` (3 preceding siblings ...)
2010-03-19 2:19 ` [net-next PATCH 4/5] enic: Clean up: Add wrapper functions Vasanthy Kolluri
@ 2010-03-19 2:20 ` Vasanthy Kolluri
2010-03-19 4:23 ` [net-next PATCH 0/5] enic: updates to version 1.3.1.1 David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Vasanthy Kolluri @ 2010-03-19 2:20 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
1) Change enic driver description to "Cisco VIC Ethernet NIC Driver"
2) Fix tab space
3) Update MAINTAINERS list
Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
---
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(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 47cc449..34f09e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1482,9 +1482,10 @@ M: Andy Whitcroft <apw@canonical.com>
S: Supported
F: scripts/checkpatch.pl
-CISCO 10G ETHERNET DRIVER
+CISCO VIC ETHERNET NIC DRIVER
M: Scott Feldman <scofeldm@cisco.com>
-M: Joe Eykholt <jeykholt@cisco.com>
+M: Vasanthy Kolluri <vkolluri@cisco.com>
+M: Roopa Prabhu <roprabhu@cisco.com>
S: Supported
F: drivers/net/enic/
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0ba5b8e..bf223fb 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -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"
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 9f5ed3e..5fa56f1 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -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 ": "
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 18c043a..6d70c34 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -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;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [net-next PATCH 0/5] enic: updates to version 1.3.1.1
2010-03-19 2:19 [net-next PATCH 0/5] enic: updates to version 1.3.1.1 Vasanthy Kolluri
` (4 preceding siblings ...)
2010-03-19 2:20 ` [net-next PATCH 5/5] enic: Clean up: Change driver description; Fix tab space; Update MAINTAINERS Vasanthy Kolluri
@ 2010-03-19 4:23 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2010-03-19 4:23 UTC (permalink / raw)
To: vkolluri; +Cc: netdev
From: Vasanthy Kolluri <vkolluri@cisco.com>
Date: Thu, 18 Mar 2010 19:19:38 -0700
> 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
>
> Signed-off-by: Scott Feldman <scofeldm@cisco.com>
> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
All applied to net-next-2.6, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread