1422d97b8SChris Packham /* SPDX-License-Identifier: GPL-2.0 */ 2422d97b8SChris Packham /* 3422d97b8SChris Packham * This file is based on code from OCTEON SDK by Cavium Networks. 4422d97b8SChris Packham * 5422d97b8SChris Packham * Copyright (c) 2003-2007 Cavium Networks 6422d97b8SChris Packham */ 7422d97b8SChris Packham 8422d97b8SChris Packham /* 9422d97b8SChris Packham * A few defines are used to control the operation of this driver: 10422d97b8SChris Packham * USE_ASYNC_IOBDMA 11422d97b8SChris Packham * Use asynchronous IO access to hardware. This uses Octeon's asynchronous 12422d97b8SChris Packham * IOBDMAs to issue IO accesses without stalling. Set this to zero 13422d97b8SChris Packham * to disable this. Note that IOBDMAs require CVMSEG. 14422d97b8SChris Packham * REUSE_SKBUFFS_WITHOUT_FREE 15422d97b8SChris Packham * Allows the TX path to free an skbuff into the FPA hardware pool. This 16422d97b8SChris Packham * can significantly improve performance for forwarding and bridging, but 17422d97b8SChris Packham * may be somewhat dangerous. Checks are made, but if any buffer is reused 18422d97b8SChris Packham * without the proper Linux cleanup, the networking stack may have very 19422d97b8SChris Packham * bizarre bugs. 20422d97b8SChris Packham */ 21422d97b8SChris Packham #ifndef __ETHERNET_DEFINES_H__ 22422d97b8SChris Packham #define __ETHERNET_DEFINES_H__ 23422d97b8SChris Packham 24422d97b8SChris Packham #ifdef CONFIG_NETFILTER 25422d97b8SChris Packham #define REUSE_SKBUFFS_WITHOUT_FREE 0 26422d97b8SChris Packham #else 27422d97b8SChris Packham #define REUSE_SKBUFFS_WITHOUT_FREE 1 28422d97b8SChris Packham #endif 29422d97b8SChris Packham 30422d97b8SChris Packham #define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) 31422d97b8SChris Packham 32422d97b8SChris Packham /* Maximum number of SKBs to try to free per xmit packet. */ 33422d97b8SChris Packham #define MAX_OUT_QUEUE_DEPTH 1000 34422d97b8SChris Packham 35422d97b8SChris Packham #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(u32)) 36422d97b8SChris Packham #define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(u32)) 37422d97b8SChris Packham 38422d97b8SChris Packham #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS + 1) 39422d97b8SChris Packham 40422d97b8SChris Packham #endif /* __ETHERNET_DEFINES_H__ */ 41