This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile. People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header). A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length. Instead, we define the packet buffer size then derive the MTU.
The MTU is not common currency in networking. On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP). Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes. So we should be all good and without the recurring 14 byte error in MTU's and MSS's.
Squashed commit of the following:
Trivial update to fix some spacing issues.
net/: Rename several macros containing _MTU to _PKTSIZE.
net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU. These are not the MTU which does not include the size of the link layer header. These are the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE. This is not the MTU which does not include the size of the link layer header. This is the full size of the packet buffer memory (minus any GUARD bytes).
net/: Rename the file d_mtu in the network driver structure to d_pktsize. That value saved there is not the MTU. The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header. The MTU does not include the link layer header.
This commit is contained in:
parent
daa3fcc781
commit
22cd0d47fa
96 changed files with 275 additions and 271 deletions
|
|
@ -4270,7 +4270,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><b><code>CONFIG_NET_ETH_MTU=650</code></b> (or larger)</td>
|
||||
<td valign="top"><b><code>CONFIG_NET_ETH_PKTSIZE=650</code></b> (or larger)</td>
|
||||
<td>
|
||||
Per RFC2131 (p. 9), the DHCP client must be prepared to receive DHCP messages of up to
|
||||
576 bytes (excluding Ethernet, IP, or UDP headers and FCS).
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* The c5471_driver_s encapsulates all state information for a single c5471
|
||||
* hardware interface
|
||||
|
|
@ -1224,7 +1224,7 @@ static void c5471_receive(struct c5471_driver_s *priv)
|
|||
|
||||
/* Check if the received packet will fit within the network packet buffer */
|
||||
|
||||
if (packetlen < (CONFIG_NET_ETH_MTU + 4))
|
||||
if (packetlen < (CONFIG_NET_ETH_PKTSIZE + 4))
|
||||
{
|
||||
/* Get the packet memory from words #2 and #3 of descriptor */
|
||||
|
||||
|
|
@ -1285,7 +1285,7 @@ static void c5471_receive(struct c5471_driver_s *priv)
|
|||
* to the network for processing.
|
||||
*/
|
||||
|
||||
if (packetlen > 0 && packetlen < CONFIG_NET_ETH_MTU)
|
||||
if (packetlen > 0 && packetlen < CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
/* Set amount of data in priv->c_dev.d_len. */
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@
|
|||
|
||||
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
|
||||
|
||||
#define IMXRT_BUF_SIZE ENET_ALIGN_UP(CONFIG_NET_ETH_MTU)
|
||||
#define IMXRT_BUF_SIZE ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
|
|
@ -1996,11 +1996,11 @@ static inline int imxrt_initphy(struct imxrt_driver_s *priv)
|
|||
|
||||
#ifdef CONFIG_IMXRT_ENETUSEMII
|
||||
rcr = ENET_RCR_CRCFWD |
|
||||
CONFIG_NET_ETH_MTU << ENET_RCR_MAX_FL_SHIFT |
|
||||
CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
|
||||
ENET_RCR_MII_MODE;
|
||||
#else
|
||||
rcr = ENET_RCR_RMII_MODE | ENET_RCR_CRCFWD |
|
||||
CONFIG_NET_ETH_MTU << ENET_RCR_MAX_FL_SHIFT |
|
||||
CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
|
||||
ENET_RCR_MII_MODE;
|
||||
#endif
|
||||
tcr = 0;
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@
|
|||
|
||||
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
|
||||
|
||||
#define KINETIS_BUF_SIZE ((CONFIG_NET_ETH_MTU & 0xfffffff0) + 0x10)
|
||||
#define KINETIS_BUF_SIZE ((CONFIG_NET_ETH_PKTSIZE & 0xfffffff0) + 0x10)
|
||||
|
||||
/* If this SoC has the RMII Clock Source selection configure it */
|
||||
|
||||
|
|
@ -1807,11 +1807,11 @@ static inline int kinetis_initphy(struct kinetis_driver_s *priv)
|
|||
|
||||
#ifdef CONFIG_KINETIS_ENETUSEMII
|
||||
rcr = ENET_RCR_CRCFWD |
|
||||
CONFIG_NET_ETH_MTU << ENET_RCR_MAX_FL_SHIFT |
|
||||
CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
|
||||
ENET_RCR_MII_MODE;
|
||||
#else
|
||||
rcr = ENET_RCR_RMII_MODE | ENET_RCR_CRCFWD |
|
||||
CONFIG_NET_ETH_MTU << ENET_RCR_MAX_FL_SHIFT |
|
||||
CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
|
||||
ENET_RCR_MII_MODE;
|
||||
#endif
|
||||
tcr = 0;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@
|
|||
/* Descriptor Memory Layout *********************************************************/
|
||||
/* EMAC DMA RAM and descriptor definitions. The configured number of descriptors
|
||||
* will determine the organization and the size of the descriptor and status tables.
|
||||
* There is a complex interaction between the maximum packet size (CONFIG_NET_ETH_MTU)
|
||||
* There is a complex interaction between the maximum packet size (CONFIG_NET_ETH_PKTSIZE)
|
||||
* and the number of Rx and Tx descriptors that can be supported (CONFIG_LPC17_ETH_NRXDESC
|
||||
* and CONFIG_LPC17_ETH_NTXDESC): Small buffers -> more packets. This is something that
|
||||
* needs to be tuned for you system.
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
#define LPC17_PKTMEM_SIZE (LPC17_EMACRAM_SIZE-LPC17_DESCTAB_SIZE)
|
||||
#define LPC17_PKTMEM_END (LPC17_EMACRAM_BASE+LPC17_PKTMEM_SIZE)
|
||||
|
||||
#define LPC17_MAXPACKET_SIZE ((CONFIG_NET_ETH_MTU + CONFIG_NET_GUARDSIZE + 3) & ~3)
|
||||
#define LPC17_MAXPACKET_SIZE ((CONFIG_NET_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE + 3) & ~3)
|
||||
#define LPC17_NTXPKTS CONFIG_LPC17_ETH_NTXDESC
|
||||
#define LPC17_NRXPKTS CONFIG_LPC17_ETH_NRXDESC
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
# define CONFIG_LPC17_ETH_PRIORITY NVIC_SYSH_PRIORITY_DEFAULT
|
||||
#endif
|
||||
|
||||
#define PKTBUF_SIZE (MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE)
|
||||
#define PKTBUF_SIZE (MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE)
|
||||
|
||||
/* Debug Configuration *****************************************************/
|
||||
/* Register debug -- can only happen of CONFIG_DEBUG_NET_INFO is selected */
|
||||
|
|
@ -860,7 +860,7 @@ static void lpc17_rxdone_work(FAR void *arg)
|
|||
* imply that the packet is too big.
|
||||
*/
|
||||
|
||||
/* else */ if (pktlen > CONFIG_NET_ETH_MTU + CONFIG_NET_GUARDSIZE)
|
||||
/* else */ if (pktlen > CONFIG_NET_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE)
|
||||
{
|
||||
nwarn("WARNING: Too big. considx: %08x prodidx: %08x pktlen: %d rxstat: %08x\n",
|
||||
considx, prodidx, pktlen, *rxstat);
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@
|
|||
* will use the 16-byte alignment in all cases.
|
||||
*/
|
||||
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_MTU + 4 + 15) & ~15)
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 4 + 15) & ~15)
|
||||
|
||||
#ifndef CONFIG_LPC43_ETH_BUFSIZE
|
||||
# define CONFIG_LPC43_ETH_BUFSIZE OPTIMAL_ETH_BUFSIZE
|
||||
|
|
@ -1028,7 +1028,7 @@ static int lpc43_transmit(FAR struct lpc43_ethmac_s *priv)
|
|||
|
||||
/* Set frame size */
|
||||
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_MTU);
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_PKTSIZE);
|
||||
txdesc->tdes1 = priv->dev.d_len;
|
||||
|
||||
/* Set the Buffer1 address pointer */
|
||||
|
|
@ -1603,7 +1603,7 @@ static void lpc43_receive(FAR struct lpc43_ethmac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
/* Free dropped packet buffer */
|
||||
|
|
|
|||
|
|
@ -179,9 +179,9 @@
|
|||
CONFIG_LPC54_ETH_NTXDESC0)
|
||||
#endif
|
||||
|
||||
#define LPC54_BUFFER_SIZE MAX_NET_DEV_MTU
|
||||
#define LPC54_BUFFER_ALLOC ((MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE + 3) & ~3)
|
||||
#define LPC54_BUFFER_WORDS ((MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE + 3) >> 2)
|
||||
#define LPC54_BUFFER_SIZE MAX_NETDEV_PKTSIZE
|
||||
#define LPC54_BUFFER_ALLOC ((MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE + 3) & ~3)
|
||||
#define LPC54_BUFFER_WORDS ((MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE + 3) >> 2)
|
||||
#define LPC54_BUFFER_MAX 16384
|
||||
|
||||
/* DMA and DMA descriptor definitions */
|
||||
|
|
|
|||
|
|
@ -216,8 +216,8 @@
|
|||
|
||||
/* EMAC buffer sizes, number of buffers, and number of descriptors. *********/
|
||||
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_MTU /* MAX size for Ethernet packet */
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_PKTSIZE /* MAX size for Ethernet packet */
|
||||
|
||||
/* We need at least one more free buffer than transmit buffers */
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ static struct sam_emac_s g_emac;
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
#ifdef CONFIG_SAM34_EMAC_PREALLOCATE
|
||||
/* Preallocated data */
|
||||
|
|
@ -1078,9 +1078,9 @@ static int sam_recvframe(struct sam_emac_s *priv)
|
|||
/* Get the number of bytes to copy from the buffer */
|
||||
|
||||
copylen = EMAC_RX_UNITSIZE;
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_MTU)
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
copylen = CONFIG_NET_ETH_MTU - pktlen;
|
||||
copylen = CONFIG_NET_ETH_PKTSIZE - pktlen;
|
||||
}
|
||||
|
||||
/* Get the data source. Invalidate the source memory region to
|
||||
|
|
@ -1201,7 +1201,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -221,8 +221,8 @@
|
|||
|
||||
/* EMAC buffer sizes, number of buffers, and number of descriptors. *********/
|
||||
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_MTU /* MAX size for Ethernet packet */
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_PKTSIZE /* MAX size for Ethernet packet */
|
||||
|
||||
/* We need at least one more free buffer than transmit buffers */
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ static struct sam_emac_s g_emac;
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
#ifdef CONFIG_SAMA5_EMACA_PREALLOCATE
|
||||
/* Preallocated data */
|
||||
|
|
@ -1099,9 +1099,9 @@ static int sam_recvframe(struct sam_emac_s *priv)
|
|||
/* Get the number of bytes to copy from the buffer */
|
||||
|
||||
copylen = EMAC_RX_UNITSIZE;
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_MTU)
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
copylen = CONFIG_NET_ETH_MTU - pktlen;
|
||||
copylen = CONFIG_NET_ETH_PKTSIZE - pktlen;
|
||||
}
|
||||
|
||||
/* Get the data source. Invalidate the source memory region to
|
||||
|
|
@ -1239,7 +1239,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -314,8 +314,8 @@
|
|||
|
||||
/* EMAC buffer sizes, number of buffers, and number of descriptors **********/
|
||||
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_MTU /* MAX size for Ethernet packet */
|
||||
#define EMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define EMAC_TX_UNITSIZE CONFIG_NET_ETH_PKTSIZE /* MAX size for Ethernet packet */
|
||||
|
||||
/* Timing *******************************************************************/
|
||||
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per
|
||||
|
|
@ -694,7 +694,7 @@ static const struct sam_emacattr_s g_emac0_attr =
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf0[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* EMAC0 peripheral state */
|
||||
|
||||
|
|
@ -774,7 +774,7 @@ static const struct sam_emacattr_s g_emac1_attr =
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf1[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* EMAC1 peripheral state */
|
||||
|
||||
|
|
@ -1434,9 +1434,9 @@ static int sam_recvframe(struct sam_emac_s *priv)
|
|||
/* Get the number of bytes to copy from the buffer */
|
||||
|
||||
copylen = EMAC_RX_UNITSIZE;
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_MTU)
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
copylen = CONFIG_NET_ETH_MTU - pktlen;
|
||||
copylen = CONFIG_NET_ETH_PKTSIZE - pktlen;
|
||||
}
|
||||
|
||||
/* Get the data source. Invalidate the source memory region to
|
||||
|
|
@ -1574,7 +1574,7 @@ static void sam_receive(struct sam_emac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -140,14 +140,14 @@
|
|||
|
||||
/* GMAC buffer sizes, number of buffers, and number of descriptors. *********/
|
||||
|
||||
#define GMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define GMAC_TX_UNITSIZE CONFIG_NET_ETH_MTU /* MAX size for Ethernet packet */
|
||||
#define GMAC_RX_UNITSIZE 128 /* Fixed size for RX buffer */
|
||||
#define GMAC_TX_UNITSIZE CONFIG_NET_ETH_PKTSIZE /* MAX size for Ethernet packet */
|
||||
|
||||
/* The MAC can support frame lengths up to 1536 bytes */
|
||||
|
||||
#define GMAC_MAX_FRAMELEN 1536
|
||||
#if CONFIG_NET_ETH_MTU >GMAC_MAX_FRAMELEN
|
||||
# error CONFIG_NET_ETH_MTU is too large
|
||||
#if CONFIG_NET_ETH_PKTSIZE >GMAC_MAX_FRAMELEN
|
||||
# error CONFIG_NET_ETH_PKTSIZE is too large
|
||||
#endif
|
||||
|
||||
/* We need at least one more free buffer than transmit buffers */
|
||||
|
|
@ -247,7 +247,7 @@ static struct sam_gmac_s g_gmac;
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
#ifdef CONFIG_SAMA5_GMAC_PREALLOCATE
|
||||
/* Preallocated data */
|
||||
|
|
@ -1031,9 +1031,9 @@ static int sam_recvframe(struct sam_gmac_s *priv)
|
|||
/* Get the number of bytes to copy from the buffer */
|
||||
|
||||
copylen = GMAC_RX_UNITSIZE;
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_MTU)
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
copylen = CONFIG_NET_ETH_MTU - pktlen;
|
||||
copylen = CONFIG_NET_ETH_PKTSIZE - pktlen;
|
||||
}
|
||||
|
||||
/* Get the data source. Invalidate the source memory region to
|
||||
|
|
@ -1169,7 +1169,7 @@ static void sam_receive(struct sam_gmac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@
|
|||
*/
|
||||
|
||||
#define EMAC_RX_UNITSIZE EMAC_ALIGN_UP(128)
|
||||
#define EMAC_TX_UNITSIZE EMAC_ALIGN_UP(CONFIG_NET_ETH_MTU)
|
||||
#define EMAC_TX_UNITSIZE EMAC_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
|
||||
#define DUMMY_BUFSIZE EMAC_ALIGN_UP(128)
|
||||
#define DUMMY_NBUFFERS 2
|
||||
|
||||
|
|
@ -852,7 +852,7 @@ static const struct sam_emacattr_s g_emac0_attr =
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf0[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf0[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* EMAC0 peripheral state */
|
||||
|
||||
|
|
@ -932,7 +932,7 @@ static const struct sam_emacattr_s g_emac1_attr =
|
|||
* a full packet.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf1[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf1[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* EMAC1 peripheral state */
|
||||
|
||||
|
|
@ -1762,9 +1762,9 @@ static int sam_recvframe(struct sam_emac_s *priv, int qid)
|
|||
/* Get the number of bytes to copy from the buffer */
|
||||
|
||||
copylen = EMAC_RX_UNITSIZE;
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_MTU)
|
||||
if ((pktlen + copylen) > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
copylen = CONFIG_NET_ETH_MTU - pktlen;
|
||||
copylen = CONFIG_NET_ETH_PKTSIZE - pktlen;
|
||||
}
|
||||
|
||||
/* Get the data source. Invalidate the source memory region to
|
||||
|
|
@ -1917,7 +1917,7 @@ static void sam_receive(struct sam_emac_s *priv, int qid)
|
|||
* configuration (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Dropped, Too big: %d\n", dev->d_len);
|
||||
NETDEV_RXERRORS(&priv->dev);
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@
|
|||
* will use the 16-byte alignment in all cases.
|
||||
*/
|
||||
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_MTU + 4 + 15) & ~15)
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 4 + 15) & ~15)
|
||||
|
||||
#ifndef CONFIG_STM32_ETH_BUFSIZE
|
||||
# define CONFIG_STM32_ETH_BUFSIZE OPTIMAL_ETH_BUFSIZE
|
||||
|
|
@ -1134,7 +1134,7 @@ static int stm32_transmit(FAR struct stm32_ethmac_s *priv)
|
|||
|
||||
/* Set frame size */
|
||||
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_MTU);
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_PKTSIZE);
|
||||
txdesc->tdes1 = priv->dev.d_len;
|
||||
|
||||
/* Set the Buffer1 address pointer */
|
||||
|
|
@ -1709,7 +1709,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nerr("ERROR: Dropped, Too big: %d\n", dev->d_len);
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@
|
|||
* will use the 16-byte alignment in all cases.
|
||||
*/
|
||||
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_MTU + 4 + 15) & ~15)
|
||||
#define OPTIMAL_ETH_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 4 + 15) & ~15)
|
||||
|
||||
#ifdef CONFIG_STM32F7_ETH_BUFSIZE
|
||||
# define ETH_BUFSIZE CONFIG_STM32F7_ETH_BUFSIZE
|
||||
|
|
@ -1159,7 +1159,7 @@ static int stm32_transmit(struct stm32_ethmac_s *priv)
|
|||
|
||||
/* Set frame size */
|
||||
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_MTU);
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_PKTSIZE);
|
||||
txdesc->tdes1 = priv->dev.d_len;
|
||||
|
||||
/* Set the Buffer1 address pointer */
|
||||
|
|
@ -1784,7 +1784,7 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: DROPPED Too big: %d\n", dev->d_len);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ struct tiva_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Ethernet peripheral state */
|
||||
|
||||
|
|
@ -713,7 +713,7 @@ static void tiva_receive(struct tiva_driver_s *priv)
|
|||
* and 4 byte FCS that are not copied into the network packet.
|
||||
*/
|
||||
|
||||
if (pktlen > (CONFIG_NET_ETH_MTU + 6) || pktlen <= (ETH_HDRLEN + 6))
|
||||
if (pktlen > (CONFIG_NET_ETH_PKTSIZE + 6) || pktlen <= (ETH_HDRLEN + 6))
|
||||
{
|
||||
int wordlen;
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
* will use the 16-byte alignment in all cases.
|
||||
*/
|
||||
|
||||
#define OPTIMAL_EMAC_BUFSIZE ((CONFIG_NET_ETH_MTU + 4 + 15) & ~15)
|
||||
#define OPTIMAL_EMAC_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 4 + 15) & ~15)
|
||||
|
||||
#if OPTIMAL_EMAC_BUFSIZE > EMAC_TDES1_TBS1_MASK
|
||||
# error OPTIMAL_EMAC_BUFSIZE is too large
|
||||
|
|
@ -1136,7 +1136,7 @@ static int tiva_transmit(FAR struct tiva_ethmac_s *priv)
|
|||
|
||||
/* Set frame size */
|
||||
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_MTU);
|
||||
DEBUGASSERT(priv->dev.d_len <= CONFIG_NET_ETH_PKTSIZE);
|
||||
txdesc->tdes1 = priv->dev.d_len;
|
||||
|
||||
/* Set the Buffer1 address pointer */
|
||||
|
|
@ -1711,7 +1711,7 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv)
|
|||
* (this should not happen)
|
||||
*/
|
||||
|
||||
if (dev->d_len > CONFIG_NET_ETH_MTU)
|
||||
if (dev->d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("DROPPED: Too big: %d\n", dev->d_len);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ struct emac_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver state structure */
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
* type).
|
||||
*/
|
||||
|
||||
#define PIC32MX_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 3) & ~3)
|
||||
#define PIC32MX_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 3) & ~3)
|
||||
|
||||
/* The number of buffers will, then, be one for each descriptor plus one extra */
|
||||
|
||||
|
|
@ -1021,7 +1021,7 @@ static int pic32mx_transmit(struct pic32mx_driver_s *priv)
|
|||
*/
|
||||
|
||||
DEBUGASSERT(priv->pd_dev.d_buf != NULL &&
|
||||
priv->pd_dev.d_len < CONFIG_NET_ETH_MTU);
|
||||
priv->pd_dev.d_len < CONFIG_NET_ETH_PKTSIZE);
|
||||
|
||||
/* Increment statistics and dump the packet (if so configured) */
|
||||
|
||||
|
|
@ -1393,7 +1393,7 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv)
|
|||
* imply that the packet is too big.
|
||||
*/
|
||||
|
||||
else if (priv->pd_dev.d_len > CONFIG_NET_ETH_MTU)
|
||||
else if (priv->pd_dev.d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nerr("ERROR: Too big. packet length: %d rxdesc: %08x\n",
|
||||
priv->pd_dev.d_len, rxdesc->status);
|
||||
|
|
@ -2208,7 +2208,7 @@ static int pic32mx_ifup(struct net_driver_s *dev)
|
|||
* length restriction is desired, program this 16-bit field.
|
||||
*/
|
||||
|
||||
pic32mx_putreg(CONFIG_NET_ETH_MTU, PIC32MX_EMAC1_MAXF);
|
||||
pic32mx_putreg(CONFIG_NET_ETH_PKTSIZE, PIC32MX_EMAC1_MAXF);
|
||||
|
||||
/* Configure the MAC station address in the EMAC1SA0, EMAC1SA1 and
|
||||
* EMAC1SA2 registers (these registers are loaded at reset from the
|
||||
|
|
@ -2273,7 +2273,7 @@ static int pic32mx_ifup(struct net_driver_s *dev)
|
|||
* noticeable impact on the performance.
|
||||
*/
|
||||
|
||||
pic32mx_putreg(ETH_CON2_RXBUFSZ(CONFIG_NET_ETH_MTU), PIC32MX_ETH_CON2);
|
||||
pic32mx_putreg(ETH_CON2_RXBUFSZ(CONFIG_NET_ETH_PKTSIZE), PIC32MX_ETH_CON2);
|
||||
|
||||
/* Reset state varialbes */
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
* type).
|
||||
*/
|
||||
|
||||
#define PIC32MZ_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 3) & ~3)
|
||||
#define PIC32MZ_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 3) & ~3)
|
||||
|
||||
/* The number of buffers will, then, be one for each descriptor plus one extra */
|
||||
|
||||
|
|
@ -1048,7 +1048,7 @@ static int pic32mz_transmit(struct pic32mz_driver_s *priv)
|
|||
*/
|
||||
|
||||
DEBUGASSERT(priv->pd_dev.d_buf != NULL &&
|
||||
priv->pd_dev.d_len < CONFIG_NET_ETH_MTU);
|
||||
priv->pd_dev.d_len < CONFIG_NET_ETH_PKTSIZE);
|
||||
|
||||
/* Increment statistics and dump the packet (if so configured) */
|
||||
|
||||
|
|
@ -1420,7 +1420,7 @@ static void pic32mz_rxdone(struct pic32mz_driver_s *priv)
|
|||
* imply that the packet is too big.
|
||||
*/
|
||||
|
||||
else if (priv->pd_dev.d_len > CONFIG_NET_ETH_MTU)
|
||||
else if (priv->pd_dev.d_len > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Too big. packet length: %d rxdesc: %08x\n",
|
||||
priv->pd_dev.d_len, rxdesc->status);
|
||||
|
|
@ -2235,7 +2235,7 @@ static int pic32mz_ifup(struct net_driver_s *dev)
|
|||
* length restriction is desired, program this 16-bit field.
|
||||
*/
|
||||
|
||||
pic32mz_putreg(CONFIG_NET_ETH_MTU, PIC32MZ_EMAC1_MAXF);
|
||||
pic32mz_putreg(CONFIG_NET_ETH_PKTSIZE, PIC32MZ_EMAC1_MAXF);
|
||||
|
||||
/* Configure the MAC station address in the EMAC1SA0, EMAC1SA1 and
|
||||
* EMAC1SA2 registers (these registers are loaded at reset from the
|
||||
|
|
@ -2305,7 +2305,7 @@ static int pic32mz_ifup(struct net_driver_s *dev)
|
|||
* noticeable impact on the performance.
|
||||
*/
|
||||
|
||||
pic32mz_putreg(ETH_CON2_RXBUFSZ(CONFIG_NET_ETH_MTU), PIC32MZ_ETH_CON2);
|
||||
pic32mz_putreg(ETH_CON2_RXBUFSZ(CONFIG_NET_ETH_PKTSIZE), PIC32MZ_ETH_CON2);
|
||||
|
||||
/* Reset state varialbes */
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ struct misoc_net_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver state structur */
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ endif
|
|||
ifeq ($(CONFIG_SIM_NETDEV),y)
|
||||
ifeq ($(CONFIG_NET_ETHERNET),y)
|
||||
CSRCS += up_netdriver.c
|
||||
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_MTU)
|
||||
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_PKTSIZE)
|
||||
ifneq ($(HOSTOS),Cygwin)
|
||||
HOSTSRCS += up_tapdev.c up_netdev.c
|
||||
ifeq ($(CONFIG_SIM_NET_BRIDGE),y)
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ static struct timer g_periodic_timer;
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Ethernet peripheral state */
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ void netdriver_loop(void)
|
|||
/* netdev_read will return 0 on a timeout event and >0 on a data received event */
|
||||
|
||||
g_sim_dev.d_len = netdev_read((FAR unsigned char *)g_sim_dev.d_buf,
|
||||
CONFIG_NET_ETH_MTU);
|
||||
CONFIG_NET_ETH_PKTSIZE);
|
||||
|
||||
/* Disable preemption through to the following so that it behaves a little more
|
||||
* like an interrupt (otherwise, the following logic gets pre-empted an behaves
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
# define CONFIG_EZ80_RAMADDR EZ80_EMACSRAM
|
||||
#endif
|
||||
|
||||
#if CONFIG_NET_ETH_MTU > 1518
|
||||
#if CONFIG_NET_ETH_PKTSIZE > 1518
|
||||
# error "MAXF size too big for this device"
|
||||
#endif
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ struct ez80emac_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* There is only a single instance of driver private data (because there is
|
||||
* only one EMAC interface.
|
||||
|
|
@ -1272,10 +1272,10 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
|
|||
* for the network buffer configuration (I routinely see
|
||||
*/
|
||||
|
||||
if (rxdesc->pktsize > CONFIG_NET_ETH_MTU)
|
||||
if (rxdesc->pktsize > CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
ninfo("Truncated oversize RX pkt: %d->%d\n", rxdesc->pktsize, CONFIG_NET_ETH_MTU);
|
||||
pktlen = CONFIG_NET_ETH_MTU;
|
||||
ninfo("Truncated oversize RX pkt: %d->%d\n", rxdesc->pktsize, CONFIG_NET_ETH_PKTSIZE);
|
||||
pktlen = CONFIG_NET_ETH_PKTSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ CONFIG_NETUTILS_TFTPC=y
|
|||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_HOSTNAME="Bambino-200E"
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ Networking Support
|
|||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_ETHERNET=y : Support Ethernet data link
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=590 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : Enable ARP
|
||||
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
|
||||
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ CONFIG_MAX_TASKS=16
|
|||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_ICMPv6=y
|
||||
CONFIG_NET_ICMPv6_NEIGHBOR=y
|
||||
CONFIG_NET_ICMPv6_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ Networking Support
|
|||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_ETHERNET=y : Support Ethernet data link
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=590 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : Enable ARP
|
||||
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
|
||||
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
|
||||
|
|
@ -805,9 +805,9 @@ Freedom K64F Configuration Options
|
|||
Kenetis ethernet controller settings
|
||||
|
||||
CONFIG_ENET_NRXBUFFERS - Number of RX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 6
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 6
|
||||
CONFIG_ENET_NTXBUFFERS - Number of TX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 2
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 2
|
||||
CONFIG_ENET_USEMII - Use MII mode. Default: RMII mode.
|
||||
CONFIG_ENET_PHYADDR - PHY address
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ Networking Support
|
|||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_ETHERNET=y : Support Ethernet data link
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=590 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : Enable ARP
|
||||
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
|
||||
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
|
||||
|
|
@ -812,9 +812,9 @@ Freedom K66F Configuration Options
|
|||
Kenetis ethernet controller settings
|
||||
|
||||
CONFIG_ENET_NRXBUFFERS - Number of RX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 6
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 6
|
||||
CONFIG_ENET_NTXBUFFERS - Number of TX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 2
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 2
|
||||
CONFIG_ENET_USEMII - Use MII mode. Default: RMII mode.
|
||||
CONFIG_ENET_PHYADDR - PHY address
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ CONFIG_NETUTILS_TELNETD=y
|
|||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_LOOPBACK=y
|
||||
|
|
@ -94,7 +94,7 @@ CONFIG_NET_STATISTICS=y
|
|||
CONFIG_NET_TCP=y
|
||||
CONFIG_NET_TCP_KEEPALIVE=y
|
||||
CONFIG_NET_TUN=y
|
||||
CONFIG_NET_TUN_MTU=1500
|
||||
CONFIG_NET_TUN_PKTSIZE=1500
|
||||
CONFIG_NET_UDP=y
|
||||
CONFIG_NET_UDP_BINDTODEVICE=y
|
||||
CONFIG_NFILE_DESCRIPTORS=45
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ CONFIG_NETUTILS_TELNETD=y
|
|||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_LOOPBACK=y
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ CONFIG_NETUTILS_TELNETD=y
|
|||
CONFIG_NETUTILS_TFTPC=y
|
||||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_MAX_LISTENPORTS=8
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ CONFIG_NETUTILS_WEBCLIENT=y
|
|||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=1400
|
||||
CONFIG_NET_ETH_PKTSIZE=1400
|
||||
CONFIG_NET_GUARDSIZE=648
|
||||
CONFIG_NET_HOSTNAME="nuttx"
|
||||
CONFIG_NET_ICMP=y
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ CONFIG_NETDEVICES=y
|
|||
CONFIG_NETUTILS_TELNETD=y
|
||||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_FTMAC100=y
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ Configuration Sub-Directories
|
|||
use the UART1 hardware flow control yet.
|
||||
|
||||
NOTE: The Linux slip module hard-codes its MTU size to 296. So you
|
||||
might as well set CONFIG_NET_ETH_MTU to 296 as well.
|
||||
might as well set CONFIG_NET_ETH_PKTSIZE to 296 as well.
|
||||
|
||||
4. After turning over the line to the SLIP driver, you must configure
|
||||
the network interface. Again, you do this using the standard
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ CONFIG_NET=y
|
|||
CONFIG_NETDB_DNSCLIENT=y
|
||||
CONFIG_NETUTILS_TFTPC=y
|
||||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ CONFIG_NETUTILS_DHCPC=y
|
|||
CONFIG_NETUTILS_PING=y
|
||||
CONFIG_NETUTILS_TELNETD=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=800
|
||||
CONFIG_NET_ETH_PKTSIZE=800
|
||||
CONFIG_NET_GUARDSIZE=32
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_PKT=y
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ Networking Support
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
|
||||
CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ Networking
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
|
||||
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562 : Read-ahead buffer size
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ Networking
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Networking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
|
||||
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562 : Read-ahead buffer size
|
||||
|
|
|
|||
|
|
@ -1339,7 +1339,7 @@ Networking
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : ARP support should be enabled
|
||||
CONFIG_NET_ARP_IPIN=y : IP address harvesting (optional)
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ CONFIG_MMCSD_SDIO=y
|
|||
CONFIG_MMCSD=y
|
||||
CONFIG_MQ_MAXMSGSIZE=64
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_ICMPv6_NEIGHBOR=y
|
||||
CONFIG_NET_ICMPv6_SOCKET=y
|
||||
CONFIG_NET_ICMPv6=y
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ Selecting the GMAC peripheral
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : ARP support should be enabled
|
||||
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ CONFIG_MTD_CONFIG=y
|
|||
CONFIG_MTD=y
|
||||
CONFIG_NET_6LOWPAN=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_HOSTNAME="MRF24J40-Hub"
|
||||
CONFIG_NET_ICMPv6_NEIGHBOR=y
|
||||
CONFIG_NET_ICMPv6_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -706,7 +706,7 @@ Selecting the GMAC peripheral
|
|||
Networking Support
|
||||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : ARP support should be enabled
|
||||
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
|
||||
CONFIG_NET_TCP=y : Enable TCP/IP networking
|
||||
|
|
@ -2483,7 +2483,7 @@ Configuration sub-directories
|
|||
configuration. The CONFIG_VNCSERVER_UPDATE_BUFSIZE determines the
|
||||
size of update messages. That is 1024 bytes in that configuration
|
||||
(the full message with the header will be a little larger). The
|
||||
MTU (CONFIG_NET_ETH_MTU) is set to 590 so that a full update will
|
||||
CONFIG_NET_ETH_PKTSIZE is set to 590 so that a full update will
|
||||
require several packets.
|
||||
|
||||
Write buffering also effects network performance. This will break
|
||||
|
|
@ -2632,7 +2632,7 @@ Configuration sub-directories
|
|||
configuration. The CONFIG_VNCSERVER_UPDATE_BUFSIZE determines the
|
||||
size of update messages. That is 1024 bytes in that configuration
|
||||
(the full message with the header will be a little larger). The
|
||||
MTU (CONFIG_NET_ETH_MTU) is set to 590 so that a full update will
|
||||
CONFIG_NET_ETH_PKTSIZE is set to 590 so that a full update will
|
||||
require several packets.
|
||||
|
||||
Write buffering also effects network performance. This will break
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ CONFIG_MTD_CONFIG=y
|
|||
CONFIG_MTD=y
|
||||
CONFIG_NET_6LOWPAN=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_HOSTNAME="MRF24J40-Hub"
|
||||
CONFIG_NET_ICMPv6_NEIGHBOR=y
|
||||
CONFIG_NET_ICMPv6_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ CONFIG_NETUTILS_TFTPC=y
|
|||
CONFIG_NETUTILS_THTTPD=y
|
||||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=768
|
||||
CONFIG_NET_ETH_PKTSIZE=768
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ CONFIG_NET=y
|
|||
CONFIG_NETDB_DNSCLIENT_ENTRIES=4
|
||||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ CONFIG_NET=y
|
|||
CONFIG_NETDB_DNSCLIENT_ENTRIES=4
|
||||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ CONFIG_MAX_WDOGPARMS=2
|
|||
CONFIG_MMCSD=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_HOSTNAME="butterfly2"
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
|
|||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_HOSTNAME="STM32F4-Discovery"
|
||||
CONFIG_NET_ICMPv6=y
|
||||
CONFIG_NET_ICMPv6_NEIGHBOR=y
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ CONFIG_NET_ARP_IPIN=y
|
|||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NETDB_DNSCLIENT=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_HOSTNAME="stntest"
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_IGMP=y
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ CONFIG_MMCSD=y
|
|||
CONFIG_NET_ARP_IPIN=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=1500
|
||||
CONFIG_NET_ETH_PKTSIZE=1500
|
||||
CONFIG_NET_HOSTNAME="stntest"
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_ICMP=y
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ CONFIG_MAX_TASKS=16
|
|||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=590
|
||||
CONFIG_NET_ETH_PKTSIZE=590
|
||||
CONFIG_NET_ICMPv6=y
|
||||
CONFIG_NET_ICMPv6_SOCKET=y
|
||||
CONFIG_NET_IPv6=y
|
||||
|
|
|
|||
|
|
@ -437,9 +437,9 @@ TWR-K60N512-specific Configuration Options
|
|||
Kenetis ethernet controller settings
|
||||
|
||||
CONFIG_ENET_NRXBUFFERS - Number of RX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 6
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 6
|
||||
CONFIG_ENET_NTXBUFFERS - Number of TX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 2
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 2
|
||||
CONFIG_ENET_USEMII - Use MII mode. Default: RMII mode.
|
||||
CONFIG_ENET_PHYADDR - PHY address
|
||||
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ Networking Support
|
|||
CONFIG_NET=y : Enable Neworking
|
||||
CONFIG_NET_ETHERNET=y : Support Ethernet data link
|
||||
CONFIG_NET_SOCKOPTS=y : Enable socket operations
|
||||
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
|
||||
CONFIG_NET_ETH_PKTSIZE=590 : Maximum packet size 1518 is more standard
|
||||
CONFIG_NET_ARP=y : Enable ARP
|
||||
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
|
||||
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
|
||||
|
|
@ -561,9 +561,9 @@ TWR-K64F120M-specific Configuration Options
|
|||
Kenetis ethernet controller settings
|
||||
|
||||
CONFIG_ENET_NRXBUFFERS - Number of RX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 6
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 6
|
||||
CONFIG_ENET_NTXBUFFERS - Number of TX buffers. The size of one
|
||||
buffer is determined by CONFIG_NET_ETH_MTU. Default: 2
|
||||
buffer is determined by CONFIG_NET_ETH_PKTSIZE. Default: 2
|
||||
CONFIG_ENET_USEMII - Use MII mode. Default: RMII mode.
|
||||
CONFIG_ENET_PHYADDR - PHY address
|
||||
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ ViewTool DP83848 Ethernet Module
|
|||
CONFIG_NSOCKET_DESCRIPTORS=10 : Socket-related
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
|
||||
CONFIG_NET_ETH_MTU=650 : Maximum packet size
|
||||
CONFIG_NET_ETH_PKTSIZE=650 : Maximum packet size
|
||||
CONFIG_NET_TCP_READAHEAD=y : Enable read-ahead buffering
|
||||
CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ CONFIG_NETUTILS_TFTPC=y
|
|||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ETH_MTU=650
|
||||
CONFIG_NET_ETH_PKTSIZE=650
|
||||
CONFIG_NET_HOSTNAME="Viewtool-STM32F107"
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ struct dm9x_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* At present, only a single DM90x0 device is supported. */
|
||||
|
||||
|
|
@ -908,7 +908,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *priv)
|
|||
|
||||
/* Also check if the packet is a valid size for the network configuration */
|
||||
|
||||
else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_MTU + 2))
|
||||
else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_PKTSIZE + 2))
|
||||
{
|
||||
nerr("ERROR: RX length error\n");
|
||||
NETDEV_RXERRORS(&priv->dm_dev);
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@
|
|||
# define CONFIG_ENC28J60_NINTERFACES 1
|
||||
#endif
|
||||
|
||||
/* CONFIG_NET_ETH_MTU must always be defined */
|
||||
/* CONFIG_NET_ETH_PKTSIZE must always be defined */
|
||||
|
||||
#if !defined(CONFIG_NET_ETH_MTU) && (CONFIG_NET_ETH_MTU <= MAX_FRAMELEN)
|
||||
# error "CONFIG_NET_ETH_MTU is not valid for the ENC28J60"
|
||||
#if !defined(CONFIG_NET_ETH_PKTSIZE) && (CONFIG_NET_ETH_PKTSIZE <= MAX_FRAMELEN)
|
||||
# error "CONFIG_NET_ETH_PKTSIZE is not valid for the ENC28J60"
|
||||
#endif
|
||||
|
||||
/* We need to have the work queue to handle SPI interrupts */
|
||||
|
|
@ -159,7 +159,7 @@
|
|||
|
||||
/* Packet memory layout */
|
||||
|
||||
#define ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 255) & ~255)
|
||||
#define ALIGNED_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 255) & ~255)
|
||||
|
||||
/* Work around Errata #5 (spurious reset of ERXWRPT to 0) by placing the RX
|
||||
* FIFO at the beginning of packet memory.
|
||||
|
|
@ -265,7 +265,7 @@ struct enc_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver status structure */
|
||||
|
||||
|
|
@ -1555,7 +1555,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
|
|||
|
||||
/* Check for a usable packet length (4 added for the CRC) */
|
||||
|
||||
else if (pktlen > (CONFIG_NET_ETH_MTU + 4) || pktlen <= (ETH_HDRLEN + 4))
|
||||
else if (pktlen > (CONFIG_NET_ETH_PKTSIZE + 4) || pktlen <= (ETH_HDRLEN + 4))
|
||||
{
|
||||
nerr("ERROR: Bad packet size dropped (%d)\n", pktlen);
|
||||
NETDEV_RXERRORS(&priv->dev);
|
||||
|
|
@ -2568,8 +2568,8 @@ static int enc_reset(FAR struct enc_driver_s *priv)
|
|||
|
||||
/* Set the maximum packet size which the controller will accept */
|
||||
|
||||
enc_wrbreg(priv, ENC_MAMXFLL, CONFIG_NET_ETH_MTU & 0xff);
|
||||
enc_wrbreg(priv, ENC_MAMXFLH, CONFIG_NET_ETH_MTU >> 8);
|
||||
enc_wrbreg(priv, ENC_MAMXFLL, CONFIG_NET_ETH_PKTSIZE & 0xff);
|
||||
enc_wrbreg(priv, ENC_MAMXFLH, CONFIG_NET_ETH_PKTSIZE >> 8);
|
||||
|
||||
/* Configure LEDs (No, just use the defaults for now) */
|
||||
/* enc_wrphy(priv, ENC_PHLCON, ??); */
|
||||
|
|
|
|||
|
|
@ -113,10 +113,10 @@
|
|||
# define CONFIG_ENCX24J600_NINTERFACES 1
|
||||
#endif
|
||||
|
||||
/* CONFIG_NET_ETH_MTU must always be defined */
|
||||
/* CONFIG_NET_ETH_PKTSIZE must always be defined */
|
||||
|
||||
#if !defined(CONFIG_NET_ETH_MTU) && (CONFIG_NET_ETH_MTU <= MAX_FRAMELEN)
|
||||
# error "CONFIG_NET_ETH_MTU is not valid for the ENCX24J600"
|
||||
#if !defined(CONFIG_NET_ETH_PKTSIZE) && (CONFIG_NET_ETH_PKTSIZE <= MAX_FRAMELEN)
|
||||
# error "CONFIG_NET_ETH_PKTSIZE is not valid for the ENCX24J600"
|
||||
#endif
|
||||
|
||||
/* We need to have the work queue to handle SPI interrupts */
|
||||
|
|
@ -169,7 +169,7 @@
|
|||
|
||||
/* Packet memory layout */
|
||||
|
||||
#define PKTMEM_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_MTU + 1) & ~1)
|
||||
#define PKTMEM_ALIGNED_BUFSIZE ((CONFIG_NET_ETH_PKTSIZE + 1) & ~1)
|
||||
#define PKTMEM_RX_START (PKTMEM_START + PKTMEM_SIZE / 2) /* Followed by RX buffer */
|
||||
#define PKTMEM_RX_SIZE (PKTMEM_SIZE - PKTMEM_RX_START)
|
||||
#define PKTMEM_RX_END (PKTMEM_START + PKTMEM_SIZE) /* RX buffer goes to the end of SRAM */
|
||||
|
|
@ -274,7 +274,7 @@ struct enc_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver status structure */
|
||||
|
||||
|
|
@ -1695,7 +1695,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv)
|
|||
|
||||
/* Check for a usable packet length (4 added for the CRC) */
|
||||
|
||||
else if (pktlen > (CONFIG_NET_ETH_MTU + 4) || pktlen <= (ETH_HDRLEN + 4))
|
||||
else if (pktlen > (CONFIG_NET_ETH_PKTSIZE + 4) || pktlen <= (ETH_HDRLEN + 4))
|
||||
{
|
||||
nerr("ERROR: Bad packet size dropped (%d)\n", pktlen);
|
||||
|
||||
|
|
@ -2748,7 +2748,7 @@ static int enc_reset(FAR struct enc_driver_s *priv)
|
|||
|
||||
/* Set the maximum packet size which the controller will accept */
|
||||
|
||||
enc_wrreg(priv, ENC_MAMXFL, CONFIG_NET_ETH_MTU + 4);
|
||||
enc_wrreg(priv, ENC_MAMXFL, CONFIG_NET_ETH_PKTSIZE + 4);
|
||||
|
||||
ret = enc_waitreg(priv, ENC_ESTAT, ESTAT_PHYLNK, ESTAT_PHYLNK);
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ struct ftmac100_driver_s
|
|||
|
||||
/* A single packet buffer is used */
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver state structure. */
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ struct lo_driver_s
|
|||
****************************************************************************/
|
||||
|
||||
static struct lo_driver_s g_loopback;
|
||||
static uint8_t g_iobuffer[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_iobuffer[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ struct skel_driver_s
|
|||
* allocated dynamically in cases where more than one are needed.
|
||||
*/
|
||||
|
||||
static uint8_t g_pktbuf[MAX_NET_DEV_MTU + CONFIG_NET_GUARDSIZE];
|
||||
static uint8_t g_pktbuf[MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Driver state structure */
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
/* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
|
||||
* IP+TPC headers plus 256 bytes of data). So you might as well set
|
||||
* CONFIG_NET_SLIP_MTU to 296 as well.
|
||||
* CONFIG_NET_SLIP_PKTSIZE to 296 as well.
|
||||
*
|
||||
* There may be an issue with this setting, however. I see that Linux uses
|
||||
* a MTU of 296 and window of 256, but actually only sends 168 bytes of data:
|
||||
|
|
@ -97,10 +97,10 @@
|
|||
* transfers to 128 bytes (possibly by modifying the tcp_mss() macro).
|
||||
*/
|
||||
|
||||
#if CONFIG_NET_SLIP_MTU < 296
|
||||
# error "CONFIG_NET_SLIP_MTU >= 296 is required"
|
||||
#elif CONFIG_NET_SLIP_MTU > 296
|
||||
# warning "CONFIG_NET_SLIP_MTU == 296 is optimal"
|
||||
#if CONFIG_NET_SLIP_PKTSIZE < 296
|
||||
# error "CONFIG_NET_SLIP_PKTSIZE >= 296 is required"
|
||||
#elif CONFIG_NET_SLIP_PKTSIZE > 296
|
||||
# warning "CONFIG_NET_SLIP_PKTSIZE == 296 is optimal"
|
||||
#endif
|
||||
|
||||
/* CONFIG_NET_SLIP_NINTERFACES determines the number of physical interfaces
|
||||
|
|
@ -146,8 +146,8 @@ struct slip_driver_s
|
|||
/* This holds the information visible to the NuttX network */
|
||||
|
||||
struct net_driver_s dev; /* Interface understood by the network */
|
||||
uint8_t rxbuf[CONFIG_NET_SLIP_MTU + 2];
|
||||
uint8_t txbuf[CONFIG_NET_SLIP_MTU + 2];
|
||||
uint8_t rxbuf[CONFIG_NET_SLIP_PKTSIZE + 2];
|
||||
uint8_t txbuf[CONFIG_NET_SLIP_PKTSIZE + 2];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -626,7 +626,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
|
|||
|
||||
default:
|
||||
{
|
||||
if (priv->rxlen < CONFIG_NET_SLIP_MTU+2)
|
||||
if (priv->rxlen < CONFIG_NET_SLIP_PKTSIZE+2)
|
||||
{
|
||||
priv->rxbuf[priv->rxlen++] = ch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ struct tun_device_s
|
|||
|
||||
bool read_wait;
|
||||
|
||||
uint8_t read_buf[CONFIG_NET_TUN_MTU];
|
||||
uint8_t read_buf[CONFIG_NET_TUN_PKTSIZE];
|
||||
size_t read_d_len;
|
||||
uint8_t write_buf[CONFIG_NET_TUN_MTU];
|
||||
uint8_t write_buf[CONFIG_NET_TUN_PKTSIZE];
|
||||
size_t write_d_len;
|
||||
|
||||
sem_t waitsem;
|
||||
|
|
@ -1338,7 +1338,7 @@ static ssize_t tun_write(FAR struct file *filep, FAR const char *buffer,
|
|||
|
||||
net_lock();
|
||||
|
||||
if (buflen > CONFIG_NET_TUN_MTU)
|
||||
if (buflen > CONFIG_NET_TUN_PKTSIZE)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
#define CONFIG_RNDIS_NWRREQS (2)
|
||||
|
||||
#define RNDIS_PACKET_HDR_SIZE (sizeof(struct rndis_packet_msg))
|
||||
#define CONFIG_RNDIS_BULKIN_REQLEN (CONFIG_NET_ETH_MTU + RNDIS_PACKET_HDR_SIZE)
|
||||
#define CONFIG_RNDIS_BULKIN_REQLEN (CONFIG_NET_ETH_PKTSIZE + RNDIS_PACKET_HDR_SIZE)
|
||||
#define CONFIG_RNDIS_BULKOUT_REQLEN CONFIG_RNDIS_BULKIN_REQLEN
|
||||
|
||||
#define RNDIS_NCONFIGS (1)
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
#define RNDIS_MAXSTRLEN (RNDIS_MXDESCLEN-2)
|
||||
#define RNDIS_CTRLREQ_LEN (512)
|
||||
|
||||
#define RNDIS_BUFFER_SIZE CONFIG_NET_ETH_MTU
|
||||
#define RNDIS_BUFFER_SIZE CONFIG_NET_ETH_PKTSIZE
|
||||
#define RNDIS_BUFFER_COUNT 4
|
||||
|
||||
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per second */
|
||||
|
|
@ -401,14 +401,14 @@ static const uint32_t g_rndis_supported_oids[] =
|
|||
static const struct rndis_oid_value_s g_rndis_oid_values[] =
|
||||
{
|
||||
{RNDIS_OID_GEN_SUPPORTED_LIST, sizeof(g_rndis_supported_oids), 0, g_rndis_supported_oids},
|
||||
{RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE, 4, CONFIG_NET_ETH_MTU, NULL},
|
||||
{RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE, 4, CONFIG_NET_ETH_PKTSIZE, NULL},
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
{RNDIS_OID_GEN_LINK_SPEED, 4, 100000, NULL},
|
||||
#else
|
||||
{RNDIS_OID_GEN_LINK_SPEED, 4, 2000000, NULL},
|
||||
#endif
|
||||
{RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE, 4, CONFIG_NET_ETH_MTU, NULL},
|
||||
{RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE, 4, CONFIG_NET_ETH_MTU, NULL},
|
||||
{RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE, 4, CONFIG_NET_ETH_PKTSIZE, NULL},
|
||||
{RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE, 4, CONFIG_NET_ETH_PKTSIZE, NULL},
|
||||
{RNDIS_OID_GEN_VENDOR_ID, 4, 0x00FFFFFF, NULL},
|
||||
{RNDIS_OID_GEN_VENDOR_DESCRIPTION, 6, 0, "RNDIS"},
|
||||
{RNDIS_OID_GEN_CURRENT_PACKET_FILTER, 4, 0, NULL},
|
||||
|
|
@ -651,7 +651,7 @@ static bool rndis_allocnetreq(FAR struct rndis_dev_s *priv)
|
|||
if (priv->net_req)
|
||||
{
|
||||
priv->netdev.d_buf = &priv->net_req->req->buf[RNDIS_PACKET_HDR_SIZE];
|
||||
priv->netdev.d_len = CONFIG_NET_ETH_MTU;
|
||||
priv->netdev.d_len = CONFIG_NET_ETH_PKTSIZE;
|
||||
}
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
|
@ -761,7 +761,7 @@ static void rndis_giverxreq(FAR struct rndis_dev_s *priv)
|
|||
|
||||
priv->net_req = priv->rx_req;
|
||||
priv->netdev.d_buf = &priv->net_req->req->buf[RNDIS_PACKET_HDR_SIZE];
|
||||
priv->netdev.d_len = CONFIG_NET_ETH_MTU;
|
||||
priv->netdev.d_len = CONFIG_NET_ETH_PKTSIZE;
|
||||
priv->rx_req = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1247,7 +1247,7 @@ static inline int rndis_recvpacket(FAR struct rndis_dev_s *priv,
|
|||
|
||||
/* Check if the received packet exceeds request buffer */
|
||||
|
||||
if ((RNDIS_PACKET_HDR_SIZE + index + copysize) <= CONFIG_NET_ETH_MTU)
|
||||
if ((RNDIS_PACKET_HDR_SIZE + index + copysize) <= CONFIG_NET_ETH_PKTSIZE)
|
||||
{
|
||||
memcpy(&priv->rx_req->req->buf[RNDIS_PACKET_HDR_SIZE + index], reqbuf,
|
||||
copysize);
|
||||
|
|
@ -1264,7 +1264,7 @@ static inline int rndis_recvpacket(FAR struct rndis_dev_s *priv,
|
|||
{
|
||||
/* Check for a usable packet length (4 added for the CRC) */
|
||||
|
||||
if (priv->current_rx_datagram_size > (CONFIG_NET_ETH_MTU + 4) ||
|
||||
if (priv->current_rx_datagram_size > (CONFIG_NET_ETH_PKTSIZE + 4) ||
|
||||
priv->current_rx_datagram_size <= (ETH_HDRLEN + 4))
|
||||
{
|
||||
uerr("ERROR: Bad packet size dropped (%d)\n",
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
* len should not exceed 1400 bytes
|
||||
*/
|
||||
|
||||
#define MAX_CHUNK_LEN (CONFIG_NET_ETH_MTU > 1500 ? 1400 : CONFIG_NET_ETH_MTU - 100)
|
||||
#define MAX_CHUNK_LEN (CONFIG_NET_ETH_PKTSIZE > 1500 ? 1400 : CONFIG_NET_ETH_PKTSIZE - 100)
|
||||
|
||||
/* Helper to get iw_event size */
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ int bcmf_netdev_alloc_tx_frame(FAR struct bcmf_dev_s *priv)
|
|||
|
||||
/* Allocate frame for TX */
|
||||
|
||||
priv->cur_tx_frame = bcmf_bdc_allocate_frame(priv, MAX_NET_DEV_MTU, true);
|
||||
priv->cur_tx_frame = bcmf_bdc_allocate_frame(priv, MAX_NETDEV_PKTSIZE, true);
|
||||
if (!priv->cur_tx_frame)
|
||||
{
|
||||
wlerr("ERROR: Cannot allocate TX frame\n");
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR struct bcmf_dev_s *priv,
|
|||
|
||||
sframe = container_of(entry, struct bcmf_sdio_frame, list_entry);
|
||||
|
||||
sframe->header.len = HEADER_SIZE + MAX_NET_DEV_MTU;
|
||||
sframe->header.len = HEADER_SIZE + MAX_NETDEV_PKTSIZE;
|
||||
sframe->header.base = sframe->data;
|
||||
sframe->header.data = sframe->data;
|
||||
sframe->tx = tx;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ struct bcmf_sdio_frame
|
|||
struct bcmf_frame_s header;
|
||||
bool tx;
|
||||
dq_entry_t list_entry;
|
||||
uint8_t data[HEADER_SIZE + MAX_NET_DEV_MTU +
|
||||
uint8_t data[HEADER_SIZE + MAX_NETDEV_PKTSIZE +
|
||||
CONFIG_NET_GUARDSIZE];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ struct bcmf_frame_s *bcmf_sdpcm_alloc_frame(FAR struct bcmf_dev_s *priv,
|
|||
header_len += 2; /* Data frames need alignment padding */
|
||||
}
|
||||
|
||||
if (len + header_len > MAX_NET_DEV_MTU + HEADER_SIZE ||
|
||||
if (len + header_len > MAX_NETDEV_PKTSIZE + HEADER_SIZE ||
|
||||
len > len + header_len)
|
||||
{
|
||||
wlerr("Invalid size %d\n", len);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
* Note: Network configuration options the netconfig.h should not be changed,
|
||||
* but rather the per-project defconfig file.
|
||||
*
|
||||
* Copyright (C) 2007, 2011, 2014-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2011, 2014-2015, 2017-2018 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* This logic was leveraged from uIP which also has a BSD-style license:
|
||||
|
|
@ -111,25 +112,25 @@
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# ifndef CONFIG_NET_SLIP_MTU
|
||||
# define CONFIG_NET_SLIP_MTU 296
|
||||
# ifndef CONFIG_NET_SLIP_PKTSIZE
|
||||
# define CONFIG_NET_SLIP_PKTSIZE 296
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TUN
|
||||
# ifndef CONFIG_NET_TUN_MTU
|
||||
# define CONFIG_NET_TUN_MTU 296
|
||||
# ifndef CONFIG_NET_TUN_PKTSIZE
|
||||
# define CONFIG_NET_TUN_PKTSIZE 296
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
# ifndef CONFIG_NET_ETH_MTU
|
||||
# define CONFIG_NET_ETH_MTU 590
|
||||
# ifndef CONFIG_NET_ETH_PKTSIZE
|
||||
# define CONFIG_NET_ETH_PKTSIZE 590
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NET_6LOWPAN_MTU
|
||||
# define CONFIG_NET_6LOWPAN_MTU 1294
|
||||
#ifndef CONFIG_NET_6LOWPAN_PKTSIZE
|
||||
# define CONFIG_NET_6LOWPAN_PKTSIZE 1294
|
||||
#endif
|
||||
|
||||
/* We are supporting multiple network devices using different link layer
|
||||
|
|
@ -137,55 +138,55 @@
|
|||
* structure.
|
||||
*/
|
||||
|
||||
#define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
|
||||
#define NET_DEV_MTU(d) ((d)->d_mtu)
|
||||
#define NET_LL_HDRLEN(d) ((d)->d_llhdrlen)
|
||||
#define NETDEV_PKTSIZE(d) ((d)->d_pktsize)
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
# define _MIN_ETH_MTU CONFIG_NET_ETH_MTU
|
||||
# define _MAX_ETH_MTU CONFIG_NET_ETH_MTU
|
||||
# define _MIN_ETH_PKTSIZE CONFIG_NET_ETH_PKTSIZE
|
||||
# define _MAX_ETH_PKTSIZE CONFIG_NET_ETH_PKTSIZE
|
||||
#else
|
||||
# define _MIN_ETH_MTU UINT16_MAX
|
||||
# define _MAX_ETH_MTU 0
|
||||
# define _MIN_ETH_PKTSIZE UINT16_MAX
|
||||
# define _MAX_ETH_PKTSIZE 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_LOOPBACK
|
||||
# define _MIN_LO_MTU MIN(_MIN_ETH_MTU,1518)
|
||||
# define _MAX_LO_MTU MAX(_MAX_ETH_MTU,574)
|
||||
# define _MIN_LO_PKTSIZE MIN(_MIN_ETH_PKTSIZE, 1518)
|
||||
# define _MAX_LO_PKTSIZE MAX(_MAX_ETH_PKTSIZE, 574)
|
||||
#else
|
||||
# define _MIN_LO_MTU _MIN_ETH_MTU
|
||||
# define _MAX_LO_MTU _MAX_ETH_MTU
|
||||
# define _MIN_LO_PKTSIZE _MIN_ETH_PKTSIZE
|
||||
# define _MAX_LO_PKTSIZE _MAX_ETH_PKTSIZE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# define _MIN_SLIP_MTU MIN(_MIN_LO_MTU,CONFIG_NET_SLIP_MTU)
|
||||
# define _MAX_SLIP_MTU MAX(_MAX_LO_MTU,CONFIG_NET_SLIP_MTU)
|
||||
# define _MIN_SLIP_PKTSIZE MIN(_MIN_LO_PKTSIZE, CONFIG_NET_SLIP_PKTSIZE)
|
||||
# define _MAX_SLIP_PKTSIZE MAX(_MAX_LO_PKTSIZE, CONFIG_NET_SLIP_PKTSIZE)
|
||||
#else
|
||||
# define _MIN_SLIP_MTU _MIN_LO_MTU
|
||||
# define _MAX_SLIP_MTU _MAX_LO_MTU
|
||||
# define _MIN_SLIP_PKTSIZE _MIN_LO_PKTSIZE
|
||||
# define _MAX_SLIP_PKTSIZE _MAX_LO_PKTSIZE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TUN
|
||||
# define _MIN_TUN_MTU MIN(_MIN_SLIP_MTU,CONFIG_NET_TUN_MTU)
|
||||
# define _MAX_TUN_MTU MAX(_MAX_SLIP_MTU,CONFIG_NET_TUN_MTU)
|
||||
# define _MIN_TUN_PKTSIZE MIN(_MIN_SLIP_PKTSIZE, CONFIG_NET_TUN_PKTSIZE)
|
||||
# define _MAX_TUN_PKTSIZE MAX(_MAX_SLIP_PKTSIZE, CONFIG_NET_TUN_PKTSIZE)
|
||||
#else
|
||||
# define _MIN_TUN_MTU _MIN_SLIP_MTU
|
||||
# define _MAX_TUN_MTU _MAX_SLIP_MTU
|
||||
# define _MIN_TUN_PKTSIZE _MIN_SLIP_PKTSIZE
|
||||
# define _MAX_TUN_PKTSIZE _MAX_SLIP_PKTSIZE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
# define _MIN_6LOWPAN_MTU MIN(_MIN_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
|
||||
# define _MAX_6LOWPAN_MTU MAX(_MAX_TUN_MTU,CONFIG_NET_6LOWPAN_MTU)
|
||||
# define _MIN_6LOWPAN_PKTSIZE MIN(_MIN_TUN_PKTSIZE, CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
# define _MAX_6LOWPAN_PKTSIZE MAX(_MAX_TUN_PKTSIZE, CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
#else
|
||||
# define _MIN_6LOWPAN_MTU _MIN_TUN_MTU
|
||||
# define _MAX_6LOWPAN_MTU _MAX_TUN_MTU
|
||||
# define _MIN_6LOWPAN_PKTSIZE _MIN_TUN_PKTSIZE
|
||||
# define _MAX_6LOWPAN_PKTSIZE _MAX_TUN_PKTSIZE
|
||||
#endif
|
||||
|
||||
#define MIN_NET_DEV_MTU _MIN_6LOWPAN_MTU
|
||||
#define MAX_NET_DEV_MTU _MAX_6LOWPAN_MTU
|
||||
#define MIN_NETDEV_PKTSIZE _MIN_6LOWPAN_PKTSIZE
|
||||
#define MAX_NETDEV_PKTSIZE _MAX_6LOWPAN_PKTSIZE
|
||||
|
||||
/* For the loopback device, we will use the largest MTU */
|
||||
|
||||
# define NET_LO_MTU MAX_NET_DEV_MTU
|
||||
# define NET_LO_PKTSIZE MAX_NETDEV_PKTSIZE
|
||||
|
||||
/* Layer 3/4 Configuration Options ******************************************/
|
||||
|
||||
|
|
@ -240,29 +241,29 @@
|
|||
#endif
|
||||
|
||||
/* The UDP maximum packet size. This is should not be to set to more
|
||||
* than NET_DEV_MTU(d) - NET_LL_HDRLEN(dev) - __UDP_HDRLEN - IPv*_HDRLEN.
|
||||
* than NETDEV_PKTSIZE(d) - NET_LL_HDRLEN(dev) - __UDP_HDRLEN - IPv*_HDRLEN.
|
||||
*/
|
||||
|
||||
#define UDP_MSS(d,h) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - __UDP_HDRLEN - (h))
|
||||
#define UDP_MSS(d,h) (NETDEV_PKTSIZE(d) - NET_LL_HDRLEN(d) - __UDP_HDRLEN - (h))
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
# define ETH_UDP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - __UDP_HDRLEN - (h))
|
||||
# define ETH_UDP_MSS(h) (CONFIG_NET_ETH_PKTSIZE - ETH_HDRLEN - __UDP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
# define IEEE802154_UDP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - __UDP_HDRLEN - (h))
|
||||
# define IEEE802154_UDP_MSS(h) (CONFIG_NET_6LOWPAN_PKTSIZE - __UDP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_LOOPBACK
|
||||
# define LO_UDP_MSS(h) (NET_LO_MTU - __UDP_HDRLEN - (h))
|
||||
# define LO_UDP_MSS(h) (NET_LO_PKTSIZE - __UDP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# define SLIP_UDP_MSS(h) (CONFIG_NET_SLIP_MTU - __UDP_HDRLEN - (h))
|
||||
# define SLIP_UDP_MSS(h) (CONFIG_NET_SLIP_PKTSIZE - __UDP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TUN
|
||||
# define TUN_UDP_MSS(h) (CONFIG_NET_TUN_MTU - __UDP_HDRLEN - (h))
|
||||
# define TUN_UDP_MSS(h) (CONFIG_NET_TUN_PKTSIZE - __UDP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
|
|
@ -405,7 +406,7 @@
|
|||
#define TCP_MAXSYNRTX 5
|
||||
|
||||
/* The TCP maximum segment size. This is should not be set to more
|
||||
* than NET_DEV_MTU(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - __TCP_HDRLEN.
|
||||
* than NETDEV_PKTSIZE(dev) - NET_LL_HDRLEN(dev) - IPvN_HDRLEN - __TCP_HDRLEN.
|
||||
*
|
||||
* In the case where there are multiple network devices with different
|
||||
* link layer protocols, each network device may support a different UDP
|
||||
|
|
@ -414,28 +415,28 @@
|
|||
* REVISIT: __TCP_HDRLEN is not really a constant!
|
||||
*/
|
||||
|
||||
#define TCP_MSS(d,h) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - __TCP_HDRLEN - (h))
|
||||
#define TCP_MSS(d,h) (NETDEV_PKTSIZE(d) - NET_LL_HDRLEN(d) - __TCP_HDRLEN - (h))
|
||||
|
||||
/* Get the smallest and largest MSS */
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
# define ETH_TCP_MSS(h) (CONFIG_NET_ETH_MTU - ETH_HDRLEN - __TCP_HDRLEN - (h))
|
||||
# define ETH_TCP_MSS(h) (CONFIG_NET_ETH_PKTSIZE - ETH_HDRLEN - __TCP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
# define IEEE802154_TCP_MSS(h) (CONFIG_NET_6LOWPAN_MTU - __TCP_HDRLEN - (h))
|
||||
# define IEEE802154_TCP_MSS(h) (CONFIG_NET_6LOWPAN_PKTSIZE - __TCP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_LOOPBACK
|
||||
# define LO_TCP_MSS(h) (NET_LO_MTU - __TCP_HDRLEN - (h))
|
||||
# define LO_TCP_MSS(h) (NET_LO_PKTSIZE - __TCP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# define SLIP_TCP_MSS(h) (CONFIG_NET_SLIP_MTU - __TCP_HDRLEN - (h))
|
||||
# define SLIP_TCP_MSS(h) (CONFIG_NET_SLIP_PKTSIZE - __TCP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TUN
|
||||
# define TUN_TCP_MSS(h) (CONFIG_NET_TUN_MTU - __TCP_HDRLEN - (h))
|
||||
# define TUN_TCP_MSS(h) (CONFIG_NET_TUN_PKTSIZE - __TCP_HDRLEN - (h))
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ struct net_driver_s
|
|||
uint8_t d_ifindex; /* Device index */
|
||||
#endif
|
||||
|
||||
uint16_t d_mtu; /* Maximum packet size */
|
||||
uint16_t d_pktsize; /* Maximum packet size */
|
||||
|
||||
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN) || \
|
||||
defined(CONFIG_NET_BLUETOOTH) || defined(CONFIG_NET_IEEE802154)
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ struct radiodev_properties_s
|
|||
* driver must still provide its (single) reassembly buffer in d_buf;
|
||||
* that buffer is still used for the case where the packet is not
|
||||
* fragmented into many frames. In either case, the packet buffer will
|
||||
* have a size of advertised MTU of the protocol, CONFIG_NET_6LOWPAN_MTU,
|
||||
* have a size of advertised MTU of the protocol, CONFIG_NET_6LOWPAN_PKTSIZE,
|
||||
* plus CONFIG_NET_GUARDSIZE and some additional overhead for reassembly
|
||||
* state data.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ struct sixlowpan_reassbuf_s
|
|||
* provides the full reassembly packet to the network.
|
||||
*/
|
||||
|
||||
uint8_t rb_buf[CONFIG_NET_6LOWPAN_MTU + CONFIG_NET_GUARDSIZE];
|
||||
uint8_t rb_buf[CONFIG_NET_6LOWPAN_PKTSIZE + CONFIG_NET_GUARDSIZE];
|
||||
|
||||
/* Memory pool used to allocate this reassembly buffer */
|
||||
|
||||
|
|
@ -467,7 +467,7 @@ struct sixlowpan_reassbuf_s
|
|||
* - The io_flink field points to the next frame in the list (if enable)
|
||||
* - The last frame in the list will have io_flink == NULL.
|
||||
*
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_MTU + CONFIG_NET_GUARDSIZE
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE + CONFIG_NET_GUARDSIZE
|
||||
* must also be provided. The frame will be decompressed and placed in
|
||||
* the d_buf. Fragmented packets will also be reassembled in the d_buf as
|
||||
* they are received (meaning for the driver, that two packet buffers are
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@
|
|||
* threads. Default: 2048
|
||||
* CONFIG_NET_SLIP_DEFPRIO - Provides the priority for SLIP RX and TX
|
||||
* threads. Default 128.
|
||||
* CONFIG_NET_NET_SLIP_MTU - Provides the size of the SLIP packet buffers.
|
||||
* CONFIG_NET_NET_SLIP_PKTSIZE - Provides the size of the SLIP packet buffers.
|
||||
* Default 296
|
||||
*
|
||||
* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the
|
||||
* IP+TPC headers plus 256 bytes of data). So you might as well set
|
||||
* CONFIG_NET_SLIP_MTU to 296 as well.
|
||||
* CONFIG_NET_SLIP_PKTSIZE to 296 as well.
|
||||
*
|
||||
* There may be an issue with this setting, however. I see that Linux
|
||||
* uses a MTU of 296 and window of 256, but actually only sends 168 bytes
|
||||
|
|
|
|||
24
net/Kconfig
24
net/Kconfig
|
|
@ -37,8 +37,8 @@ config NET_PROMISCUOUS
|
|||
|
||||
menu "Driver buffer configuration"
|
||||
|
||||
config NET_ETH_MTU
|
||||
int "Ethernet packet buffer size (MTU)"
|
||||
config NET_ETH_PKTSIZE
|
||||
int "Ethernet packet buffer size"
|
||||
default 1294 if NET_IPv6
|
||||
default 590 if !NET_IPv6
|
||||
depends on NET_ETHERNET
|
||||
|
|
@ -46,8 +46,9 @@ config NET_ETH_MTU
|
|||
---help---
|
||||
Packet buffer size. This size includes the TCP/UDP payload plus the
|
||||
size of TCP/UDP header, the IP header, and the Ethernet header.
|
||||
This value is normally referred to as the MTU (Maximum Transmission
|
||||
Unit); the payload is the MSS (Maximum Segment Size).
|
||||
This value is related to the MTU (Maximum Transmission Unit), except
|
||||
that it includes the size of the link layer header; the payload is
|
||||
the MSS (Maximum Segment Size).
|
||||
|
||||
IPv4 hosts are required to be able to handle an MSS of at least
|
||||
536 octets, resulting in a minimum buffer size of 536+20+20+14 =
|
||||
|
|
@ -56,23 +57,24 @@ config NET_ETH_MTU
|
|||
IPv6 hosts are required to be able to handle an MSS of 1220 octets,
|
||||
resulting in a minimum buffer size of of 1220+20+40+14 = 1294
|
||||
|
||||
config NET_SLIP_MTU
|
||||
int # "SLIP packet buffer size (MTU)"
|
||||
config NET_SLIP_PKTSIZE
|
||||
int # "SLIP packet buffer size"
|
||||
default 296
|
||||
depends on NET_SLIP
|
||||
range 296 1518
|
||||
---help---
|
||||
Provides the size of the SLIP packet buffers. This size includes
|
||||
the TCP/UDP payload plus the size of TCP/UDP header and the IP header.
|
||||
This value is normally referred to as the MTU (Maximum Transmission Unit);
|
||||
the payload payload is the MSS (Maximum Segment Size).
|
||||
This value is related to the MTU (Maximum Transmission Unit), except
|
||||
that it includes the size of the link layer header; the payload is
|
||||
the MSS (Maximum Segment Size).
|
||||
|
||||
SLIP is required to support at least 256+20+20 = 296. Values other than
|
||||
296 are not recommended.
|
||||
|
||||
The Linux slip module hard-codes its MTU size to 296 (40 bytes for
|
||||
the IP+TPC headers plus 256 bytes of data). So you might as well
|
||||
set CONFIG_NET_SLIP_MTU to 296 as well.
|
||||
set CONFIG_NET_SLIP_PKTSIZE to 296 as well.
|
||||
|
||||
There may be an issue with this setting, however. I see that Linux
|
||||
uses a MTU of 296 and window of 256, but actually only sends 168
|
||||
|
|
@ -179,8 +181,8 @@ config TUN_NINTERFACES
|
|||
interfaces to support.
|
||||
Default: 1
|
||||
|
||||
config NET_TUN_MTU
|
||||
int "TUN packet buffer size (MTU)"
|
||||
config NET_TUN_PKTSIZE
|
||||
int "TUN packet buffer size"
|
||||
default 296
|
||||
range 296 1518
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ void devif_forward(FAR struct forward_s *fwd)
|
|||
|
||||
/* Copy the IOB chain that contains the L3L3 headers and any data payload */
|
||||
|
||||
DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NET_DEV_MTU(fwd->f_dev));
|
||||
DEBUGASSERT(offset + fwd->f_iob->io_pktlen <= NETDEV_PKTSIZE(fwd->f_dev));
|
||||
ret = iob_copyout(&fwd->f_dev->d_buf[offset], fwd->f_iob,
|
||||
fwd->f_iob->io_pktlen, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@
|
|||
void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *iob,
|
||||
unsigned int len, unsigned int offset)
|
||||
{
|
||||
DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
|
||||
DEBUGASSERT(dev && len > 0 && len < NETDEV_PKTSIZE(dev));
|
||||
|
||||
/* Copy the data from the I/O buffer chain to the device buffer */
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
void devif_pkt_send(FAR struct net_driver_s *dev, FAR const void *buf,
|
||||
unsigned int len)
|
||||
{
|
||||
DEBUGASSERT(dev && len > 0 && len < NET_DEV_MTU(dev));
|
||||
DEBUGASSERT(dev && len > 0 && len < NETDEV_PKTSIZE(dev));
|
||||
|
||||
/* Copy the data into the device packet buffer */
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
void devif_send(struct net_driver_s *dev, const void *buf, int len)
|
||||
{
|
||||
DEBUGASSERT(dev != NULL && len > 0 && len < NET_DEV_MTU(dev));
|
||||
DEBUGASSERT(dev != NULL && len > 0 && len < NETDEV_PKTSIZE(dev));
|
||||
|
||||
memcpy(dev->d_appdata, buf, len);
|
||||
dev->d_sndlen = len;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@
|
|||
*/
|
||||
|
||||
#define IP_MF 0x20 /* See IP_FLAG_MOREFRAGS */
|
||||
#define IPv4_REASS_BUFSIZE (CONFIG_NET_ETH_MTU - ETH_HDRLEN)
|
||||
#define IPv4_REASS_BUFSIZE (CONFIG_NET_ETH_PKTSIZE - ETH_HDRLEN)
|
||||
#define IPv4_REASS_LASTFRAG 0x01
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev)
|
|||
mtu->opttype = ICMPv6_OPT_MTU;
|
||||
mtu->optlen = 1;
|
||||
mtu->reserved = 0;
|
||||
mtu->mtu = HTONL(CONFIG_NET_ETH_MTU);
|
||||
mtu->mtu = HTONL(CONFIG_NET_ETH_PKTSIZE - ETH_HDRLEN);
|
||||
|
||||
/* Set up the prefix option */
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev,
|
|||
* We provide no support for fragmenting forwarded packets.
|
||||
*/
|
||||
|
||||
if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev))
|
||||
if (NET_LL_HDRLEN(fwddev) + dev->d_len > NETDEV_PKTSIZE(fwddev))
|
||||
{
|
||||
nwarn("WARNING: Packet > MTU... Dropping\n");
|
||||
ret = -EFBIG;
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev,
|
|||
* MTU. We provide no support for fragmenting forwarded packets.
|
||||
*/
|
||||
|
||||
if (NET_LL_HDRLEN(fwddev) + dev->d_len > NET_DEV_MTU(fwddev))
|
||||
if (NET_LL_HDRLEN(fwddev) + dev->d_len > NETDEV_PKTSIZE(fwddev))
|
||||
{
|
||||
nwarn("WARNING: Packet > MTU... Dropping\n");
|
||||
ret = -EFBIG;
|
||||
|
|
|
|||
|
|
@ -889,7 +889,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
|
|||
dev = netdev_ifr_dev(req);
|
||||
if (dev)
|
||||
{
|
||||
req->ifr_mtu = NET_DEV_MTU(dev);
|
||||
req->ifr_mtu = NETDEV_PKTSIZE(dev);
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
#ifdef CONFIG_NET_LOOPBACK
|
||||
case NET_LL_LOOPBACK: /* Local loopback */
|
||||
dev->d_llhdrlen = 0;
|
||||
dev->d_mtu = NET_LO_MTU;
|
||||
dev->d_pktsize = NET_LO_PKTSIZE;
|
||||
devfmt = NETDEV_LO_FORMAT;
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -276,7 +276,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
#ifdef CONFIG_NET_ETHERNET
|
||||
case NET_LL_ETHERNET: /* Ethernet */
|
||||
dev->d_llhdrlen = ETH_HDRLEN;
|
||||
dev->d_mtu = CONFIG_NET_ETH_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_ETH_PKTSIZE;
|
||||
devfmt = NETDEV_ETH_FORMAT;
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -284,7 +284,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
#ifdef CONFIG_DRIVERS_IEEE80211
|
||||
case NET_LL_IEEE80211: /* IEEE 802.11 */
|
||||
dev->d_llhdrlen = ETH_HDRLEN;
|
||||
dev->d_mtu = CONFIG_NET_ETH_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_ETH_PKTSIZE;
|
||||
devfmt = NETDEV_WLAN_FORMAT;
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -293,7 +293,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
case NET_LL_BLUETOOTH: /* Bluetooth */
|
||||
dev->d_llhdrlen = BLUETOOTH_MAX_HDRLEN; /* Determined at runtime */
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
dev->d_mtu = CONFIG_NET_6LOWPAN_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_6LOWPAN_PKTSIZE;
|
||||
#endif
|
||||
devfmt = NETDEV_BNEP_FORMAT;
|
||||
break;
|
||||
|
|
@ -304,7 +304,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
case NET_LL_PKTRADIO: /* Non-IEEE 802.15.4 packet radio */
|
||||
dev->d_llhdrlen = 0; /* Determined at runtime */
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
dev->d_mtu = CONFIG_NET_6LOWPAN_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_6LOWPAN_PKTSIZE;
|
||||
#endif
|
||||
devfmt = NETDEV_WPAN_FORMAT;
|
||||
break;
|
||||
|
|
@ -313,7 +313,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
#ifdef CONFIG_NET_SLIP
|
||||
case NET_LL_SLIP: /* Serial Line Internet Protocol (SLIP) */
|
||||
dev->d_llhdrlen = 0;
|
||||
dev->d_mtu = CONFIG_NET_SLIP_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_SLIP_PKTSIZE;
|
||||
devfmt = NETDEV_SLIP_FORMAT;
|
||||
break;
|
||||
#endif
|
||||
|
|
@ -322,7 +322,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
|
|||
case NET_LL_TUN: /* Virtual Network Device (TUN) */
|
||||
dev->d_llhdrlen = 0; /* This will be overwritten by tun_ioctl
|
||||
* if used as a TAP (layer 2) device */
|
||||
dev->d_mtu = CONFIG_NET_TUN_MTU;
|
||||
dev->d_pktsize = CONFIG_NET_TUN_PKTSIZE;
|
||||
devfmt = NETDEV_TUN_FORMAT;
|
||||
break;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -287,15 +287,16 @@ config NET_6LOWPAN_MAX_MACTRANSMITS
|
|||
layer should resend packets if no link-layer ACK wasreceived. This
|
||||
only makes sense with the csma_driver.
|
||||
|
||||
config NET_6LOWPAN_MTU
|
||||
config NET_6LOWPAN_PKTSIZE
|
||||
int "6LoWPAN packet buffer size"
|
||||
default 1294
|
||||
range 590 1518
|
||||
---help---
|
||||
Packet buffer size. This size includes the TCP/UDP payload plus the
|
||||
size of TCP/UDP header, the IP header, and the Ethernet header.
|
||||
This value is normally referred to as the MTU (Maximum Transmission
|
||||
Unit); the payload is the MSS (Maximum Segment Size).
|
||||
This value is related to the MTU (Maximum Transmission Unit), except
|
||||
that it includes the size of the link layer header; the payload is
|
||||
the MSS (Maximum Segment Size).
|
||||
|
||||
NOTE that this option depends on fragmentation support. By
|
||||
supporting fragmentation, we can handle quite large "logical" packet
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ Optimal 6LoWPAN Configuration
|
|||
|
||||
5. IOBs: Must be big enough to hold one IEEE802.15.4 frame (typically 127).
|
||||
There must be enough IOBs to decompose the largest IPv6 packet
|
||||
(CONFIG_NET_6LOWPAN_MTU, default 1294, plus per frame overhead).
|
||||
(CONFIG_NET_6LOWPAN_PKTSIZE, default 1294, plus per frame overhead).
|
||||
|
||||
Fragmentation Headers
|
||||
---------------------
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
* won't work unless there are a few more.
|
||||
*/
|
||||
|
||||
#if CONFIG_NET_6LOWPAN_MTU > (CONFIG_IOB_BUFSIZE * CONFIG_IOB_NBUFFERS)
|
||||
#if CONFIG_NET_6LOWPAN_PKTSIZE > (CONFIG_IOB_BUFSIZE * CONFIG_IOB_NBUFFERS)
|
||||
# error Not enough IOBs to hold one full 6LoWPAN packet
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -340,9 +340,9 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
|||
|
||||
/* Drop the packet if it cannot fit into the d_buf */
|
||||
|
||||
if (fragsize > CONFIG_NET_6LOWPAN_MTU)
|
||||
if (fragsize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Reassembled packet size exeeds CONFIG_NET_6LOWPAN_MTU\n");
|
||||
nwarn("WARNING: Reassembled packet size exeeds CONFIG_NET_6LOWPAN_PKTSIZE\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
|
|
@ -521,10 +521,10 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
|||
*/
|
||||
|
||||
paysize = iob->io_len - g_frame_hdrlen;
|
||||
if (paysize > CONFIG_NET_6LOWPAN_MTU)
|
||||
if (paysize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Packet dropped due to payload (%u) > packet buffer (%u)\n",
|
||||
paysize, CONFIG_NET_6LOWPAN_MTU);
|
||||
paysize, CONFIG_NET_6LOWPAN_PKTSIZE);
|
||||
ret = -ENOSPC;
|
||||
goto errout_with_reass;
|
||||
}
|
||||
|
|
@ -532,11 +532,11 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
|||
/* Sanity-check size of incoming packet to avoid buffer overflow */
|
||||
|
||||
reqsize = g_uncomp_hdrlen + (fragoffset << 3) + paysize;
|
||||
if (reqsize > CONFIG_NET_6LOWPAN_MTU)
|
||||
if (reqsize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Required buffer size: %u+%u+%u=%u Available=%u\n",
|
||||
g_uncomp_hdrlen, (fragoffset << 3), paysize,
|
||||
reqsize, CONFIG_NET_6LOWPAN_MTU);
|
||||
reqsize, CONFIG_NET_6LOWPAN_PKTSIZE);
|
||||
ret = -ENOMEM;
|
||||
goto errout_with_reass;
|
||||
}
|
||||
|
|
@ -667,7 +667,7 @@ static int sixlowpan_dispatch(FAR struct radio_driver_s *radio)
|
|||
* - The io_flink field points to the next frame in the list (if enable)
|
||||
* - The last frame in the list will have io_flink == NULL.
|
||||
*
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_MTU + CONFIG_NET_GUARDSIZE
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE + CONFIG_NET_GUARDSIZE
|
||||
* must also be provided. The frame will be decompressed and placed in
|
||||
* the d_buf. Fragmented packets will also be reassembled in the d_buf as
|
||||
* they are received (meaning for the driver, that two packet buffers are
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ static uint16_t sixlowpan_tcp_chksum(FAR const struct ipv6tcp_hdr_s *ipv6tcp,
|
|||
|
||||
/* Verify some minimal assumptions */
|
||||
|
||||
if (upperlen > CONFIG_NET_6LOWPAN_MTU)
|
||||
if (upperlen > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ static uint16_t sixlowpan_udp_chksum(FAR const struct ipv6udp_hdr_s *ipv6udp,
|
|||
|
||||
/* Verify some minimal assumptions */
|
||||
|
||||
if (upperlen > CONFIG_NET_6LOWPAN_MTU)
|
||||
if (upperlen > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
|
|||
* is the minimum size.
|
||||
*/
|
||||
|
||||
mss = dev->d_mtu - (NET_LL_HDRLEN(dev) + iplen + TCP_HDRLEN);
|
||||
mss = dev->d_pktsize - (NET_LL_HDRLEN(dev) + iplen + TCP_HDRLEN);
|
||||
|
||||
#ifdef CONFIG_NET_TCP_READAHEAD
|
||||
/* Update the TCP received window based on read-ahead I/O buffer
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ uint16_t ipv4_upperlayer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
|
|||
|
||||
/* Verify some minimal assumptions */
|
||||
|
||||
if (upperlen > NET_DEV_MTU(dev))
|
||||
if (upperlen > NETDEV_PKTSIZE(dev))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ uint16_t ipv6_upperlayer_chksum(FAR struct net_driver_s *dev, uint8_t proto)
|
|||
|
||||
/* Verify some minimal assumptions */
|
||||
|
||||
if (upperlen > NET_DEV_MTU(dev))
|
||||
if (upperlen > NETDEV_PKTSIZE(dev))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue