From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0098.outbound.protection.outlook.com [207.46.100.98]) by dpdk.org (Postfix) with ESMTP id 85684374F for ; Mon, 14 Dec 2015 15:44:28 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain (122.167.202.21) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (TLS) id 15.1.337.19; Mon, 14 Dec 2015 14:44:24 +0000 Date: Mon, 14 Dec 2015 20:13:58 +0530 From: Jerin Jacob To: Santosh Shukla Message-ID: <20151214144356.GE30309@localhost.localdomain> References: <1450098032-21198-1-git-send-email-sshukla@mvista.com> <1450098032-21198-11-git-send-email-sshukla@mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1450098032-21198-11-git-send-email-sshukla@mvista.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [122.167.202.21] X-ClientProxiedBy: MAXPR01CA0017.INDPRD01.PROD.OUTLOOK.COM (25.164.147.24) To BLUPR0701MB1713.namprd07.prod.outlook.com (25.163.85.14) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 2:u6u23QQlC8z+RBtssoL5nqysDtwsLjdnQrlQl0ACWPubyl7XsMsbv9n2r1trQCe7CsU07gR1+rPhTzNSsL5DPzB7fC0Vq7c22BK6taGEpnKRixdeFEDd/1S1eHGjCv/86+ZBYGefkHtsAbNSsle4EA==; 3:KHoIrWt1O/5C19ld/sA0rS5gzxhpFRETYagPsAmQm1a8HEqeZrgW4SW6VNQYajEf/b13160i1lZyQQL4VMuVsXdJyk4zuM4dC3DpPhH4wwhFJ/vqfqKIOnW9CZV4DKoZ; 25:ROLJK/w5TInm0vGEZKLCrTg5zr8+QiUUGE7Yq3awoDkCo6v0rSMEUSBA7Mk/rkJAMrIJRDyJoUn3Zn1ldBuEjwSRU6FvrbK/nGbVVxoGUfYzNrKDxKseYcXDuCTGzTRxCz0Dlij7Kb8A7SoCoHe0EeTErlWMIGYgL+Sp/Vp6XC0r6cOIe8vZwJzumoMcg7QXXYd6WimK+txq/BkNGwf8W3wuhOol5QnmYmS013x93Q5AAW2oj/+YX+KOqpBAjeLm140kZ5C4bun5ZVWky1qg+A== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1713; X-LD-Processed: 711e4ccf-2e9b-4bcf-a551-4094005b6194,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 20:xaETkNmI2AS/GFiTOjfatl5VTpACTICS7iX3iGMtR/Z2UdSCk5PN+LRqVVewx/VIlnLdV52Z4YlXbShaTzNc1nZx8mDGLltEudoXIPjhNYqFmWM6MPvpzs+xrvIyzNJ6jUiGf6zX1j83DJ7Chn7UJ0adUlVjWLoSBQYtdzxsYljeFnEMhtJQGPE3HdrhCG6uiVGlc1EyifRX2wshmvmLViDobG12HPO9lAhruhD/R0wQGrWrg+i0xVu1zUbgOYVCQUlFDsq18hxITCVA/6qi01ugYYdfea73Q8CelL2pvN3ox+yiYVxaFXP4CcobJVCzXM3aEJbBSm3neGEulvC+ACSQkJirTzrO6l3DIm30qGg6mqEEJba7Zn3vY80jg6vBnetQNDVvwtn18TUngo5Hv/GRT1nxKNCm/IxCDkFY2a/CQHapz3WHsbSYGeOXbHgf6TWbSAMbPxABlr8hPB6CGsOo1beLG2a5AePWsFwwzUa/MOYl7ZUshLQv7g6/QtQCH3oRCIgJte2OEUIAs1kS1H6g8jaJuipHl8qxBVRdQTK+8uU92zT77Dcf1tw4JzLl8jnEosMNidEeUfd+mCBoOORnpAtNIGg7AKjcw59v6JQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:DS3ggdm9jDnoUCntCrqLXaCMsz1vf4uc7LLICO5+xHlRvh45lxhztULAEeeGrvt80DQFNfVPeonpHa7fULBawYe6XsWvPPk7vvkCCMJowkKQbuCx04SFnY1uFapstLJTcAtavPF0W7HX7vHNf27c7MzEEogWELvHY3ZfzL25RMucQ090fxJIJFpO+02pHmHPM0GFAq/zI4BJU6wIVTx9mpaWgTpS1hVoIG06MTBc6TlK/DUAFa5EO5/D6TzrHDsf0vLW3dTOi8AdzFEWaTyD47jB9V+1X+6UdmNZOf3jhMZlKYk+DdGDNmW1KCmjBpAUO9sgv8JS+cruGva40TKIa1NiJqKDfz+0YDliB2Vt7iJ2w2oWRohva+ChTEfaj1xB X-Forefront-PRVS: 0790FB1F33 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(24454002)(86362001)(106356001)(40100003)(1076002)(77096005)(1096002)(23726003)(50986999)(5004730100002)(76176999)(66066001)(83506001)(47776003)(5008740100001)(54356999)(92566002)(5001960100002)(19580395003)(87976001)(110136002)(33656002)(97756001)(122386002)(19580405001)(2950100001)(42186005)(81156007)(189998001)(4001350100001)(101416001)(3846002)(46406003)(61506002)(586003)(6116002)(50466002)(97736004)(105586002)(7099028)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:mRy+ws5y/caESA/spKAyjLwyW8pQWDTTV+k+Mho?= =?us-ascii?Q?UUYdQv/Euy3WYjkJ0PR6YNagcDenXBhfARjY03cIyVJryfsMp2XPLamY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1t0OJvaoBMWwkDBQBLuHGB5dB3lUqQKNQwD4O?= =?us-ascii?Q?PXSFGNWRvoWsy9SPpXYFXQlZbcss3iIbM4t4rjuwESscKwc65bDM4xXH3Tka?= =?us-ascii?Q?DcUFe1MH2w3yRbeDvW6Zin2S4YCbqDx+ewIPm+iiFL0zUQwpBwn1wyKHX0oH?= =?us-ascii?Q?VDmRkhdCaaUkAVhOd7IUbDW92xmlTRQ7CiJ87KxBXAGEJGCDws9ZW6g=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 5:ThHs09StvC98OQdzPCGB24LOw+y3SAOZJ2qay3ZRGvvmMGV2HcV5ycRBCnM6CO1MrknAnmvGD7SCNlczS0MOTyMa4/n3g8105ZbbME/9VKBsYi1q88fdXaEvGHCzU5QZZFkIssBQ64e3f4ofUZmmZA==; 24:dS84OBrhiFRrXp1XkfSOlxihXXHHjl7/XqZd346UbGYRydX6GaE3dKYkH5toXvhMapACutMZfFkWo5Or41mkPaGGeYMAynR5OpLXzaggrZ0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2015 14:44:24.4218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [ [PATCH v2] 10/13] include/exec-env: ioport: add rte_virt_ioport header file 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: , X-List-Received-Date: Mon, 14 Dec 2015 14:44:29 -0000 On Mon, Dec 14, 2015 at 06:30:29PM +0530, Santosh Shukla wrote: > including virtio_ioport header file has iopci bar page_size, bar_len and > device filename info. > > Signed-off-by: Santosh Shukla > --- > lib/librte_eal/linuxapp/eal/Makefile | 2 +- > .../eal/include/exec-env/rte_virt_ioport.h | 81 ++++++++++++++++++++ > 2 files changed, 82 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_virt_ioport.h > > diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile > index 26eced5..1252e05 100644 > --- a/lib/librte_eal/linuxapp/eal/Makefile > +++ b/lib/librte_eal/linuxapp/eal/Makefile > @@ -115,7 +115,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > CFLAGS_eal_thread.o += -Wno-return-type > endif > > -INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h > +INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h rte_virt_ioport.h > > SYMLINK-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP)-include/exec-env := \ > $(addprefix include/exec-env/,$(INC)) > diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_virt_ioport.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_virt_ioport.h > new file mode 100644 > index 0000000..8098eaf > --- /dev/null > +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_virt_ioport.h > @@ -0,0 +1,81 @@ > +/* > + * This file is provided under a dual BSD/LGPLv2 license. When using or > + * redistributing this file, you may do so under either license. > + * > + * GNU LESSER GENERAL PUBLIC LICENSE > + * > + * Copyright(c) 2015 Cavium Networks. All rights reserved. > + * All rights reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of version 2.1 of the GNU Lesser General Public License > + * as published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Contact Information: > + * Cavium Networks > + * > + * > + * BSD LICENSE > + * > + * Copyright(c) 2015 Cavium Networks. All rights reserved. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of Intel Corporation nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * > + */ > +#ifndef _RTE_VIRTIO_IOPORT_H_ > +#define _RTE_VIRTIO_IOPORT_H_ > + > +#define VIRT_IOPORT_DEV "/dev/igb_ioport" > + > +/** > + * Keeping pci_virt_ioport_size = 4k. > + * So maximum mmaped pci_iobar supported = > + * (virt_ioport_size/pci_dev->mem_resource[0].len) > + * where, pci_dev->mem_resource[0].len == virtio_pci_iobar_len i.e.. 32 byte > + * > + * Note: kernel could allow maximum 32 virtio-net-pci interface, that mean > + * maximum 32 PCI_IOBAR(s) where each PCI_IOBAR_LEN=0x20, so virtio_map_ioport() > + * func by theory gonna support 4k/0x20 ==> 128 PCI_IOBAR(s), more than > + * max-virtio-net-pci interface. > + */ > +#define PAGE_SIZE 4096 IMO, We can remove this PAGE_SIZE macro and set PCI_VIRT_IOPORT_SIZE as 4096 directly. It will remove the confusion between kernel page size > +#define PCI_VIRT_IOPORT_SIZE PAGE_SIZE > +#define PCI_VIRT_IOBAR_LEN 32 > +#define PCI_VIRT_IOPORT_MAX (PCI_VIRT_IOPORT_SIZE/PCI_VIRT_IOBAR_LEN) > + /* 128 max ioport */ > + > +#endif /* _RTE_VIRTIO_IOPORT_H_ */ > -- > 1.7.9.5 >