From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8EEAD377E for ; Wed, 4 Jan 2017 07:56:58 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 03 Jan 2017 22:56:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,458,1477983600"; d="scan'208";a="49295447" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by fmsmga005.fm.intel.com with ESMTP; 03 Jan 2017 22:56:52 -0800 To: Yuanhan Liu References: <1482996643-113253-1-git-send-email-jianfeng.tan@intel.com> <1482996643-113253-6-git-send-email-jianfeng.tan@intel.com> <20161230062747.GI21789@yliu-dev.sh.intel.com> Cc: dev@dpdk.org, stephen@networkplumber.org From: "Tan, Jianfeng" Message-ID: <88093c9a-5bd8-5acb-aa87-4aa92c03a2df@intel.com> Date: Wed, 4 Jan 2017 14:56:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20161230062747.GI21789@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 5/9] net/virtio: setup rxq interrupts 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, 04 Jan 2017 06:56:59 -0000 On 12/30/2016 2:27 PM, Yuanhan Liu wrote: > On Thu, Dec 29, 2016 at 07:30:39AM +0000, Jianfeng Tan wrote: >> This patch mainly allocates structure to store queue/irq mapping, >> and configure queue/irq mapping down through PCI ops. It also creates >> eventfds for each Rx queue and tell the kernel about the eventfd/intr >> binding. >> >> Mostly importantly, different from previous NICs (usually implements >> these logic in dev_start()), virtio's interrupt settings should be >> configured down to QEMU before sending DRIVER_OK notification. > Isn't it obvious we have to have all driver stuff (including interrupt > settings) configured properly before setting DRIVER_OK? :) That said, > it's meanless to state the fact that virtio acts differently than other > nics here on dev_start/stop. > >> Note: We only support 1:1 queue/irq mapping so far, which means, each >> rx queue has one exclusive interrupt (corresponding to irqfd in the >> qemu/kvm) to get notified when packets are available on that queue. > That means you have to setup the "vectors=N" option has to set correctly > in QEMU, otherwise it won't work? Yes, actually, the correct value should be "vectors>=N+1", with N standing for the number of queue pairs. It's due to the hard coded mapping logic: 0 -> config irq 1 -> rxq0 2 -> rxq1 ... > If so, you also have to doc it somewhere. Agreed. [...] >> + >> + if (virtio_queues_bind_intr(dev) < 0) { >> + PMD_INIT_LOG(ERR, "Failed to bind queue/interrupt"); >> + return -1; > You have to free intr_handle->intr_vec, otherwise, memory leak occurs. It's freed at dev_close(). Do you mean freeing and reallocating here? As nr_rx_queues is not a changeable value, I don't see the necessity here. I miss something? Thanks, Jianfeng