From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id D36371B6C7 for ; Wed, 10 Oct 2018 20:18:51 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id i8-v6so6443478wmg.0 for ; Wed, 10 Oct 2018 11:18:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Md+wL9tqZ9YFsVOU/E6u8YkY1p2rBBIdfhgk9u4SBM=; b=iad+CYCWk5LldQTr/r6YQbsmmhqnOa8pMq6HFYJTTB/twTQHYUtIFWg+hRLFOeMfLp zqkz6b87RgtB+KHF0dhopm1BHj3deoxmA+aUbx7u1LtBFZaTaIWC+gqjn2OUrcsUqWTO DmgoKrKMrlYmEyTXpnqzX93NxLYGP6pZEO2NLh8N+RAX33rxqEsHZK7WMhcpat+H0uK+ kr78cJVXB0l3oHqRT0q3a/2PuZpaIBqZzxEbdZcSbN8OPwWqv1ZcgN1HuM36gZZhRl0n 5ua9imurrWLNcZWSIv/N88Eufa/D3GAIlBnuz5POXHeY7hcAuv567i8Ug00wJlzSjf0b 3ABw== X-Gm-Message-State: ABuFfogxknUtU2DFOJu2z87KZIhMuNmJBblu+uLzixBh/JLMqtA95cjo C5Fm3pmvJYQfq65PfumUuQVF6A6dGHtQfeyEX9A= X-Google-Smtp-Source: ACcGV62dbhyLuE7G0raeRFF7hNTaGWk/RGHTuJNS/zFgfn2oys9bLkxSgOWEqViss2+geTy2SU3b05yCV5YIkKrtde8= X-Received: by 2002:a1c:9895:: with SMTP id a143-v6mr1804855wme.43.1539195531002; Wed, 10 Oct 2018 11:18:51 -0700 (PDT) MIME-Version: 1.0 References: <20180628224513.18391-1-dg@adax.com> <20180629015508.26599-1-dg@adax.com> <20180629015508.26599-3-dg@adax.com> <611163de-bef7-488b-a77b-0e1ff190f1fb@intel.com> <0596f426-0fc5-a222-ea68-4407669f9b22@intel.com> In-Reply-To: <0596f426-0fc5-a222-ea68-4407669f9b22@intel.com> From: Dan Gora Date: Wed, 10 Oct 2018 15:18:14 -0300 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 02/10] kni: separate releasing netdev from freeing KNI interface 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, 10 Oct 2018 18:18:52 -0000 On Wed, Oct 10, 2018 at 2:25 PM Ferruh Yigit wrote: > > On 9/4/2018 1:36 AM, Dan Gora wrote: > > Hi Ferruh, > > > > I remembered now the motivation behind separating rte_kni_release() > > and rte_kni_free(). > > > > The problem is that the DPDK thread which calls rte_kni_release() > > _cannot_ be the same thread which handles callbacks from the KNI > > driver via rte_kni_handle_request(). This is because the thread which > > calls rte_kni_release() will be stuck down in > > ioctl(RTE_KNI_IOCTL_RELEASE) when the kernel calls the > > RTE_KNI_REQ_CFG_NETWORK_IF callback to the DPDK application. Since > > that thread cannot call rte_kni_handle_request(), the callback would > > then just timeout unless some other thread calls > > rte_kni_handle_request(). > > > > So then you are in a bit of a chicken and egg situation. You _have_ > > to have a separate thread calling rte_kni_handle_request periodically, > > but that thread also _cannot_ run after rte_kni_release returns > > (actually it's worse than that because it's actually after the > > ioctl(RTE_KNI_IOCTL_RELEASE) returns and the fifos are freed). > > I see, so we have problem in both end, -userspace side and kernel side. > > Agreed that separating release & free may help, but I am not sure about adding a > new API for KNI. > > Very simply, what about prevent kni_net_release() send callback to userspace? No, because how is the DPDK application going to know when the user does 'ip link set down dev '? It's important for the DPDK application to know when the KNI interface is marked down. > This is already not working and removing it resolves the issues you mentioned. Huh? How is it not working? Of course it works. > Sample application calls rte_eth_dev_stop() after release itself, so behavior > will be same. Huh? > But the issues in kernel you mentioned, using `dev` after free_netdev() called > should be addressed. Yes, that's why I fixed them in the patches that I sent. d