diff options
author | Chris Packham <chris.packham@alliedtelesis.co.nz> | 2020-02-05 13:11:12 +1300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-12 13:50:32 -0800 |
commit | 422d97b8b05ed38cc5f67522ddb821868ea272a7 (patch) | |
tree | aecc83db4ac470447b390c93c9ed6438b8643429 /drivers/staging/octeon/ethernet-defines.h | |
parent | 96b06c0a16f737e9ea7dff1e23dd5f6d847e6731 (diff) | |
download | linux-422d97b8b05ed38cc5f67522ddb821868ea272a7.tar.bz2 |
Revert "staging: octeon: delete driver"
This reverts commit 710d7fbe21ee2ceab121f1f84a20edf68f9f9742.
Re-instate the code so subsequent commits can clean it up and get it
building properly.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20200205001116.14096-3-chris.packham@alliedtelesis.co.nz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon/ethernet-defines.h')
-rw-r--r-- | drivers/staging/octeon/ethernet-defines.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/staging/octeon/ethernet-defines.h b/drivers/staging/octeon/ethernet-defines.h new file mode 100644 index 000000000000..ef9e767b0e2e --- /dev/null +++ b/drivers/staging/octeon/ethernet-defines.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This file is based on code from OCTEON SDK by Cavium Networks. + * + * Copyright (c) 2003-2007 Cavium Networks + */ + +/* + * A few defines are used to control the operation of this driver: + * USE_ASYNC_IOBDMA + * Use asynchronous IO access to hardware. This uses Octeon's asynchronous + * IOBDMAs to issue IO accesses without stalling. Set this to zero + * to disable this. Note that IOBDMAs require CVMSEG. + * REUSE_SKBUFFS_WITHOUT_FREE + * Allows the TX path to free an skbuff into the FPA hardware pool. This + * can significantly improve performance for forwarding and bridging, but + * may be somewhat dangerous. Checks are made, but if any buffer is reused + * without the proper Linux cleanup, the networking stack may have very + * bizarre bugs. + */ +#ifndef __ETHERNET_DEFINES_H__ +#define __ETHERNET_DEFINES_H__ + +#ifdef CONFIG_NETFILTER +#define REUSE_SKBUFFS_WITHOUT_FREE 0 +#else +#define REUSE_SKBUFFS_WITHOUT_FREE 1 +#endif + +#define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) + +/* Maximum number of SKBs to try to free per xmit packet. */ +#define MAX_OUT_QUEUE_DEPTH 1000 + +#define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(u32)) +#define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(u32)) + +#define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS + 1) + +#endif /* __ETHERNET_DEFINES_H__ */ |