diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2010-03-18 12:19:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-19 00:22:47 -0400 |
commit | a55a603dae47a1ea4fbfad3a3a428ea7a0900ab6 (patch) | |
tree | e5a0526197efe4afb24443a2b918a8908ce11a43 /drivers/net/enic | |
parent | ba7e94a44afbbf4c494e00b844f7bbfb144e7f6d (diff) |
enic: Bug Fix: Fix hardware descriptor reads
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/cq_enet_desc.h | 12 | ||||
-rw-r--r-- | 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 03dce9ed612c..337d1943af46 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, | |||
101 | u8 *tcp_udp_csum_ok, u8 *udp, u8 *tcp, u8 *ipv4_csum_ok, | 101 | u8 *tcp_udp_csum_ok, u8 *udp, u8 *tcp, u8 *ipv4_csum_ok, |
102 | u8 *ipv6, u8 *ipv4, u8 *ipv4_fragment, u8 *fcs_ok) | 102 | u8 *ipv6, u8 *ipv4, u8 *ipv4_fragment, u8 *fcs_ok) |
103 | { | 103 | { |
104 | u16 completed_index_flags = le16_to_cpu(desc->completed_index_flags); | 104 | u16 completed_index_flags; |
105 | u16 q_number_rss_type_flags = | 105 | u16 q_number_rss_type_flags; |
106 | le16_to_cpu(desc->q_number_rss_type_flags); | 106 | u16 bytes_written_flags; |
107 | u16 bytes_written_flags = le16_to_cpu(desc->bytes_written_flags); | ||
108 | 107 | ||
109 | cq_desc_dec((struct cq_desc *)desc, type, | 108 | cq_desc_dec((struct cq_desc *)desc, type, |
110 | color, q_number, completed_index); | 109 | color, q_number, completed_index); |
111 | 110 | ||
111 | completed_index_flags = le16_to_cpu(desc->completed_index_flags); | ||
112 | q_number_rss_type_flags = | ||
113 | le16_to_cpu(desc->q_number_rss_type_flags); | ||
114 | bytes_written_flags = le16_to_cpu(desc->bytes_written_flags); | ||
115 | |||
112 | *ingress_port = (completed_index_flags & | 116 | *ingress_port = (completed_index_flags & |
113 | CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT) ? 1 : 0; | 117 | CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT) ? 1 : 0; |
114 | *fcoe = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_FCOE) ? | 118 | *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 ee01f5a6d0d4..9f5ed3e5e3fe 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define DRV_NAME "enic" | 35 | #define DRV_NAME "enic" |
36 | #define DRV_DESCRIPTION "Cisco 10G Ethernet Driver" | 36 | #define DRV_DESCRIPTION "Cisco 10G Ethernet Driver" |
37 | #define DRV_VERSION "1.1.0.241a" | 37 | #define DRV_VERSION "1.3.1.1" |
38 | #define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc" | 38 | #define DRV_COPYRIGHT "Copyright 2008-2009 Cisco Systems, Inc" |
39 | #define PFX DRV_NAME ": " | 39 | #define PFX DRV_NAME ": " |
40 | 40 | ||