ping 返回 no buffer space available 解决方法

1. 云主机当前常规并发比较大,  约有 1900 个常规连接

[root@chao-data07 ~]# netstat -nt | grep EST | wc -l
1867


2. 当前出现 arp 表不正常现象


见到下面错误信息

Mar 24 14:06:31 chao-data07 dhclient[1112]: DHCPREQUEST on eth0 to 10.199.212.200 port 67 (xid=0xd488179)
Mar 24 14:06:31 chao-data07 dhclient[1112]: send_packet: No buffer space available
Mar 24 14:06:31 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:06:40 chao-data07 dhclient[1112]: DHCPREQUEST on eth0 to 10.199.212.200 port 67 (xid=0xd488179)
Mar 24 14:06:40 chao-data07 dhclient[1112]: DHCPACK from 10.199.212.200 (xid=0xd488179)
Mar 24 14:06:41 chao-data07 dhclient[1112]: bound to 10.199.196.108 -- renewal in 34441 seconds.
Mar 24 14:07:13 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:07:13 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:07:14 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:07:14 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:07:16 chao-data07 kernel: Neighbour table overflow.
Mar 24 14:07:16 chao-data07 kernel: Neighbour table overflow.

Mar 24 23:40:42 chao-data07 dhclient[1112]: DHCPREQUEST on eth0 to 10.199.212.200 port 67 (xid=0xd488179)
Mar 24 23:40:42 chao-data07 dhclient[1112]: send_packet: No buffer space available

Mar 25 10:18:08 chao-data07 kernel: __ratelimit: 24 callbacks suppressed
Mar 25 10:18:08 chao-data07 kernel: Neighbour table overflow.
Mar 25 10:18:08 chao-data07 kernel: Neighbour table overflow.


ping 时候返回  no buffer space available 信息


解决方法:

echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
echo 8192 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
echo 20480 > /proc/sys/net/ipv4/neigh/default/gc_thresh3


暂时解决问题.





### STM32F407VET6 Microcontroller Ethernet Configuration and Usage #### Overview of the Ethernet Module on STM32F407VET6 The STM32F407VET6 integrates a full-duplex Ethernet MAC (Media Access Controller), which supports IEEE 802.3 standard operations, including support for MII/RMII interfaces to connect with external PHY devices[^1]. This allows developers to implement network communication capabilities within embedded systems. #### Hardware Requirements To enable Ethernet functionality, an external PHY chip is required as the STM32's built-in MAC does not include physical layer transmission functions. Commonly used PHY chips like DP83848 or LAN8720 can be connected via RMII interface pins provided by the MCU[^2]. #### Software Setup Steps For configuring software settings: - **Initialization**: Initialize the Ethernet peripheral using HAL library functions such as `HAL_ETH_Init()`. Configure parameters according to specific application needs. - **DMA Buffer Allocation**: Allocate DMA buffers that will store incoming/outgoing packets. These should be properly aligned in memory space accessible by both CPU and DMA controller[^3]. - **Interrupt Handling**: Set up interrupt handlers for handling events related to packet reception/transmission completion etc., ensuring timely processing without data loss. ```c // Example initialization code snippet ETH_HandleTypeDef heth; void MX_ETH_Init(void){ /* ETH init function */ heth.Instance = ETH; heth.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE; heth.Init.PhyAddress = ETH_PHY_ADDRESS; heth.Init.MACAddr[0] = 0x00; heth.Init.MACAddr[1] = 0x80; heth.Init.MACAddr[2] = 0xE1; heth.Init.MACAddr[3] = 0x00; heth.Init.MACAddr[4] = 0x00; heth.Init.MACAddr[5] = 0x00; heth.Init.RxMode = ETH_RXPOLLING_MODE; heth.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE; heth.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII; if (HAL_ETH_Init(&heth) != HAL_OK){ Error_Handler(); } } ``` #### Testing Network Connectivity After completing hardware connections and software configurations, test connectivity through simple ping commands from another device on the same local area network. Monitor traffic statistics using debug tools integrated into development environments or third-party utilities designed specifically for this purpose[^4]. --related questions-- 1. What are some common issues encountered during STM32 Ethernet setup? 2. How do you configure static IP addresses versus DHCP clients on STM32 platforms? 3. Can multiple instances of TCP/IP stacks run simultaneously on one STM32 board? If yes, how would they interact? 4. Are there any particular considerations when choosing between MII vs RMII modes for interfacing with different types of PHYs? 5. In what scenarios might it make sense to use lwIP instead of other available networking libraries for STM32 projects? [^1]: Describes the feature set offered by STM32 family members regarding their Ethernet capabilities. [^2]: Explains why additional components may be necessary depending upon desired implementation specifics. [^3]: Highlights important aspects concerning efficient management of resources involved in high-speed communications protocols. [^4]: Provides guidance on verifying correct operation after setting everything up correctly.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Terry_Tsang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值