From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by dpdk.org (Postfix) with ESMTP id B3C718E8D for ; Mon, 14 Dec 2015 17:17:31 +0100 (CET) Received: by pacwq6 with SMTP id wq6so105781688pac.1 for ; Mon, 14 Dec 2015 08:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9WjjSZyP/0wSQGKPV2B5Jf9k0LXnwB5mec5z4NHBD0U=; b=Ghp/Vl/Fywb+/ZW7tPLKkLEY2sGj9U0Cyce/kf62AMhNGGdDSVsHLKnCkWIqL0YMB8 QpL11I8a/mGzdsvB53iCycYu9pDsOI94FO1JbSdOS7RIUifWaWNOxDuVOZ0IFiDwsNiB SWFbhdEh1Qaw5F+NvT4AajCDqDsIXeSVDS3nDrRJFDz/R1mggB9S52UQaQJmGbctoiEh E3cvOpWDZ1UqjCSSmbs8TYeb7RUMeZffq1DBwA0RXEUzsE9aut5DhqvSxmczJPQK2OLv vXmMJ6bJRf5bEayWUWN4CGwImQ4NZA5YjeKgocHBwR+g2wXzgLf9tuxjHNHUsXNw2NjI cNZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=9WjjSZyP/0wSQGKPV2B5Jf9k0LXnwB5mec5z4NHBD0U=; b=jL0sD5u6zW/RbN74xyNOEpcdVVlQRV/bDO8Ty4H62G9+cOL1OLjz4NSgjK4KhHJzbh OvwspYBPkt5MENfEjwp+6y6k38V/56ogE/ON4UMnCvsjHM11pYe/MaBw3PNkCAAqLl7Q f1J/0wXG7swy++eCycoEvM796AUneZhuFYb5/pCdaTNSPVKEp1gS0rwb0N4O2xEbqYae dZ1JHhwew/lUx6YMeQjBR8EZ9Mdv9TYOyNOQKKqtJ9JbustD1MKnARTVbdXlUCbPywDd Lv3Y3JbE7diCDj7g3qr/KryYWFs3199QlW0bdRDeO5PWDHgeH6i7TJS71jcohG8PaJDB ic2g== X-Gm-Message-State: ALoCoQkl0BxHnLbqwuaMHztLT4g3NFdQzBVPMVtbY1s44R2XuMKvaxzLWHgtMo/HitHfbo/zxR2XXS9Y9znWPO2olFSDbzkiOe2oTL6+0dOMB4S9i6kvNaw= MIME-Version: 1.0 X-Received: by 10.66.140.79 with SMTP id re15mr45717812pab.127.1450109850139; Mon, 14 Dec 2015 08:17:30 -0800 (PST) Received: by 10.66.13.233 with HTTP; Mon, 14 Dec 2015 08:17:30 -0800 (PST) In-Reply-To: <20151214144356.GE30309@localhost.localdomain> References: <1450098032-21198-1-git-send-email-sshukla@mvista.com> <1450098032-21198-11-git-send-email-sshukla@mvista.com> <20151214144356.GE30309@localhost.localdomain> Date: Mon, 14 Dec 2015 21:47:30 +0530 Message-ID: From: Santosh Shukla To: Jerin Jacob Content-Type: text/plain; charset=UTF-8 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 16:17:32 -0000 On Mon, Dec 14, 2015 at 8:13 PM, Jerin Jacob wrote: > 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 > yes. >> +#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 >>