You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running samples/net/sockets/packet the reception stops working after about 14 packets were received.
To Reproduce
Steps to reproduce the behavior:
west build -b native_posix_64 zephyr/samples/net/sockets/packet
On one terminal, run sudo ./net-setup.sh from the net-tools repo.
On the first terminal, type west build -t run.
Start sending packets to zeth interface (I used ping).
Expected behavior
All the packets are received correctly, and the print log net_pkt_sock_sample.recv_packet_socket: Received is printed for every packet.
Logs and console output
UART_0 connected to pseudotty: /dev/pts/4
WARNING: Using a test - not safe - entropy source
*** Booting Zephyr OS build zephyr-v2.5.0-2383-gf59cba331553 ***
[00:00:00.000,000] <inf> net_pkt_sock_sample: Packet socket sample is running
[00:00:00.000,000] <inf> net_pkt_sock_sample: Waiting for packets ...
[00:00:00.060,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 130 bytes
[00:00:00.960,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 130 bytes
[00:00:05.010,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:10.020,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:15.030,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:20.040,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:25.050,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:25.620,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 213 bytes
[00:00:26.640,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 213 bytes
[00:00:27.660,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 213 bytes
[00:00:28.680,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 213 bytes
[00:00:30.060,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:35.070,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:40.080,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:45.090,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:50.100,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:00:55.110,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:00.120,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:05.130,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:10.140,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:15.150,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:17.520,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 70 bytes
[00:01:20.160,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:25.170,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:30.180,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:32.220,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:33.300,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:34.320,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:35.190,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:35.340,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:36.360,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:37.380,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:38.400,000] <dbg> net_pkt_sock_sample.recv_packet_socket: Received 42 bytes
[00:01:39.530,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:40.200,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:40.550,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:41.570,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:42.590,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:43.610,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:45.210,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:50.220,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:53.270,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:54.290,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:55.230,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:01:55.310,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:56.330,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:57.350,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:01:58.370,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:02:00.240,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:05.250,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:10.260,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:15.270,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:20.280,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:25.290,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:25.730,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:02:26.750,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:02:27.770,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:02:28.790,000] <wrn> net_conn: pkt cloning failed, pkt 0x5645dbd534a0 dropped
[00:02:30.300,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:35.310,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:40.320,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:45.330,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:50.340,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:02:55.350,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:00.360,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:05.370,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:10.380,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:15.390,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:20.400,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:25.410,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:30.420,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
[00:03:35.430,000] <dbg> net_pkt_sock_sample.send_packet_socket: Sent 100 bytes
Environment (please complete the following information):
The conn_raw_input() in connection.c will clone the incoming
packet so that it is possible to receive socket data in
multiple packet sockets. This is all fine except that if the
socket is never calling recv(), then the cloned net_pkt is never
processed and we will have a memory leak.
What this all means in practice, is that we should call recv()
for every packet socket in order to flush the socket for any
incoming data even if the socket is just sending data.
Fixeszephyrproject-rtos#34462
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The conn_raw_input() in connection.c will clone the incoming
packet so that it is possible to receive socket data in
multiple packet sockets. This is all fine except that if the
socket is never calling recv(), then the cloned net_pkt is never
processed and we will have a memory leak.
What this all means in practice, is that we should call recv()
for every packet socket in order to flush the socket for any
incoming data even if the socket is just sending data.
Fixes#34462
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Describe the bug
When running
samples/net/sockets/packet
the reception stops working after about 14 packets were received.To Reproduce
Steps to reproduce the behavior:
west build -b native_posix_64 zephyr/samples/net/sockets/packet
sudo ./net-setup.sh
from thenet-tools
repo.west build -t run
.zeth
interface (I used ping).Expected behavior
All the packets are received correctly, and the print log
net_pkt_sock_sample.recv_packet_socket: Received
is printed for every packet.Logs and console output
Environment (please complete the following information):
f59cba331553be094c23f1fb2839e76c403f6bfc
(19.4.2021)The text was updated successfully, but these errors were encountered: