<div dir="ltr"><div><div><div>Hi,<br><br>I have the following error when trying to send netlink multicast<br>[15185.963673] could not multicast packet: -3<br>my_timer_callback called (4298697424).<br>[15205.976244] sending request for eid (4).<br>
[15205.976250] BUG: scheduling while atomic: swapper/5/0/0x10000100<br>[15205.976253] Modules linked in: lig_module(O) ip6table_filter ip6_tables iptable_filter ip_tables ebtable_nat ebtables x_tables dm_crypt arc4 ath9k mac80211 binfmt_misc uvcvideo snd_hda_codec_hdmi videobuf2_core ath9k_common ath9k_hw videodev snd_hda_codec_realtek videobuf2_vmalloc videobuf2_memops snd_hda_intel snd_hda_codec snd_hwdep snd_pcm ath fglrx(PO) snd_seq_midi snd_rawmidi joydev cfg80211 kvm_intel snd_seq_midi_event snd_seq kvm snd_timer psmouse snd_seq_device snd i7core_edac mei asus_laptop edac_core lpc_ich soundcore microcode sparse_keymap snd_page_alloc input_polldev serio_raw amd_iommu_v2 coretemp hid_generic usbhid hid atl1c video<br>
[15205.976335] Pid: 0, comm: swapper/5 Tainted: P W O 3.5.0mptcpbymatt+ #5<br>[15205.976338] Call Trace:<br>[15205.976340] <IRQ> [<ffffffff816630b3>] __schedule_bug+0x4d/0x59<br>[15205.976360] [<ffffffff8166c904>] __schedule+0x6e4/0x7c0<br>
[15205.976368] [<ffffffff81084b3a>] __cond_resched+0x2a/0x40<br>[15205.976375] [<ffffffff8166ca60>] _cond_resched+0x30/0x40<br>[15205.976382] [<ffffffff8116c198>] kmem_cache_alloc_node+0x38/0x150<br>[15205.976390] [<ffffffff8155a12b>] ? __alloc_skb+0x4b/0x230<br>
[15205.976398] [<ffffffffa0277230>] ? send_request_for_eid+0x130/0x130 [lig_module]<br>[15205.976404] [<ffffffff8155a12b>] __alloc_skb+0x4b/0x230<br>[15205.976411] [<ffffffffa0277230>] ? send_request_for_eid+0x130/0x130 [lig_module]<br>
[15205.976418] [<ffffffffa027713b>] send_request_for_eid+0x3b/0x130 [lig_module]<br>[15205.976424] [<ffffffffa0277230>] ? send_request_for_eid+0x130/0x130 [lig_module]<br>[15205.976431] [<ffffffffa0277230>] ? send_request_for_eid+0x130/0x130 [lig_module]<br>
[15205.976437] [<ffffffffa027727d>] my_timer_callback+0x4d/0x60 [lig_module]<br>[15205.976447] [<ffffffff810630fd>] run_timer_softirq+0x13d/0x340<br>[15205.976453] [<ffffffff8101a2e9>] ? read_tsc+0x9/0x20<br>
[15205.976460] [<ffffffff8105a6f6>] __do_softirq+0xb6/0x1d0<br>[15205.976467] [<ffffffff810a7c06>] ? clockevents_program_event+0x76/0x120<br>[15205.976474] [<ffffffff810a9154>] ? tick_program_event+0x24/0x30<br>
[15205.976481] [<ffffffff8167729c>] call_softirq+0x1c/0x30<br>[15205.976489] [<ffffffff81015115>] do_softirq+0x75/0xb0<br>[15205.976494] [<ffffffff8105aac5>] irq_exit+0xa5/0xb0<br>[15205.976500] [<ffffffff81677bde>] smp_apic_timer_interrupt+0x6e/0x99<br>
[15205.976507] [<ffffffff8167694a>] apic_timer_interrupt+0x6a/0x70<br>[15205.976510] <EOI> [<ffffffff8138ad5a>] ? intel_idle+0xea/0x150<br>[15205.976525] [<ffffffff8138ad3b>] ? intel_idle+0xcb/0x150<br>
[15205.976532] [<ffffffff8151c239>] cpuidle_enter+0x19/0x20<br>[15205.976539] [<ffffffff8151c869>] cpuidle_idle_call+0xa9/0x240<br>[15205.976545] [<ffffffff8101c40f>] cpu_idle+0xaf/0x120<br>[15205.976551] [<ffffffff81658919>] start_secondary+0x1de/0x1e5<br>
<br><br></div>and caused by the following code. The family and ops are correctly registered, I've created the multicast group beforehand. It seems it does work when there is a client registered in this multicast group but if there isn't any client, it returns -3. The return code is fine with me but I don't understand why there is this stack trace though.<br>
<br><br>/**<br>send the request <br>**/<br>int send_request_for_eid(u32 eid)<br>{<br> //!<br> struct sk_buff *skb;<br> int rc = 0;<br> void *msg_head;<br><br> printk( "sending request for eid %u.%u.%u.%u.\n", NIPQUAD(eid) );<br>
<br><br> /* send a message back*/<br> /* allocate some memory, since the size is not yet known use NLMSG_GOODSIZE*/<br> skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);<br><br> if (skb == NULL)<br> {<br> printk(KERN_ERR "could not allocate space for new msg");<br>
return -ENOMEM;<br> }<br> /* create the message headers <br> arguments of genlmsg_put:<br> struct sk_buff *,<br> int (sending) pid,<br> int sequence number,<br> struct genl_family *,<br>
int flags,<br> u8 command index (why do we need this?) <br>*/<br><br> // TODO passer des NL_AUTO plutot ?<br> msg_head = genlmsg_put(<br> skb, <br> 0, /* */<br>
0, /* no de seq (NL_AUTO_SEQ ne marche pas) */<br> &lig_gnl_family, <br> LIG_GENL_HDRLEN, /* header length (to check) */<br> ELC_REQUEST_RLOCS_FOR_EID /* command */<br>
);<br><br> if (msg_head == NULL) {<br> printk( KERN_ERR "could not create generic header");<br><br> return -ENOMEM;<br> <br> }<br><br> /* puts EID we are looking RLOCs for */<br>
rc = nla_put_u32( skb, ELA_EID, eid);<br> // rc = nla_put_string(skb, ELA_EID, "hello world from kernel space\n");<br> if (rc != 0)<br> {<br> printk( KERN_ERR "could not add payload");<br>
return rc;<br> }<br><br> /* finalize the message */<br> genlmsg_end(skb, msg_head);<br><br><br> /* returns -ESRCH (= -3) => no such process */<br> // todo a envoyer en broadcast<br> //struct sk_buff *skb, u32 pid,unsigned int group, gfp_t flags)<br>
rc = genlmsg_multicast( <br> skb, <br> 0, /* set own pid to not recevie */<br> <a href="http://lig_multicast_group.id">lig_multicast_group.id</a>, <br> GFP_KERNEL <br> );<br><br><br>
if(rc != 0)<br> {<br> printk( KERN_ERR "could not multicast packet: %d", rc);<br> }<br> return 0;<br>}<br><br><br></div><div>Maybe this is more a netlink error than an libgenl error so don't hesitate to point me to a better suited mailing list if that's the case.<br>
<br></div><div>Thanks<br></div><br></div><div><div><br><br></div></div></div>