From patchwork Mon Nov 24 16:27:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sujith Sankar X-Patchwork-Id: 1494 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1CBE080B4; Mon, 24 Nov 2014 17:17:02 +0100 (CET) Received: from rcdn-iport-7.cisco.com (rcdn-iport-7.cisco.com [173.37.86.78]) by dpdk.org (Postfix) with ESMTP id 66D0A80A9 for ; Mon, 24 Nov 2014 17:16:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=9031; q=dns/txt; s=iport; t=1416846468; x=1418056068; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=7YeLgea0y9vy32sueUBqtgW21fzCW38rjSK+GOAjJNo=; b=NypwYMXGa71wnipRpAtyKGVSG98Woo4EluClDeTvl4auYIqa7Ien5v68 KksszDi+z63N46H+fQ9Dw07bzg7AAYORWo5oRtpjoUXC4b/EItoRqORZ8 gWyj38RE+uQfKNNh+lLP2VckvmQi4dA7TvYdGUPL63Z1Bxda8zzNn461Z o=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjQFABRcc1StJA2F/2dsb2JhbABbgkhGgS4E0gQCgR4WAQEBAQF9hAIBAQEEJ1IQAgEIEQMBAigHMhQJCAIEDgWIQdAgAQEBAQEBAQECAQEBAQEBAQEBGZB6EQeETgWQOoIuhzeEYpcag314gQgkHIEDAQEB X-IronPort-AV: E=Sophos;i="5.07,449,1413244800"; d="scan'208,217";a="374801984" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-7.cisco.com with ESMTP; 24 Nov 2014 16:27:47 +0000 Received: from xhc-rcd-x04.cisco.com (xhc-rcd-x04.cisco.com [173.37.183.78]) by alln-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id sAOGRkEX013906 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 24 Nov 2014 16:27:46 GMT Received: from xmb-aln-x07.cisco.com ([169.254.2.173]) by xhc-rcd-x04.cisco.com ([fe80::200:5efe:173.37.183.34%12]) with mapi id 14.03.0195.001; Mon, 24 Nov 2014 10:27:46 -0600 From: "Sujith Sankar (ssujith)" To: David Marchand Thread-Topic: [dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD Thread-Index: AQHQBuhEwvzmIS/5eU6QDhmBVMOFxJxwA1MAgACsiYD//6qaAIAAX6gA Date: Mon, 24 Nov 2014 16:27:46 +0000 Message-ID: References: <1416758899-1351-1-git-send-email-ssujith@cisco.com> <1416758899-1351-7-git-send-email-ssujith@cisco.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [10.65.69.234] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" , "Prasad Rao \(prrao\)" Subject: Re: [dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" David, ENIC PMD needs info about BAR0 only, and vfio map routine puts it at index 0. So, it didn’t pose trouble. Regards, -Sujith From: David Marchand > Date: Monday, 24 November 2014 9:45 pm To: "Sujith Sankar (ssujith)" > Cc: "dev@dpdk.org" >, "Prasad Rao (prrao)" > Subject: Re: [dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD Mmm, I am not that familiar with vfio code, but I would say that there is something buggy in pci_vfio_map_resource() when compared to pci_uio_map_resource(). Is not there a problem with finding the right index of dev->mem_resource[] array ? --- David Marchand On Mon, Nov 24, 2014 at 4:51 PM, Sujith Sankar (ssujith) > wrote: Hi David, During the testing, I saw that the length field was 0. ENIC PMD validates the length of the BAR against a max value. In order to get the length in the resource structure, I added this statement. Thanks, -Sujith From: David Marchand > Date: Monday, 24 November 2014 4:33 pm To: "Sujith Sankar (ssujith)" > Cc: "dev@dpdk.org" >, "Prasad Rao (prrao)" > Subject: Re: [dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD Hello Sujith, On Sun, Nov 23, 2014 at 5:08 PM, Sujith Sankar > wrote: Not sure I understand why you need to overwrite the length value. This is supposed to be initialised before by "generic" code. This looks like a hack or a workaround. Can you elaborate on this change ? Thanks. -- David Marchand diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index c776ddc..6bf8f2e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -736,6 +736,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) maps[i].offset = reg.offset; maps[i].size = reg.size; dev->mem_resource[i].addr = bar_addr; + dev->mem_resource[i].len = reg.size; } /* if secondary process, do not set up interrupts */