From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 0BC612A58 for ; Wed, 5 Jul 2017 21:07:10 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id c73so134073749pfk.2 for ; Wed, 05 Jul 2017 12:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sPUS5z+MpRCYJcOxl37zN3FtfeGSi/uw1w5CPAc0pb8=; b=QfF27xPMjnehMV8dxPWr2PhrAK4eVhk+bPsP8hU1iD3aaUW9psNqvcmYGMSUfPQBRc YldB3tgX/L0Zb8rU9JTXeNrwE57CsTy5on8N2ownj6xPiBHcMHhgfcJXM0AR2XoQXR89 pIBP1DppdYzP1OVWZiIoNSgTowEDwY7/js6nAOGXic3i6JX4Qlx21yHO4g+HHjVJOfet lh9IpWbbirHzWD+6UlaUzNGzkx65I8g/PkaBA80xvw+vFas+O6fDPyaG5BP2jh2jnrBG un1zh7zEPtziIoJYiys4BEBaGTFMBB8Y3CxcaI3CodTRDlRElqzbB7jf3JG6zvrRmYB6 /bqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sPUS5z+MpRCYJcOxl37zN3FtfeGSi/uw1w5CPAc0pb8=; b=Ttj7VBC0/DkLYkP28IUDuT0h27xYZJADBfxOd7n/ylAOp9Op2x312gF73bflIt4oSb IVnJeU58D9v0gu7xi/4LPIyljoNRtc7HXOZenjp71A1pQkX1xsSGFinTPu+y15xdlsbm CTqK0vqltIyiDXpb0674ecwhA5YuK9UCOS1PDbrRemu/fkL1exbHb3NHoOPhmX0ulALO c6jbvfV2lC8tbqxRd87Sry4dXjCZM06dRY6BqrQoVMmau3aX2cE9Q8RhdDSXEp846bY2 C/8CJzaBnpJ5qv9NI7gOLvrhO4AW3e65NhxsbvaVF4SiB6DzueYpjCp/E6ooUCiZFPdT 47Kg== X-Gm-Message-State: AIVw1117ZO81VqneeoEO3W4dW+qy3J5ZkuogqD93yx+mR54uzEKXdDOP 5fZG+Y3Jcd+FuWmL X-Received: by 10.98.69.219 with SMTP id n88mr22156344pfi.192.1499281630088; Wed, 05 Jul 2017 12:07:10 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id x14sm23005419pfe.83.2017.07.05.12.07.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jul 2017 12:07:09 -0700 (PDT) Date: Wed, 5 Jul 2017 12:07:03 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: dev@dpdk.org, Bruce Richardson , Anatoly Burakov Message-ID: <20170705120703.77efb263@xeon-e3> In-Reply-To: <20170704161337.45926-12-ferruh.yigit@intel.com> References: <20170630165140.59594-1-ferruh.yigit@intel.com> <20170704161337.45926-1-ferruh.yigit@intel.com> <20170704161337.45926-12-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v10 11/20] unci: add netlink exec X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jul 2017 19:07:11 -0000 On Tue, 4 Jul 2017 17:13:28 +0100 Ferruh Yigit wrote: > +int unci_nl_exec(u32 cmd, struct net_device *dev, void *in_data, > + size_t in_data_len, void *out_data, size_t out_data_len) > +{ > + struct unci_dev *unci = netdev_priv(dev); > + int err = -EINVAL; > + int ret; > + > + if (out_data_len > UNCI_NL_MSG_LEN) { > + pr_err("Message is too big to receive:%zu\n", out_data_len); > + return err; > + } > + > + mutex_lock(&sync_lock); > + ret = unci_response_buffer_register(cmd, out_data, out_data_len, > + &unci->msg_received, &err); > + if (ret) { > + mutex_unlock(&sync_lock); > + return -EINVAL; > + } > + > + ret = unci_nl_send(cmd, unci->port_id, unci->pid, in_data, in_data_len); > + if (ret) { > + unci_response_buffer_unregister(response_buffer.magic); > + mutex_unlock(&sync_lock); > + return ret; > + } > + > + ret = wait_for_completion_interruptible_timeout(&unci->msg_received, > + msecs_to_jiffies(UNCI_CMD_TIMEOUT)); Blocking for completion with mutex held? Sleeping with mutex held is not allowed in Linux. You will see this if you run with lockdep and all the other kernel debug config options.