From patchwork Mon Dec 14 13:00:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 9536 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 E2B4191AB; Mon, 14 Dec 2015 14:01:16 +0100 (CET) Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id 1229B91AA for ; Mon, 14 Dec 2015 14:01:15 +0100 (CET) Received: by pfnn128 with SMTP id n128so105340122pfn.0 for ; Mon, 14 Dec 2015 05:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=faMz8xVelF9CAyvCxiuCSkAyRKWJRozuy1FPKNSnJK0=; b=eib6p2gX82nkxjpB3hdj/Sw6exNJ3nxDbBlulz0OLn1fRiiPTOqqn39lm1yEd4GmCW eVq/haO+HxJg7ly3eS5NeVSmtuYOKYKniDvk1rY04juffHF3di8kdHMqvwXS2NuDyUxf /bwnCovOGUxkUym8agQ2s/ezJbjeYyw/tV/GcqkUeRiqGG9DzPuMUcLH/pcX9ZJLrx3d espo9CqnpPHXeIaRF7lFLkSVDsCEcVn3Z1eqRQfC119IV3TJ3Hd0cU1mHCLxgYhD9DmP hKr9ezOGSkYuHcTrBjQT+P/jTyMg+xP3kZECzJRFaoz3K7ppx/SSWmpPpXuomEV0/qRY e1mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=faMz8xVelF9CAyvCxiuCSkAyRKWJRozuy1FPKNSnJK0=; b=Jlc8dOibQeIaza67R1uJDzCxTtsq+9vGpC+ZuJYm1pYt0xwgydH6OCtJ6icEVoTZrL S0oVNjLIFia8ZCIFb+rXj7N1dUZg+B9Kcj41oIOtR1qb7N2lryxvFVKy3xTeZFOzxU6E V8gSMQNzywPNzZgMsfeIUCGZrp+mX+YQlp3CjeM5U+1wjA1despMcr87P2T5QMZDOkSW Je6kD4FzrbQjVGn+oe6v5eKf2R1Tv3SDUXGatrWUKaprzcVbxBnEK51kWMJLmP/cm+3z NC7ra9BjyKR0RKqm5aSObEzS9NkfPz02jprEc6LP7ueWXkGMkQ5dZCVWYGlg8xomF/Go j2yA== X-Gm-Message-State: ALoCoQk30RQW4c23ray7+ekjR4uYGvR1ssPQCLRraHd5eK9u4Ox5QL8XdP5MVtJTI1NZIse0/q3dgHce7NpwkuhTkK5SeJ39HQ== X-Received: by 10.98.31.216 with SMTP id l85mr22614343pfj.132.1450098074388; Mon, 14 Dec 2015 05:01:14 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([110.172.16.5]) by smtp.gmail.com with ESMTPSA id 9sm42506405pfn.51.2015.12.14.05.01.10 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Dec 2015 05:01:12 -0800 (PST) From: Santosh Shukla To: dev@dpdk.org Date: Mon, 14 Dec 2015 18:30:29 +0530 Message-Id: <1450098032-21198-11-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1450098032-21198-1-git-send-email-sshukla@mvista.com> References: <1450098032-21198-1-git-send-email-sshukla@mvista.com> Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 +#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_ */