1 /**********************************************************************
2  * Author: Cavium Networks
3  *
4  * Contact: support@caviumnetworks.com
5  * This file is part of the OCTEON SDK
6  *
7  * Copyright (c) 2003-2007 Cavium Networks
8  *
9  * This file is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License, Version 2, as
11  * published by the Free Software Foundation.
12  *
13  * This file is distributed in the hope that it will be useful, but
14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16  * NONINFRINGEMENT.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this file; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  * or visit http://www.gnu.org/licenses/.
23  *
24  * This file may also be available under a different license from Cavium.
25  * Contact Cavium Networks for more information
26 **********************************************************************/
27 
28 /*
29  * A few defines are used to control the operation of this driver:
30  *  USE_ASYNC_IOBDMA
31  *      Use asynchronous IO access to hardware. This uses Octeon's asynchronous
32  *      IOBDMAs to issue IO accesses without stalling. Set this to zero
33  *      to disable this. Note that IOBDMAs require CVMSEG.
34  *  REUSE_SKBUFFS_WITHOUT_FREE
35  *      Allows the TX path to free an skbuff into the FPA hardware pool. This
36  *      can significantly improve performance for forwarding and bridging, but
37  *      may be somewhat dangerous. Checks are made, but if any buffer is reused
38  *      without the proper Linux cleanup, the networking stack may have very
39  *      bizarre bugs.
40  */
41 #ifndef __ETHERNET_DEFINES_H__
42 #define __ETHERNET_DEFINES_H__
43 
44 #include <asm/octeon/cvmx-config.h>
45 
46 
47 #define OCTEON_ETHERNET_VERSION "1.9"
48 
49 #ifdef CONFIG_NETFILTER
50 #define REUSE_SKBUFFS_WITHOUT_FREE  0
51 #else
52 #define REUSE_SKBUFFS_WITHOUT_FREE  1
53 #endif
54 
55 #define USE_ASYNC_IOBDMA            (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
56 
57 /* Maximum number of SKBs to try to free per xmit packet. */
58 #define MAX_OUT_QUEUE_DEPTH 1000
59 
60 #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(uint32_t))
61 #define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(uint32_t))
62 
63 #define TOTAL_NUMBER_OF_PORTS       (CVMX_PIP_NUM_INPUT_PORTS+1)
64 
65 
66 #endif /* __ETHERNET_DEFINES_H__ */
67