From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 04ABB58CF for ; Mon, 13 Feb 2017 22:28:53 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id v186so2198967wmd.0 for ; Mon, 13 Feb 2017 13:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=haY3WGE0FJJNs76MWqKqSHG5kURm2bK9vDiwei+WnaE=; b=aJx7vRq6V15ir/cnDcLtvtgWNHadAUlaFvDamBtyxrRjYTi9VCWjufXaR14RyDGvub PDp7wfYfiDtn9gCWR2hjrl971PigNKsJPUoXObfhqvXhaTLAQJlolv6W7CiepOzWx7wv /wrCSO1xVeGloK6paouHrDEF9eqvBLO1WAJTiwDPuYhChzfUIMrcfLl0l6HL+o4ntlq8 HdkuNEy6GhPT2TEPJ/IcsVVh+8li8Wt4vUyEJ9St9PH02/DR3Yr4ms0dHnl5EhHhIat2 uo/W9jlEoI9Zvl9tPZfhusfUnlS9ttVzJ+4cyxP34PY4n4kG38Q1stWpjblzIXdte4FD ZgxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=haY3WGE0FJJNs76MWqKqSHG5kURm2bK9vDiwei+WnaE=; b=LsOSNm5qrlgb/uYN5f08b5MMUuk6YJ/5AhDBG9B+qaWuZN4P0FsRmfKE9L+uh9Sv67 NhZzardIu/U7azSZQfSthihgSiWoEeVeQAHviCqoeivRi6ooVpcOpwOhcfsdODoEboZI U7GKp/Rdhi5L5Dv7ep7Nq+UEq695yvARUd6sBDNIXGGzn74eaIRSeqUK/v8SLzmqeQBV WavIPjKbw0p0XTj47U4S1n5CkEvGc4J1l19xIhXNEKPsuElWrZIfMO+09IvVycJ/pidN qskHolvWKhcZ7pYZ+jjj0b1mnoTRLxbjDhxrdhAZUvxrtb4P6d5sAnoQxqMkkqpqsqaJ J2Vw== X-Gm-Message-State: AMke39k+m+metoCaXMUrZX0Hg8fSA4qi14Kd7VvfxkmXV8MKBLpu/mSb7tcH38lmIys94md1 X-Received: by 10.28.50.135 with SMTP id y129mr325799wmy.2.1487021333709; Mon, 13 Feb 2017 13:28:53 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id q16sm12288327wra.69.2017.02.13.13.28.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 13:28:52 -0800 (PST) From: Thomas Monjalon To: "Zhang, Qi Z" Cc: dev@dpdk.org, "Wu, Jingjing" Date: Mon, 13 Feb 2017 22:28:52 +0100 Message-ID: <11810388.91RJejsIF6@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <039ED4275CED7440929022BC67E706115305B067@SHSMSX103.ccr.corp.intel.com> References: <1486670383-5286-1-git-send-email-qi.z.zhang@intel.com> <3158466.ioj3dkTVO6@xps13> <039ED4275CED7440929022BC67E706115305B067@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: fix max number of interrupt request 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: Mon, 13 Feb 2017 21:28:54 -0000 2017-02-13 01:16, Zhang, Qi Z: > Hi Thomas: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 2017-02-09 14:59, Qi Zhang: > > > The max number of interrupt request is possible be changed after > > > rte_intr_callback_register, so in get_max_intr, we need to check if > > > nessesary to update the max_intr. > > > > So you are using rte_intr_enable() to update the max_intr field in the case of > > VFIO_MSIX. > > What about MSI, INTX and UIO cases? > > My thought is, even without my fix, VFIO_MSIX is already the only case that try to modify max_intr field > In get_max_intr, we have: > if (!src->intr_handle.max_intr) > src->intr_handle.max_intr = 1; > else if (src->intr_handle.max_intr > RTE_MAX_RXTX_INTR_VEC_ID) > src->intr_handle.max_intr > = RTE_MAX_RXTX_INTR_VEC_ID + 1; > So my patch just follow this and fix some problem. > > Another option is I can use a local variable that assigned by max_intr with boundary check, so get_max_intr can be totally removed and max_intr in intr_source will not be modified. > > To me both fix are not perfect, I think the problem is in rte_intr_callback_register we just save a copy of the pci_dev->intr_handle but not the address point, so we are missing some mechanism to sync them. > But since we have tight schedule on the 17.02 release and this issue does cause some example code can't work, so we need to a fix it first, we may consider improve the mechanism later. > > Thanks > Qi Applied with this title: "vfio: fix maximum number of interrupt for MSI-X" Please check how to document this behaviour and make it consistent with other types of interrupts.