diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2010-06-24 06:51:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-25 23:50:24 -0400 |
commit | 1825aca667196f75b193e2d509ea96ffdc8db0ca (patch) | |
tree | ae8814b42ad649e983c41cebdf8af1c91d06e7fd /drivers/net/enic/enic_res.h | |
parent | b5bab85c15ed3d1ae7f917a7c077086ac6c04572 (diff) |
enic: Feature Add: Add loopback capability to enic devices
Hardware has the loopback capability to queue the packets transmitted from
a device to the receive queue of the same device. enic now supports the
loopback capability.
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/enic_res.h')
-rw-r--r-- | drivers/net/enic/enic_res.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h index 3f6e039c2fd2..8b25a07a67d1 100644 --- a/drivers/net/enic/enic_res.h +++ b/drivers/net/enic/enic_res.h | |||
@@ -43,7 +43,7 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq, | |||
43 | void *os_buf, dma_addr_t dma_addr, unsigned int len, | 43 | void *os_buf, dma_addr_t dma_addr, unsigned int len, |
44 | unsigned int mss_or_csum_offset, unsigned int hdr_len, | 44 | unsigned int mss_or_csum_offset, unsigned int hdr_len, |
45 | int vlan_tag_insert, unsigned int vlan_tag, | 45 | int vlan_tag_insert, unsigned int vlan_tag, |
46 | int offload_mode, int cq_entry, int sop, int eop) | 46 | int offload_mode, int cq_entry, int sop, int eop, int loopback) |
47 | { | 47 | { |
48 | struct wq_enet_desc *desc = vnic_wq_next_desc(wq); | 48 | struct wq_enet_desc *desc = vnic_wq_next_desc(wq); |
49 | 49 | ||
@@ -56,61 +56,62 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq, | |||
56 | 0, /* fcoe_encap */ | 56 | 0, /* fcoe_encap */ |
57 | (u8)vlan_tag_insert, | 57 | (u8)vlan_tag_insert, |
58 | (u16)vlan_tag, | 58 | (u16)vlan_tag, |
59 | 0 /* loopback */); | 59 | (u8)loopback); |
60 | 60 | ||
61 | vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop); | 61 | vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop); |
62 | } | 62 | } |
63 | 63 | ||
64 | static inline void enic_queue_wq_desc_cont(struct vnic_wq *wq, | 64 | static inline void enic_queue_wq_desc_cont(struct vnic_wq *wq, |
65 | void *os_buf, dma_addr_t dma_addr, unsigned int len, int eop) | 65 | void *os_buf, dma_addr_t dma_addr, unsigned int len, |
66 | int eop, int loopback) | ||
66 | { | 67 | { |
67 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, | 68 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, |
68 | 0, 0, 0, 0, 0, | 69 | 0, 0, 0, 0, 0, |
69 | eop, 0 /* !SOP */, eop); | 70 | eop, 0 /* !SOP */, eop, loopback); |
70 | } | 71 | } |
71 | 72 | ||
72 | static inline void enic_queue_wq_desc(struct vnic_wq *wq, void *os_buf, | 73 | static inline void enic_queue_wq_desc(struct vnic_wq *wq, void *os_buf, |
73 | dma_addr_t dma_addr, unsigned int len, int vlan_tag_insert, | 74 | dma_addr_t dma_addr, unsigned int len, int vlan_tag_insert, |
74 | unsigned int vlan_tag, int eop) | 75 | unsigned int vlan_tag, int eop, int loopback) |
75 | { | 76 | { |
76 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, | 77 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, |
77 | 0, 0, vlan_tag_insert, vlan_tag, | 78 | 0, 0, vlan_tag_insert, vlan_tag, |
78 | WQ_ENET_OFFLOAD_MODE_CSUM, | 79 | WQ_ENET_OFFLOAD_MODE_CSUM, |
79 | eop, 1 /* SOP */, eop); | 80 | eop, 1 /* SOP */, eop, loopback); |
80 | } | 81 | } |
81 | 82 | ||
82 | static inline void enic_queue_wq_desc_csum(struct vnic_wq *wq, | 83 | static inline void enic_queue_wq_desc_csum(struct vnic_wq *wq, |
83 | void *os_buf, dma_addr_t dma_addr, unsigned int len, | 84 | void *os_buf, dma_addr_t dma_addr, unsigned int len, |
84 | int ip_csum, int tcpudp_csum, int vlan_tag_insert, | 85 | int ip_csum, int tcpudp_csum, int vlan_tag_insert, |
85 | unsigned int vlan_tag, int eop) | 86 | unsigned int vlan_tag, int eop, int loopback) |
86 | { | 87 | { |
87 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, | 88 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, |
88 | (ip_csum ? 1 : 0) + (tcpudp_csum ? 2 : 0), | 89 | (ip_csum ? 1 : 0) + (tcpudp_csum ? 2 : 0), |
89 | 0, vlan_tag_insert, vlan_tag, | 90 | 0, vlan_tag_insert, vlan_tag, |
90 | WQ_ENET_OFFLOAD_MODE_CSUM, | 91 | WQ_ENET_OFFLOAD_MODE_CSUM, |
91 | eop, 1 /* SOP */, eop); | 92 | eop, 1 /* SOP */, eop, loopback); |
92 | } | 93 | } |
93 | 94 | ||
94 | static inline void enic_queue_wq_desc_csum_l4(struct vnic_wq *wq, | 95 | static inline void enic_queue_wq_desc_csum_l4(struct vnic_wq *wq, |
95 | void *os_buf, dma_addr_t dma_addr, unsigned int len, | 96 | void *os_buf, dma_addr_t dma_addr, unsigned int len, |
96 | unsigned int csum_offset, unsigned int hdr_len, | 97 | unsigned int csum_offset, unsigned int hdr_len, |
97 | int vlan_tag_insert, unsigned int vlan_tag, int eop) | 98 | int vlan_tag_insert, unsigned int vlan_tag, int eop, int loopback) |
98 | { | 99 | { |
99 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, | 100 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, |
100 | csum_offset, hdr_len, vlan_tag_insert, vlan_tag, | 101 | csum_offset, hdr_len, vlan_tag_insert, vlan_tag, |
101 | WQ_ENET_OFFLOAD_MODE_CSUM_L4, | 102 | WQ_ENET_OFFLOAD_MODE_CSUM_L4, |
102 | eop, 1 /* SOP */, eop); | 103 | eop, 1 /* SOP */, eop, loopback); |
103 | } | 104 | } |
104 | 105 | ||
105 | static inline void enic_queue_wq_desc_tso(struct vnic_wq *wq, | 106 | static inline void enic_queue_wq_desc_tso(struct vnic_wq *wq, |
106 | void *os_buf, dma_addr_t dma_addr, unsigned int len, | 107 | void *os_buf, dma_addr_t dma_addr, unsigned int len, |
107 | unsigned int mss, unsigned int hdr_len, int vlan_tag_insert, | 108 | unsigned int mss, unsigned int hdr_len, int vlan_tag_insert, |
108 | unsigned int vlan_tag, int eop) | 109 | unsigned int vlan_tag, int eop, int loopback) |
109 | { | 110 | { |
110 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, | 111 | enic_queue_wq_desc_ex(wq, os_buf, dma_addr, len, |
111 | mss, hdr_len, vlan_tag_insert, vlan_tag, | 112 | mss, hdr_len, vlan_tag_insert, vlan_tag, |
112 | WQ_ENET_OFFLOAD_MODE_TSO, | 113 | WQ_ENET_OFFLOAD_MODE_TSO, |
113 | eop, 1 /* SOP */, eop); | 114 | eop, 1 /* SOP */, eop, loopback); |
114 | } | 115 | } |
115 | 116 | ||
116 | static inline void enic_queue_rq_desc(struct vnic_rq *rq, | 117 | static inline void enic_queue_rq_desc(struct vnic_rq *rq, |