aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibmveth.h
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2007-09-15 16:36:07 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:43 -0400
commitf4ff28720f45354573dcf4e0eb5a2dc5452cb3e1 (patch)
treebdd8f33e738962c44f1172a3fd3a3aebb0246f61 /drivers/net/ibmveth.h
parentdf950828b0ee51ff63c49c67d561bfd3d6096788 (diff)
ibmveth: Enable TCP checksum offload
This patchset enables TCP checksum offload support for IPV4 on ibmveth. This completely eliminates the generation and checking of the checksum for packets that are completely virtual and never touch a physical network. A simple TCP_STREAM netperf run on a virtual network with maximum mtu set yielded a ~30% increase in throughput. This feature is enabled by default on systems that support it, but can be disabled with a module option. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ibmveth.h')
-rw-r--r--drivers/net/ibmveth.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index e05694126f85..3f10f0f4447a 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -67,6 +67,21 @@ static inline long h_send_logical_lan(unsigned long unit_address,
67 return rc; 67 return rc;
68} 68}
69 69
70static inline long h_illan_attributes(unsigned long unit_address,
71 unsigned long reset_mask, unsigned long set_mask,
72 unsigned long *ret_attributes)
73{
74 long rc;
75 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
76
77 rc = plpar_hcall(H_ILLAN_ATTRIBUTES, retbuf, unit_address,
78 reset_mask, set_mask);
79
80 *ret_attributes = retbuf[0];
81
82 return rc;
83}
84
70#define h_multicast_ctrl(ua, cmd, mac) \ 85#define h_multicast_ctrl(ua, cmd, mac) \
71 plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac) 86 plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac)
72 87
@@ -142,7 +157,9 @@ struct ibmveth_adapter {
142struct ibmveth_buf_desc_fields { 157struct ibmveth_buf_desc_fields {
143 u32 valid : 1; 158 u32 valid : 1;
144 u32 toggle : 1; 159 u32 toggle : 1;
145 u32 reserved : 6; 160 u32 reserved : 4;
161 u32 no_csum : 1;
162 u32 csum_good : 1;
146 u32 length : 24; 163 u32 length : 24;
147 u32 address; 164 u32 address;
148}; 165};
@@ -152,10 +169,30 @@ union ibmveth_buf_desc {
152 struct ibmveth_buf_desc_fields fields; 169 struct ibmveth_buf_desc_fields fields;
153}; 170};
154 171
172struct ibmveth_illan_attributes_fields {
173 u32 reserved;
174 u32 reserved2 : 18;
175 u32 csum_offload_padded_pkt_support : 1;
176 u32 reserved3 : 1;
177 u32 trunk_priority : 4;
178 u32 reserved4 : 5;
179 u32 tcp_csum_offload_ipv6 : 1;
180 u32 tcp_csum_offload_ipv4 : 1;
181 u32 active_trunk : 1;
182};
183
184union ibmveth_illan_attributes {
185 u64 desc;
186 struct ibmveth_illan_attributes_fields fields;
187};
188
155struct ibmveth_rx_q_entry { 189struct ibmveth_rx_q_entry {
156 u16 toggle : 1; 190 u16 toggle : 1;
157 u16 valid : 1; 191 u16 valid : 1;
158 u16 reserved : 14; 192 u16 reserved : 4;
193 u16 no_csum : 1;
194 u16 csum_good : 1;
195 u16 reserved2 : 8;
159 u16 offset; 196 u16 offset;
160 u32 length; 197 u32 length;
161 u64 correlator; 198 u64 correlator;