| .. | .. |
|---|
| 22 | 22 | #include <linux/atomic.h> |
|---|
| 23 | 23 | #include <net/sch_generic.h> |
|---|
| 24 | 24 | |
|---|
| 25 | | -#include <asm/octeon/octeon.h> |
|---|
| 26 | | - |
|---|
| 27 | | -#include "ethernet-defines.h" |
|---|
| 28 | 25 | #include "octeon-ethernet.h" |
|---|
| 26 | +#include "ethernet-defines.h" |
|---|
| 29 | 27 | #include "ethernet-tx.h" |
|---|
| 30 | 28 | #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> |
|---|
| 39 | 29 | |
|---|
| 40 | 30 | #define CVM_OCT_SKB_CB(skb) ((u64 *)((skb)->cb)) |
|---|
| 41 | 31 | |
|---|
| .. | .. |
|---|
| 51 | 41 | #endif |
|---|
| 52 | 42 | |
|---|
| 53 | 43 | 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); |
|---|
| 55 | 45 | |
|---|
| 56 | 46 | /* Maximum number of SKBs to try to free per xmit packet. */ |
|---|
| 57 | 47 | #define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2) |
|---|
| .. | .. |
|---|
| 137 | 127 | */ |
|---|
| 138 | 128 | int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) |
|---|
| 139 | 129 | { |
|---|
| 140 | | - cvmx_pko_command_word0_t pko_command; |
|---|
| 130 | + union cvmx_pko_command_word0 pko_command; |
|---|
| 141 | 131 | union cvmx_buf_ptr hw_buffer; |
|---|
| 142 | 132 | u64 old_scratch; |
|---|
| 143 | 133 | u64 old_scratch2; |
|---|
| .. | .. |
|---|
| 214 | 204 | * Get the number of skbuffs in use |
|---|
| 215 | 205 | * by the hardware |
|---|
| 216 | 206 | */ |
|---|
| 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); |
|---|
| 219 | 211 | } |
|---|
| 220 | 212 | skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free, |
|---|
| 221 | 213 | priv->fau + |
|---|
| .. | .. |
|---|
| 269 | 261 | /* Build the PKO buffer pointer */ |
|---|
| 270 | 262 | hw_buffer.u64 = 0; |
|---|
| 271 | 263 | 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); |
|---|
| 273 | 265 | hw_buffer.s.pool = 0; |
|---|
| 274 | 266 | hw_buffer.s.size = skb->len; |
|---|
| 275 | 267 | } else { |
|---|
| 276 | | - hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data); |
|---|
| 268 | + hw_buffer.s.addr = XKPHYS_TO_PHYS((uintptr_t)skb->data); |
|---|
| 277 | 269 | hw_buffer.s.pool = 0; |
|---|
| 278 | 270 | hw_buffer.s.size = skb_headlen(skb); |
|---|
| 279 | 271 | CVM_OCT_SKB_CB(skb)[0] = hw_buffer.u64; |
|---|
| 280 | 272 | 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; |
|---|
| 282 | 274 | |
|---|
| 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); |
|---|
| 287 | 278 | CVM_OCT_SKB_CB(skb)[i + 1] = hw_buffer.u64; |
|---|
| 288 | 279 | } |
|---|
| 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)); |
|---|
| 290 | 282 | hw_buffer.s.size = skb_shinfo(skb)->nr_frags + 1; |
|---|
| 291 | 283 | pko_command.s.segs = skb_shinfo(skb)->nr_frags + 1; |
|---|
| 292 | 284 | pko_command.s.gather = 1; |
|---|
| .. | .. |
|---|
| 358 | 350 | */ |
|---|
| 359 | 351 | dst_release(skb_dst(skb)); |
|---|
| 360 | 352 | 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); |
|---|
| 366 | 356 | |
|---|
| 367 | 357 | #ifdef CONFIG_NET_SCHED |
|---|
| 368 | 358 | skb->tc_index = 0; |
|---|
| 369 | | - skb_reset_tc(skb); |
|---|
| 370 | 359 | #endif /* CONFIG_NET_SCHED */ |
|---|
| 371 | 360 | #endif /* REUSE_SKBUFFS_WITHOUT_FREE */ |
|---|
| 372 | 361 | |
|---|
| .. | .. |
|---|
| 414 | 403 | queue_type = QUEUE_HW; |
|---|
| 415 | 404 | } |
|---|
| 416 | 405 | 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); |
|---|
| 419 | 408 | |
|---|
| 420 | 409 | spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags); |
|---|
| 421 | 410 | |
|---|
| .. | .. |
|---|
| 492 | 481 | cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch); |
|---|
| 493 | 482 | cvmx_scratch_write64(CVMX_SCR_SCRATCH + 8, old_scratch2); |
|---|
| 494 | 483 | } 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); |
|---|
| 497 | 486 | } |
|---|
| 498 | 487 | |
|---|
| 499 | 488 | if (total_to_clean & 0x3ff) { |
|---|
| .. | .. |
|---|
| 525 | 514 | void *copy_location; |
|---|
| 526 | 515 | |
|---|
| 527 | 516 | /* 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); |
|---|
| 529 | 518 | |
|---|
| 530 | 519 | if (unlikely(!work)) { |
|---|
| 531 | 520 | printk_ratelimited("%s: Failed to allocate a work queue entry\n", |
|---|
| .. | .. |
|---|
| 609 | 598 | #endif |
|---|
| 610 | 599 | work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) || |
|---|
| 611 | 600 | (ip_hdr(skb)->frag_off == |
|---|
| 612 | | - 1 << 14)); |
|---|
| 601 | + cpu_to_be16(1 << 14))); |
|---|
| 613 | 602 | #if 0 |
|---|
| 614 | 603 | /* Assume Linux is sending a good packet */ |
|---|
| 615 | 604 | work->word2.s.IP_exc = 0; |
|---|