ethernet-defines.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * This file is based on code from OCTEON SDK by Cavium Networks.
  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.
  9. */
  10. /*
  11. * A few defines are used to control the operation of this driver:
  12. * USE_ASYNC_IOBDMA
  13. * Use asynchronous IO access to hardware. This uses Octeon's asynchronous
  14. * IOBDMAs to issue IO accesses without stalling. Set this to zero
  15. * to disable this. Note that IOBDMAs require CVMSEG.
  16. * REUSE_SKBUFFS_WITHOUT_FREE
  17. * Allows the TX path to free an skbuff into the FPA hardware pool. This
  18. * can significantly improve performance for forwarding and bridging, but
  19. * may be somewhat dangerous. Checks are made, but if any buffer is reused
  20. * without the proper Linux cleanup, the networking stack may have very
  21. * bizarre bugs.
  22. */
  23. #ifndef __ETHERNET_DEFINES_H__
  24. #define __ETHERNET_DEFINES_H__
  25. #include <asm/octeon/cvmx-config.h>
  26. #ifdef CONFIG_NETFILTER
  27. #define REUSE_SKBUFFS_WITHOUT_FREE 0
  28. #else
  29. #define REUSE_SKBUFFS_WITHOUT_FREE 1
  30. #endif
  31. #define USE_ASYNC_IOBDMA (CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0)
  32. /* Maximum number of SKBs to try to free per xmit packet. */
  33. #define MAX_OUT_QUEUE_DEPTH 1000
  34. #define FAU_TOTAL_TX_TO_CLEAN (CVMX_FAU_REG_END - sizeof(u32))
  35. #define FAU_NUM_PACKET_BUFFERS_TO_FREE (FAU_TOTAL_TX_TO_CLEAN - sizeof(u32))
  36. #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS + 1)
  37. #endif /* __ETHERNET_DEFINES_H__ */