hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/staging/octeon/ethernet-tx.c
....@@ -22,20 +22,10 @@
2222 #include <linux/atomic.h>
2323 #include <net/sch_generic.h>
2424
25
-#include <asm/octeon/octeon.h>
26
-
27
-#include "ethernet-defines.h"
2825 #include "octeon-ethernet.h"
26
+#include "ethernet-defines.h"
2927 #include "ethernet-tx.h"
3028 #include "ethernet-util.h"
31
-
32
-#include <asm/octeon/cvmx-wqe.h>
33
-#include <asm/octeon/cvmx-fau.h>
34
-#include <asm/octeon/cvmx-pip.h>
35
-#include <asm/octeon/cvmx-pko.h>
36
-#include <asm/octeon/cvmx-helper.h>
37
-
38
-#include <asm/octeon/cvmx-gmxx-defs.h>
3929
4030 #define CVM_OCT_SKB_CB(skb) ((u64 *)((skb)->cb))
4131
....@@ -51,7 +41,7 @@
5141 #endif
5242
5343 static void cvm_oct_tx_do_cleanup(unsigned long arg);
54
-static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup, 0);
44
+static DECLARE_TASKLET_OLD(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup);
5545
5646 /* Maximum number of SKBs to try to free per xmit packet. */
5747 #define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2)
....@@ -137,7 +127,7 @@
137127 */
138128 int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
139129 {
140
- cvmx_pko_command_word0_t pko_command;
130
+ union cvmx_pko_command_word0 pko_command;
141131 union cvmx_buf_ptr hw_buffer;
142132 u64 old_scratch;
143133 u64 old_scratch2;
....@@ -214,8 +204,10 @@
214204 * Get the number of skbuffs in use
215205 * by the hardware
216206 */
217
- skb_to_free = cvmx_fau_fetch_and_add32(
218
- priv->fau + qos * 4, MAX_SKB_TO_FREE);
207
+ skb_to_free =
208
+ cvmx_fau_fetch_and_add32(priv->fau +
209
+ qos * 4,
210
+ MAX_SKB_TO_FREE);
219211 }
220212 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
221213 priv->fau +
....@@ -269,24 +261,24 @@
269261 /* Build the PKO buffer pointer */
270262 hw_buffer.u64 = 0;
271263 if (skb_shinfo(skb)->nr_frags == 0) {
272
- hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
264
+ hw_buffer.s.addr = XKPHYS_TO_PHYS((uintptr_t)skb->data);
273265 hw_buffer.s.pool = 0;
274266 hw_buffer.s.size = skb->len;
275267 } else {
276
- hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
268
+ hw_buffer.s.addr = XKPHYS_TO_PHYS((uintptr_t)skb->data);
277269 hw_buffer.s.pool = 0;
278270 hw_buffer.s.size = skb_headlen(skb);
279271 CVM_OCT_SKB_CB(skb)[0] = hw_buffer.u64;
280272 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
281
- struct skb_frag_struct *fs = skb_shinfo(skb)->frags + i;
273
+ skb_frag_t *fs = skb_shinfo(skb)->frags + i;
282274
283
- hw_buffer.s.addr = XKPHYS_TO_PHYS(
284
- (u64)(page_address(fs->page.p) +
285
- fs->page_offset));
286
- hw_buffer.s.size = fs->size;
275
+ hw_buffer.s.addr =
276
+ XKPHYS_TO_PHYS((uintptr_t)skb_frag_address(fs));
277
+ hw_buffer.s.size = skb_frag_size(fs);
287278 CVM_OCT_SKB_CB(skb)[i + 1] = hw_buffer.u64;
288279 }
289
- hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)CVM_OCT_SKB_CB(skb));
280
+ hw_buffer.s.addr =
281
+ XKPHYS_TO_PHYS((uintptr_t)CVM_OCT_SKB_CB(skb));
290282 hw_buffer.s.size = skb_shinfo(skb)->nr_frags + 1;
291283 pko_command.s.segs = skb_shinfo(skb)->nr_frags + 1;
292284 pko_command.s.gather = 1;
....@@ -358,15 +350,12 @@
358350 */
359351 dst_release(skb_dst(skb));
360352 skb_dst_set(skb, NULL);
361
-#ifdef CONFIG_XFRM
362
- secpath_put(skb->sp);
363
- skb->sp = NULL;
364
-#endif
365
- nf_reset(skb);
353
+ skb_ext_reset(skb);
354
+ nf_reset_ct(skb);
355
+ skb_reset_redirect(skb);
366356
367357 #ifdef CONFIG_NET_SCHED
368358 skb->tc_index = 0;
369
- skb_reset_tc(skb);
370359 #endif /* CONFIG_NET_SCHED */
371360 #endif /* REUSE_SKBUFFS_WITHOUT_FREE */
372361
....@@ -414,8 +403,8 @@
414403 queue_type = QUEUE_HW;
415404 }
416405 if (USE_ASYNC_IOBDMA)
417
- cvmx_fau_async_fetch_and_add32(
418
- CVMX_SCR_SCRATCH, FAU_TOTAL_TX_TO_CLEAN, 1);
406
+ cvmx_fau_async_fetch_and_add32(CVMX_SCR_SCRATCH,
407
+ FAU_TOTAL_TX_TO_CLEAN, 1);
419408
420409 spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
421410
....@@ -492,8 +481,8 @@
492481 cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch);
493482 cvmx_scratch_write64(CVMX_SCR_SCRATCH + 8, old_scratch2);
494483 } else {
495
- total_to_clean = cvmx_fau_fetch_and_add32(
496
- FAU_TOTAL_TX_TO_CLEAN, 1);
484
+ total_to_clean =
485
+ cvmx_fau_fetch_and_add32(FAU_TOTAL_TX_TO_CLEAN, 1);
497486 }
498487
499488 if (total_to_clean & 0x3ff) {
....@@ -525,7 +514,7 @@
525514 void *copy_location;
526515
527516 /* Get a work queue entry */
528
- cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
517
+ struct cvmx_wqe *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
529518
530519 if (unlikely(!work)) {
531520 printk_ratelimited("%s: Failed to allocate a work queue entry\n",
....@@ -609,7 +598,7 @@
609598 #endif
610599 work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
611600 (ip_hdr(skb)->frag_off ==
612
- 1 << 14));
601
+ cpu_to_be16(1 << 14)));
613602 #if 0
614603 /* Assume Linux is sending a good packet */
615604 work->word2.s.IP_exc = 0;