From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 7ECCE16829 for ; Thu, 7 Sep 2017 10:13:40 +0200 (CEST) Received: by mail-pf0-f174.google.com with SMTP id y68so16697226pfd.0 for ; Thu, 07 Sep 2017 01:13:40 -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=UwZONpiQoc4qipaG5rB03RzLu3SHE+Zcb3MX4ukLCow=; b=yUPAuuzYk8zI/uKnPreS7cAANgrY91pLVcERlaq4OpZ0jEZyL91vOvV/ngLYNS/1Y0 hy2mArxlpU7wRQ+SbYvclxKKLtpRw1pYQYPhMUOPN32bitP8B5W5pDsQ6F/G8teBbq7B CeF8TJK152bgOkm7WaIl4Hw7ZuygwhWlGhKs08sZfSkMe5pV/amc2d2d5TYYkt1mXTOh 14KRHZKHjZKJoUS5DQRGLcPStWeoAbTgqraq84IlyvI8zoXJChnGGoAa3IYvmkqs/qXF hA7MYPogoZz9S0f7IabHFggK1kys1dRb3W5yy1UDF/Wl2IuG6+i1KypV3BwFBabQz65U Fjuw== 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=UwZONpiQoc4qipaG5rB03RzLu3SHE+Zcb3MX4ukLCow=; b=TkYnWH1T7o6a4h9ijK2dqoZ40WwQBPh3xj/GvzXTEjU8o32lxoXLH9JdWABg4tR9Uh VA+zwuFZh7X1XERI6ZHPVC9+/tjkSysEMvTWGrm6RHKS7OnkAeaU6MZXfDBlYpJVwyfD wQjeZw+F23/WqaDYKhLMU98vCvyB/ySzPTKDFN1E1BVKLpQvNuZ+Ck2jlteb6d8yEdeY oJKWE8GcWaCrMioWGF+HP6F0yird6y+E0HCbg7IunI5gqFz7D4g2gg9LRf2p/GYNxsQ4 MgRymD5MvCQlRDAjM6R6VBZPTdlBkwNBN/3KfkjOYwZzyO+JnJH4gYEp2tFWxzaZNqzp JLeQ== X-Gm-Message-State: AHPjjUhunp/RSCS0FofKOSEILya7EaGGUZF8+yaqhqU9tIiKpDBrFrlD lR5aT7B4rjAt81sQrdBOEA== X-Google-Smtp-Source: ADKCNb50OVALM4at62s2Y+ecfDqyM6xB2JR3RARqEbJDcz5P4bkYzozpbjUJOhvvgBzloK7zeYwl3Q== X-Received: by 10.98.80.13 with SMTP id e13mr1869674pfb.341.1504772019640; Thu, 07 Sep 2017 01:13:39 -0700 (PDT) Received: from yliu-home ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id v71sm2960457pfa.45.2017.09.07.01.13.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Sep 2017 01:13:38 -0700 (PDT) Date: Thu, 7 Sep 2017 16:13:30 +0800 From: Yuanhan Liu To: Olivier MATZ Cc: dev@dpdk.org, maxime.coquelin@redhat.com, stephen@networkplumber.org, stable@dpdk.org Message-ID: <20170907081330.GZ9736@yliu-home> References: <20170831134015.1383-1-olivier.matz@6wind.com> <20170831134015.1383-8-olivier.matz@6wind.com> <20170901091916.GT9736@yliu-home> <20170901095216.kqx7lwdiktq7y5zs@neon> <20170901123106.GW9736@yliu-home> <20170906144010.weoqqjzdmvnj7lwy@neon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170906144010.weoqqjzdmvnj7lwy@neon> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-stable] [PATCH 7/9] net/virtio: rationalize setting of Rx/Tx handlers X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 08:13:40 -0000 On Wed, Sep 06, 2017 at 04:40:12PM +0200, Olivier MATZ wrote: > On Fri, Sep 01, 2017 at 08:31:06PM +0800, Yuanhan Liu wrote: > > On Fri, Sep 01, 2017 at 11:52:17AM +0200, Olivier MATZ wrote: > > > > > @@ -1534,7 +1554,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > > > > > RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr_mrg_rxbuf)); > > > > > > > > > > eth_dev->dev_ops = &virtio_eth_dev_ops; > > > > > - eth_dev->tx_pkt_burst = &virtio_xmit_pkts; > > > > > > > > > > if (rte_eal_process_type() == RTE_PROC_SECONDARY) { > > > > > if (!hw->virtio_user_dev) { > > > > > @@ -1544,12 +1563,8 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > > > > > } > > > > > > > > > > virtio_set_vtpci_ops(hw); > > > > > - if (hw->use_simple_rxtx) { > > > > > - eth_dev->tx_pkt_burst = virtio_xmit_pkts_simple; > > > > > - eth_dev->rx_pkt_burst = virtio_recv_pkts_vec; > > > > > - } else { > > > > > - rx_func_get(eth_dev); > > > > > - } > > > > > + set_rxtx_funcs(eth_dev); > > > > > > > > No need to invoke it here? > > > > > > I wanted to stay consistent with previous code. > > > > > > I'm not very used to work with secondary processes, so I'm not 100% it > > > is ok, but in my understanding, in that case the configuration is done > > > first by the primary process, and the secondary the pointers to the > > > rx/tx funcs. I suppose their value can be different than primary ones. > > > > It probably needs some testing, but I think it should be okay, because > > the rx/tx funcs will always be updated at dev_start in this patch. > > I still have one doubt about this: looking in > examples/multi_process/symmetric_mp/main.c, I can see that rte_eth_dev_start() > is only called on the primary process. So if I remove set_rxtx_funcs() from > eth_virtio_dev_init(), it looks that the rx functions won't be initialized. > > Again, I'm not a user of multi_proc, so I may be wrong, but I think > it would be safer to keep it. Yes, you are right. --yliu