aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_tso.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_tso.c')
-rw-r--r--drivers/s390/net/qeth_tso.c49
1 files changed, 10 insertions, 39 deletions
diff --git a/drivers/s390/net/qeth_tso.c b/drivers/s390/net/qeth_tso.c
index c91976274e7b..4e58f19cb71c 100644
--- a/drivers/s390/net/qeth_tso.c
+++ b/drivers/s390/net/qeth_tso.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/s390/net/qeth_tso.c ($Revision: 1.6 $) 2 * linux/drivers/s390/net/qeth_tso.c ($Revision: 1.7 $)
3 * 3 *
4 * Header file for qeth TCP Segmentation Offload support. 4 * Header file for qeth TCP Segmentation Offload support.
5 * 5 *
@@ -7,7 +7,7 @@
7 * 7 *
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com> 8 * Author(s): Frank Pavlic <pavlic@de.ibm.com>
9 * 9 *
10 * $Revision: 1.6 $ $Date: 2005/03/24 09:04:18 $ 10 * $Revision: 1.7 $ $Date: 2005/04/01 21:40:41 $
11 * 11 *
12 */ 12 */
13 13
@@ -144,38 +144,6 @@ qeth_tso_get_queue_buffer(struct qeth_qdio_out_q *queue)
144 return flush_cnt; 144 return flush_cnt;
145} 145}
146 146
147static inline void
148__qeth_tso_fill_buffer_frag(struct qeth_qdio_out_buffer *buf,
149 struct sk_buff *skb)
150{
151 struct skb_frag_struct *frag;
152 struct qdio_buffer *buffer;
153 int fragno, cnt, element;
154 unsigned long addr;
155
156 QETH_DBF_TEXT(trace, 6, "tsfilfrg");
157
158 /*initialize variables ...*/
159 fragno = skb_shinfo(skb)->nr_frags;
160 buffer = buf->buffer;
161 element = buf->next_element_to_fill;
162 /*fill buffer elements .....*/
163 for (cnt = 0; cnt < fragno; cnt++) {
164 frag = &skb_shinfo(skb)->frags[cnt];
165 addr = (page_to_pfn(frag->page) << PAGE_SHIFT) +
166 frag->page_offset;
167 buffer->element[element].addr = (char *)addr;
168 buffer->element[element].length = frag->size;
169 if (cnt < (fragno - 1))
170 buffer->element[element].flags =
171 SBAL_FLAGS_MIDDLE_FRAG;
172 else
173 buffer->element[element].flags =
174 SBAL_FLAGS_LAST_FRAG;
175 element++;
176 }
177 buf->next_element_to_fill = element;
178}
179 147
180static inline int 148static inline int
181qeth_tso_fill_buffer(struct qeth_qdio_out_buffer *buf, 149qeth_tso_fill_buffer(struct qeth_qdio_out_buffer *buf,
@@ -205,19 +173,22 @@ qeth_tso_fill_buffer(struct qeth_qdio_out_buffer *buf,
205 buffer->element[element].length = hdr_len; 173 buffer->element[element].length = hdr_len;
206 buffer->element[element].flags = SBAL_FLAGS_FIRST_FRAG; 174 buffer->element[element].flags = SBAL_FLAGS_FIRST_FRAG;
207 buf->next_element_to_fill++; 175 buf->next_element_to_fill++;
208 176 /*check if we have frags ...*/
209 if (skb_shinfo(skb)->nr_frags > 0) { 177 if (skb_shinfo(skb)->nr_frags > 0) {
210 __qeth_tso_fill_buffer_frag(buf, skb); 178 skb->len = length;
179 skb->data = data;
180 __qeth_fill_buffer_frag(skb, buffer,1,
181 (int *)&buf->next_element_to_fill);
211 goto out; 182 goto out;
212 } 183 }
213 184
214 /*start filling buffer entries ...*/ 185 /*... if not, use this */
215 element++; 186 element++;
216 while (length > 0) { 187 while (length > 0) {
217 /* length_here is the remaining amount of data in this page */ 188 /* length_here is the remaining amount of data in this page */
218 length_here = PAGE_SIZE - ((unsigned long) data % PAGE_SIZE); 189 length_here = PAGE_SIZE - ((unsigned long) data % PAGE_SIZE);
219 if (length < length_here) 190 if (length < length_here)
220 length_here = length; 191 length_here = length;
221 buffer->element[element].addr = data; 192 buffer->element[element].addr = data;
222 buffer->element[element].length = length_here; 193 buffer->element[element].length = length_here;
223 length -= length_here; 194 length -= length_here;
@@ -230,9 +201,9 @@ qeth_tso_fill_buffer(struct qeth_qdio_out_buffer *buf,
230 data += length_here; 201 data += length_here;
231 element++; 202 element++;
232 } 203 }
233 /*set the buffer to primed ...*/
234 buf->next_element_to_fill = element; 204 buf->next_element_to_fill = element;
235out: 205out:
206 /*prime buffer now ...*/
236 atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED); 207 atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);
237 return 1; 208 return 1;
238} 209}