Aaro Koskinen | 6762098 | 2015-04-04 22:51:21 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is based on code from OCTEON SDK by Cavium Networks. |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 3 | * |
| 4 | * Copyright (c) 2003-2007 Cavium Networks |
| 5 | * |
| 6 | * This file is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License, Version 2, as |
| 8 | * published by the Free Software Foundation. |
Aaro Koskinen | 6762098 | 2015-04-04 22:51:21 +0300 | [diff] [blame] | 9 | */ |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 10 | |
| 11 | /* |
| 12 | * A few defines are used to control the operation of this driver: |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 13 | * USE_ASYNC_IOBDMA |
| 14 | * Use asynchronous IO access to hardware. This uses Octeon's asynchronous |
| 15 | * IOBDMAs to issue IO accesses without stalling. Set this to zero |
| 16 | * to disable this. Note that IOBDMAs require CVMSEG. |
| 17 | * REUSE_SKBUFFS_WITHOUT_FREE |
| 18 | * Allows the TX path to free an skbuff into the FPA hardware pool. This |
| 19 | * can significantly improve performance for forwarding and bridging, but |
| 20 | * may be somewhat dangerous. Checks are made, but if any buffer is reused |
| 21 | * without the proper Linux cleanup, the networking stack may have very |
| 22 | * bizarre bugs. |
| 23 | */ |
| 24 | #ifndef __ETHERNET_DEFINES_H__ |
| 25 | #define __ETHERNET_DEFINES_H__ |
| 26 | |
David Daney | af86649 | 2011-11-22 14:47:00 +0000 | [diff] [blame] | 27 | #include <asm/octeon/cvmx-config.h> |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 28 | |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 29 | #ifdef CONFIG_NETFILTER |
| 30 | #define REUSE_SKBUFFS_WITHOUT_FREE 0 |
| 31 | #else |
| 32 | #define REUSE_SKBUFFS_WITHOUT_FREE 1 |
| 33 | #endif |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 34 | |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 35 | #define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) |
| 36 | |
David Daney | a620c16 | 2009-06-23 16:20:56 -0700 | [diff] [blame] | 37 | /* Maximum number of SKBs to try to free per xmit packet. */ |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 38 | #define MAX_OUT_QUEUE_DEPTH 1000 |
| 39 | |
David Daney | 4898c56 | 2010-02-15 15:06:47 -0800 | [diff] [blame] | 40 | #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(uint32_t)) |
| 41 | #define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(uint32_t)) |
| 42 | |
David Daney | 80ff0fd | 2009-05-05 17:35:21 -0700 | [diff] [blame] | 43 | #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS+1) |
| 44 | |
| 45 | |
| 46 | #endif /* __ETHERNET_DEFINES_H__ */ |