From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 002212C01 for ; Wed, 27 Sep 2017 11:36:15 +0200 (CEST) Received: by mail-pf0-f170.google.com with SMTP id m63so6984518pfk.7 for ; Wed, 27 Sep 2017 02:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7bACDHyMUuFO3aylZ6JqE70EGmIv+X+/G65Gc+6xIQ8=; b=jSQPQo/cGuds/g35teVXBzWcdm8+6umhJIl5Wa31YaSL+rhFOlz0KrV3+lqbyqUlaL nxsXg3zkRb/lSm8Uh9P8sEhB1+Anf5w/DNqb0kS0RADsnRS9nxNwgsiuP5L/Ae/VJz9U d5aWKDSvlNWnx5R74Q/SdvylAX9VIhkXT/zZRyZFVrZEjkKxRidrlCgrF7+Vh0JvYDEs V+tqdbmHdiKpdy1z264lLLso0OxwhhayiUe0+AWu6iZJJ/sVYCO4mkwy5eB5EmJV1oyN KVY5iVQcBZgkzJDggDAw/CByg4o12eZIVIhoppNfVnCOsKsLwwWFIMgOGiF45F2sZQr7 a9HQ== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7bACDHyMUuFO3aylZ6JqE70EGmIv+X+/G65Gc+6xIQ8=; b=av//kNO6Dj4mMYAQxHdhbY9P5clg4SxPKpmOlwONb7emo12FKCDEAL5VCblp6Fziao ZuqZRd92iadpbJTjcgh763kifCGhEAs0Vz0A7c3YCzFcY11unEIULdhkuNeq31/Wbwvx oWksfKI2OT4CI1AqEcKbqdk9tsrEvAhz+9wHzD/qGidR7M4n/2vciypVSsLxBM1yzCEE Wca5lIWBbqg1pZOcMlAxozneowvFLoD/KvFFOjwPveEmzqEDVh/NSDUIDWkXdl9wbn5W inLV6rFPPNWLMNP7gaRh8mq3rYYsV6A6VZLtRdJW/kMep9z+NKJzCJ2kVTpvMQkC52Yr whiA== X-Gm-Message-State: AHPjjUhLK4jl6u7I/803b2AEE1vcsIuBrYlvqX2XGf7ACbvOB3bSJxvQ YBNUKK15uxxD+j+p7GJDthoDBg== X-Google-Smtp-Source: AOwi7QDK7S0435DSXKoa/vTNsMOloOMWlFZCShSpNfNv8WceLYcgLNogEZ9l/gOzYv0l0TcezQGdFA== X-Received: by 10.98.152.209 with SMTP id d78mr793510pfk.58.1506504975024; Wed, 27 Sep 2017 02:36:15 -0700 (PDT) Received: from yliu-home ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id q23sm19868426pfk.182.2017.09.27.02.36.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Sep 2017 02:36:13 -0700 (PDT) Date: Wed, 27 Sep 2017 17:36:07 +0800 From: Yuanhan Liu To: "Tan, Jianfeng" Cc: "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "mtetsuyah@gmail.com" Message-ID: <20170927093607.GJ2251@yliu-home> References: <1503654052-84730-1-git-send-email-jianfeng.tan@intel.com> <1503654052-84730-11-git-send-email-jianfeng.tan@intel.com> <20170921033323.GA2251@yliu-home> <59f2bfc0-91ee-b276-68e3-563e5b5af89b@intel.com> <20170921091759.GE2251@yliu-home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH 10/12] vhost: support to kick in secondary process 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, 27 Sep 2017 09:36:16 -0000 On Fri, Sep 22, 2017 at 02:30:21AM +0000, Tan, Jianfeng wrote: > > > > -----Original Message----- > > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > > Sent: Thursday, September 21, 2017 5:18 PM > > To: Tan, Jianfeng > > Cc: dev@dpdk.org; maxime.coquelin@redhat.com; mtetsuyah@gmail.com > > Subject: Re: [PATCH 10/12] vhost: support to kick in secondary process > > > > On Thu, Sep 21, 2017 at 03:04:39PM +0800, Tan, Jianfeng wrote: > > > >On Fri, Aug 25, 2017 at 09:40:50AM +0000, Jianfeng Tan wrote: > > > >>To support kick in secondary process, we propose callfd_pri and > > > >>kickfd_pri to store the value in primary process; and by a new > > > >>API, rte_vhost_set_vring_effective_fd(), we can set effective > > > >>callfd and kickfd which can be used by secondary process. > > > >> > > > >>Note in this case, either primary process or the secondary process > > > >>can kick the frontend; that is, they cannot kick a vring at the > > > >>same time. > > > >Since only one can work, why not just overwriting the fd? Say, you > > > >could introudce some APIs like "rte_vhost_set_vring_callfd", then > > > >you don't need to introduce few more fields like "callfd_pri". > > > > > > That cannot address the below case: > > > 1. Primary starts; > > > 2. Secondary one starts; (if we overwrite it without storing it in some > > > other fields) > > > 3. Secondary one exits; > > > 4. Secondary two starts. (primary cannot share the fd with this secondary > > > process now, as this fd does not mean anything to the primary process) > > > > I was thinking that those fds will be retrieved by the primary process > > once? So thsoe it got at beginning are still valid? > > Yes, the FDs are valid to primary process at step 1. But After overwriting in step 2, those FDs are not valid to primary. Yes, but the primary process has already got its correct fds saved, right? With the saved fds, it then could share it with another secondary process. Actually, the key (and typical) issue of multi-process here is the fds are process specific, while they are stored in the shared memory. That means only one will take effect eventually. Worse, the old ones are lost. So, I think to make it right in this case, you should move the fds from the shared memory and store them in the memory of the corresponding process. If that's done, all processes could have its own valid fds, then every process could do the kick (if that's really necessary). You could check following commit for more info. 553f45932fb7 ("net/virtio: store PCI operators pointer locally") --yliu