mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 13:46:56 +08:00
Remove ip4_frag IP_FRAG_USES_STATIC_BUF code: nearly the same as the other code, but IP_FRAG_USES_STATIC_BUF doesn't work when queuing pbufs
This commit is contained in:
@@ -73,7 +73,7 @@ struct pbuf * ip4_reass(struct pbuf *p);
|
||||
#endif /* IP_REASSEMBLY */
|
||||
|
||||
#if IP_FRAG
|
||||
#if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF
|
||||
#if !LWIP_NETIF_TX_SINGLE_PBUF
|
||||
#ifndef LWIP_PBUF_CUSTOM_REF_DEFINED
|
||||
#define LWIP_PBUF_CUSTOM_REF_DEFINED
|
||||
/** A custom pbuf that holds a reference to another pbuf, which is freed
|
||||
@@ -86,7 +86,7 @@ struct pbuf_custom_ref {
|
||||
struct pbuf *original;
|
||||
};
|
||||
#endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */
|
||||
#endif /* !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */
|
||||
#endif /* !LWIP_NETIF_TX_SINGLE_PBUF */
|
||||
|
||||
err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest);
|
||||
#endif /* IP_FRAG */
|
||||
|
||||
@@ -401,9 +401,9 @@
|
||||
/**
|
||||
* MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent
|
||||
* (fragments, not whole packets!).
|
||||
* This is only used with IP_FRAG_USES_STATIC_BUF==0 and
|
||||
* LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs
|
||||
* where the packet is not yet sent when netif->output returns.
|
||||
* This is only used with LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1
|
||||
* with DMA-enabled MACs where the packet is not yet sent when netif->output
|
||||
* returns.
|
||||
*/
|
||||
#if !defined MEMP_NUM_FRAG_PBUF || defined __DOXYGEN__
|
||||
#define MEMP_NUM_FRAG_PBUF 15
|
||||
@@ -705,25 +705,6 @@
|
||||
#define IP_REASS_MAX_PBUFS 10
|
||||
#endif
|
||||
|
||||
/**
|
||||
* IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
|
||||
* fragmentation. Otherwise pbufs are allocated and reference the original
|
||||
* packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1,
|
||||
* new PBUF_RAM pbufs are used for fragments).
|
||||
* ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs!
|
||||
*/
|
||||
#if !defined IP_FRAG_USES_STATIC_BUF || defined __DOXYGEN__
|
||||
#define IP_FRAG_USES_STATIC_BUF 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer
|
||||
* (requires IP_FRAG_USES_STATIC_BUF==1)
|
||||
*/
|
||||
#if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) || defined __DOXYGEN__
|
||||
#define IP_FRAG_MAX_MTU 1500
|
||||
#endif
|
||||
|
||||
/**
|
||||
* IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers.
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
* Currently, the pbuf_custom code is only needed for one specific configuration
|
||||
* of IP_FRAG, unless required by external driver/application code. */
|
||||
#ifndef LWIP_SUPPORT_CUSTOM_PBUF
|
||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||
#endif
|
||||
|
||||
/* @todo: We need a mechanism to prevent wasting memory in every pbuf
|
||||
|
||||
@@ -55,9 +55,9 @@ LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg),
|
||||
#if LWIP_IPV4 && IP_REASSEMBLY
|
||||
LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA")
|
||||
#endif /* LWIP_IPV4 && IP_REASSEMBLY */
|
||||
#if (IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)
|
||||
#if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)
|
||||
LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF")
|
||||
#endif /* IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */
|
||||
#endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */
|
||||
|
||||
#if LWIP_NETCONN || LWIP_SOCKET
|
||||
LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF")
|
||||
|
||||
Reference in New Issue
Block a user