From owner-freebsd-hackers@freebsd.org Mon Jun 13 21:08:38 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D721AF28C4 for ; Mon, 13 Jun 2016 21:08:38 +0000 (UTC) (envelope-from jk@kornberger.name) Received: from digineo.de (mail.digineo.de [185.55.116.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9E6C246F for ; Mon, 13 Jun 2016 21:08:37 +0000 (UTC) (envelope-from jk@kornberger.name) Received: from [192.168.0.108] (ip4d16a641.dynamic.kabel-deutschland.de [77.22.166.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jk) by digineo.de (Postfix) with ESMTPSA id 99D72604AA for ; Mon, 13 Jun 2016 23:08:34 +0200 (CEST) From: Julian Kornberger Subject: Usage of sosend() and its context To: freebsd-hackers@freebsd.org Message-ID: <575F20CF.1020103@kornberger.name> Date: Mon, 13 Jun 2016 23:08:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 21:08:38 -0000 Hi, I am building a kernel module for fastd [1] and have the problem, that on one of three machines the sosend() call seems to block. I use sosend() [2] in a tunneling function that is set by udp_set_kernel_tunneling(). Since I don't know which thread to pass to sosend() I just use curthread. Is it possible that I should not use sosend() in this context and instead build the IP packet manually and pass it to ip_output()? Any other hints? [1] https://fastd.readthedocs.io/ [2] https://github.com/digineo/fastd/blob/97fd40b9992778a3bf11756f41aa7c2615bba2f3/kmod/fastd.c#L664 Regards, Julian