LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   netlink socket recvmsg returns -ENOMEM (https://www.linuxquestions.org/questions/linux-kernel-70/netlink-socket-recvmsg-returns-enomem-4175556026/)

devanarr 10-13-2015 09:56 AM

netlink socket recvmsg returns -ENOMEM
 
Currently I am facing a issue on netlink socket which needs clarification.

I am using libnl-tiny for the support of netlink socket in userspace and a netlink socket is created in my module mod1 with out specific sockbuf set options which creates the socket with default rmem and wmem of 32767 size. This socket is subscribed for listening the neighbor messages(RTNLGRP_NEIGH) from kernel. In some instance burst of arps has been hit and the socket memory seems filled up.

From the userspace mod1, the recvmsg is receiving response of -ENOMEM. What will be the root cause and how this to be avoided ? Moreover recvmsg trigger is based on the socket fd changes of the netlink socket, which is not happening anymore. Why there is no socket fd change happening once the recv memory reached max? How to come out of this situation?

I can observe the following when I am looking for socket state. rmem is reached and struck around 64k. Whether increasing receive memory of netlink socket fix this? My userspace module mod1 seems slow in processing and picking up messages from queue. Your suggestions are welcome in this front.

root:~# cat /proc/net/netlink
sk Eth Pid Groups Rmem Wmem Dump Locks Drops Inode
88bbec00 0 4126 00000004 65856 0 00000000 2 18512 11121

Also the corresponding userspace module proc has shown the following . Is "Max locked memory" has any significance with the netlink socket functioning?

root:~# cat /proc/4126/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max open files 1024 4096 files
Max address space unlimited unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 965 965 processes
Max locked memory 65536 65536 bytes
Max pending signals 965 965 signals
Max msgqueue size 819200 819200 bytes

Regards,
Deva


All times are GMT -5. The time now is 06:18 AM.