mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/stm32/periph_eth: configurable buffer size
1. Move buffer configuration from boards to cpu/stm32 2. Allow overwriting buffer configuration - If the default configuration ever needs touching, this will be due to a use case and should be done by the application rather than the board 3. Reduce default RX buffer size - Now that handling of frames split up into multiple DMA descriptors works, we can make use of this Note: With the significantly smaller RX buffers the driver will now perform much worse when receiving data at maximum throughput. But as long as frames are small (which is to be expected for IoT or boarder gateway scenarios) the performance should not be affected.
This commit is contained in:
parent
932c311ee2
commit
51fe77afa4
@ -274,12 +274,6 @@ static const eth_conf_t eth_config = {
|
||||
}
|
||||
};
|
||||
|
||||
#define ETH_RX_BUFFER_COUNT (4)
|
||||
#define ETH_TX_BUFFER_COUNT (4)
|
||||
|
||||
#define ETH_RX_BUFFER_SIZE (1524)
|
||||
#define ETH_TX_BUFFER_SIZE (1524)
|
||||
|
||||
#define ETH_DMA_ISR isr_dma2_stream0
|
||||
|
||||
/** @} */
|
||||
|
@ -178,12 +178,6 @@ static const eth_conf_t eth_config = {
|
||||
}
|
||||
};
|
||||
|
||||
#define ETH_RX_BUFFER_COUNT (4)
|
||||
#define ETH_TX_BUFFER_COUNT (4)
|
||||
|
||||
#define ETH_RX_BUFFER_SIZE (1524)
|
||||
#define ETH_TX_BUFFER_SIZE (1524)
|
||||
|
||||
#define ETH_DMA_ISR isr_dma2_stream0
|
||||
|
||||
/** @} */
|
||||
|
@ -49,6 +49,31 @@
|
||||
#define CLOCK_RANGE ETH_MACMIIAR_CR_Div102
|
||||
#endif /* CLOCK_CORECLOCK < (20000000U) */
|
||||
|
||||
/* Default DMA buffer setup */
|
||||
#ifndef ETH_RX_BUFFER_COUNT
|
||||
#define ETH_RX_BUFFER_COUNT (6U)
|
||||
#endif
|
||||
#ifndef ETH_TX_BUFFER_COUNT
|
||||
#define ETH_TX_BUFFER_COUNT (4U)
|
||||
#endif
|
||||
#ifndef ETH_TX_BUFFER_SIZE
|
||||
#define ETH_TX_BUFFER_SIZE (1524U)
|
||||
#endif
|
||||
#ifndef ETH_RX_BUFFER_SIZE
|
||||
#define ETH_RX_BUFFER_SIZE (256U)
|
||||
#endif
|
||||
|
||||
#if (ETH_RX_BUFFER_SIZE % 16) != 0
|
||||
/* For compatibility with 128bit memory interfaces, the buffer size needs to
|
||||
* be a multiple of 16 Byte. For 64 bit memory interfaces need the size to be
|
||||
* a multiple of 8 Byte, for 32 bit a multiple of 4 byte is sufficient. */
|
||||
#warning "ETH_RX_BUFFER_SIZE is not a multiple of 16. (See comment above.)"
|
||||
#endif
|
||||
|
||||
#if ETH_RX_BUFFER_COUNT * ETH_RX_BUFFER_SIZE < 1524U
|
||||
#warning "Total RX buffers lower than MTU, you won't receive huge frames!"
|
||||
#endif
|
||||
|
||||
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
|
||||
|
||||
/* Descriptors */
|
||||
|
Loading…
Reference in New Issue
Block a user