From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0080.outbound.protection.outlook.com [104.47.34.80]) by dpdk.org (Postfix) with ESMTP id AA9F11B025 for ; Fri, 5 Jan 2018 10:52:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cpo+sjvyB5rLQt0xrx7xtsBrjmGsuL3tMdPQnXuMly8=; b=X3zrfJ+Uo/54CX8JyH3O0rwFgzTAmWn2omAJEYtCWcZJl+s2XtjHQ8HuNBh8sepPPpMjb0ZWSHMTQ1jvn41JJ4JiH5eQAs38SWguqdwbJxKcxteClfRZRtCYFehZVzHfLQxHxiDLp7206UhJ+r5Ev5sF34ijK2WWVbqI4ZWpugc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:52:47 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 5 Jan 2018 04:52:03 -0500 Message-Id: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.221.17) To BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 534f8da1-721d-45af-fd01-08d55422143e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1506; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 3:jmktIeusyzmvMzkeh1/ttNncbk+uNkrtPNHdZwBU/+6ymM/cvSgLWJfp+GeeSVCxl5ud8clHFJRnEAk436S4Yx1Zd55fJXwzJqjZ16rq4ybYWzEbtuC3phpXNmVScueIePy2sbeLsUG/R+HUOH+N3NalRaJvOD5PCgR+jgQRX3FmIbbdgClDvscOVgfVrKrK4Yi0iO7r8HND2EK/8aw0WbOhnT0kVR+H3IcIOO1/j7yNLaXNJmipHiAf6i42VVXj; 25:mYi+Q964eOmn2dvxvhnCSN84HfB7m7mfPJT1qBF/plN+6oQAa1mQEL6yVYl7JLOkQijYHbE+SQmd7KsuO4DBHU0domhH6Xn6h/XD7F5Z0bUh823dzZ77KWMQx+5CBTy82K2XVSH2AHjXlZgEaxEGp0kWIEipTzAcAbLRdGDB/1SBadH4TTvWyoqWmbDavI6aRIXn9Y52DczCwspMiFpc9F9KkCli3Bbt69ZgW4aGxqxthFjwGFPAU29y6A/Uvs+zFsGluxCwsuAH2sRqEaeIGOKbsn3VbsUrnPHkjVvjc6Pr9BNKLijNkQKCDSQ4iqClehl28pOP76kDb4TE6cZoPw==; 31:8jf9zVgv7U62C03Xp8llLkykAmhfKbdtwEq1o6vwBeQMmrOvKqgh1fdBUWtUFTE3UIjGmY6siuMl7rbU9RiaoUj3jFnP23XQV0jfzqaiAVKgNqFa81hp++ll6BC6TPdHjBm7AVwv2rmkb/L0QSWA5RCwDeKzIRSfIcE6uaz65nTVZ2XWHl6QqQkE7um/jysTefylyxyG+vRGj8x0S3PmQlGF7dLt2IBxXAVkkEOaK/0= X-MS-TrafficTypeDiagnostic: BN6PR12MB1506: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:JBjLCuIgg0t32OEnA1SGjFH+4cxj2W/CA61/q4tliGysRaT7e23cPXm7l3lZ1Ctxv3mGz9JkB9e7oll8BHbTN8q/rgo5joFTGPRcJY/R+//C/YVKgHjmobKstWwy2+v1F1zcp2av1PPM5zhqYU2/i3oi+I5tnwPyJF+vhkRRWV24+1nQKhX9Osu9+QpNIVJ59faYKKXKNbe+pxQN7CrKWUi4N+tHuHpu3ZlfRW8b7y8d93aY3Z3rh5JyiMraWk7Pw3OtYzH/PT1alHyK8PZLm/jDNHB6IpW/po1bypLIdndwpfAMA1teWKxgY2Tq5OXzHLkLacWkZbkHRojqVMsV7yWJ9JJF7SszYiZbnEYsJcr2W5i8dLJSVsp4Hr0TrocY2nZS2YMZ9Wy2f8wIzLpekqEvQQp1zqQPgJrNcTLJY5OkzKHR7XlRHPEKGeNw6BQpZ2nSJ2muCsd7U6oJNZPyy+RSFgGOFM6bTgO/k12TJsi+QBa1FCxet9rCnjd5xe2r; 4:WRsvYPsi29ikVEuhDHtloRbTNAVWL6T0Du8gsligxM2uzErf1XHZ4gjUHfa7im9fO+AMQ1+Lp95+q7O69eB7QfDcF2GnD8p8W+HqF2SqiGl1bxk1ivC6HFxmIi8EUCDsEeAKXgkQCuGGCawubxtmwGg5FEqbeBGNgfzTsQL8CpQEs+cOD68gXypVFhxaDkIgxna7Ooj+IJ1L9Q9EdunzABa6IGOJPyfAGYWphN1KR3r7co9VT92hT/AB8S6BD3VP+SStwiZpTDXdM+BbX/tPiQem7enicDqkX1dlGqCjn1xU8C1raK4YlyG2EJSMGixXFTwgAaZ7sa8OaXfxfpM4CWOKicG05rnch218tBOQBsqI57KI4e5OGYIxA6rg99Ep X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1506; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1506; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(199004)(189003)(105586002)(4326008)(53936002)(36756003)(68736007)(50226002)(7696005)(8676002)(51416003)(52116002)(25786009)(3846002)(53946003)(6306002)(106356001)(8936002)(2906002)(53416004)(6116002)(81156014)(2361001)(6486002)(81166006)(47776003)(97736004)(16586007)(316002)(66066001)(305945005)(48376002)(2351001)(478600001)(7736002)(16526018)(6916009)(2950100002)(6666003)(86362001)(59450400001)(76176011)(50466002)(386003)(5660300001)(575784001)(72206003)(2004002)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1506; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1506; 23:Tb01Wz4CVopwHoKlZmce7Qy3+PQsF/ZlNC09OIY74?= =?us-ascii?Q?kErwlv65jumDZdbPpzEmt3ZhJflltNLKP1Z9XJ4rqEnk4NdqGF9XmqSdCEeC?= =?us-ascii?Q?9fmtalC8x9xBS7uANDChpOf6Y8Sj/26pltYzaz7NFkjkeYGg1S/45fCpqAlB?= =?us-ascii?Q?BYbSeMs//BF5Drx3gCgB9Yop0O0Vhn+cGpL4V4LJSSfClpZS0178TXyHlzdy?= =?us-ascii?Q?W0JjFrGtq+zNL9I/QGccmb/eKqCT1h7ngnSjiV3D3sPLSRyYqwNqAu2NuVBZ?= =?us-ascii?Q?5GEonOmND9swlpLKAuLUrZg5LKC2ztHdqqyPICzAatMBvurwiW+329YK9B9f?= =?us-ascii?Q?qBb23ByCwnexS2pFqGBOCeGrL74/hwryzzJGMudQNDd6Z3jWyAIrTFQbmftO?= =?us-ascii?Q?jAW/8+7GBM3RJsmy5J0nGJPuKljisjqp3LrN0vbKxKTK05xPw0zcrxCz58BJ?= =?us-ascii?Q?UkJtSC/F/ItKWraLBRD+J7Uf/PTmQtIgyqPsRDwsm4x6UwiRFs2WkEBWGmrr?= =?us-ascii?Q?hLl6yy0CSoi69pdIRQ0kmtDNgU2qOXUq5QCa6G3FERd/oAvEfpTtoQi207O+?= =?us-ascii?Q?m9iYDzy8B6wSFUi7Vlu87TbhlIfqGW+y+97ZxXbXVeJtQKm5vnLjwYoGuXmd?= =?us-ascii?Q?G50TLDkOp+VuiFz3F3c+qVlQfCBsTdRVnmuEuupqHeymjxZJPL/wVNrQL1Z8?= =?us-ascii?Q?o6P4rHkzHQz18OcwwzD1Q21XA8ceDnFHh1P+YbMKjFiFdrSR2FIdYgKihlAb?= =?us-ascii?Q?MfZq+eiCFgEp2cbif3btDwhMXUFQzqXBDc57sNwdeOoTmRbrGoglnLqrEtAz?= =?us-ascii?Q?itaqm0qPSuEKiR/6z7mJV7ESpTZAibC8iOpEm937cnzMpwqVjtXZOKuJEogH?= =?us-ascii?Q?Ffvp9SEDJMTAZtDS1hkReRe74N7tywaSOl/7e3mvAXz07zgLrV9Sc17W4cpQ?= =?us-ascii?Q?AnjVYifCz0mFgGPJafTgaxjJ9oUzCyFgxnUkfgXFS5o4JAFkQqF1pnO1TPt+?= =?us-ascii?Q?DMIO+/xeAxfWTg2Dlwy01NpYWCpW5Kc5VI2BsVTTtymDDXM+UpU2ht9ZykQn?= =?us-ascii?Q?BFd/ye/TZbO9Z35QUQtTyKlEXY+OoPqIdu3yN0UKqvN6PqOJFkqDfOd9X+rv?= =?us-ascii?Q?+rLqJP+bzcpVDSKIUMoVJVhBF+2s7geDy0yPmvF/WtWYGEczYeiFxDA3KwpC?= =?us-ascii?Q?8fNzXm5oh+4/It+BiUaOxbzhUinXVMFza5gxXa7wJ3rvMKiAcPGngYw/L28h?= =?us-ascii?Q?EpwYknQrQIlTQ6m8aA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 6:2ZwnZGTryeOvWgf5Nhn/XbOKfbR/lXF4Cc4PD3DDLE3PRk6hI+/e/gx9sXJuYkNuBXdUXOm2GBVRaeepRyfHEwi6LUyABu8Jq3e6Vo3R/lmPCOPKVcelCP4tWiebhhhQsMFBey89Fcfj3a7gDorRtqCQ3rqzTRlOvVdST2s67FCHAw6V0DtHDxV72xa11DzaOcbERwjq2gkRT+zVoaMPg2TyEyBJGdpfcSzCy+mwvdmqEPICvz18W7Yso/3n+dK9fTOxAaQDX+EiwzBBx+mhBxqwatU925uMCkXoLAlXkOI85NNYSsw9fjonKP0BFI6ry58/jFpeCIpQvd7anV8KD16TqiIMqknLdqyutJqPdaI=; 5:mcx5TT4jWrbrtHf5PoxdIcEVdjAITPylyM5VRKpUqQSznJ0dC5/TQz+sFQ4FWe1aif6Q/f8RJsW6SCYGaxQwiPv3alHZQTBU9LyCtoigec1IccIWrYKIizD/8S4xLs7vtKb9Ur3bzTitdTF4qrd+WhIVN919R87F9v1/D7zNFtk=; 24:NZtaqRjzujXTngrjZfFM/GviLVoztD6VPpWeFsZbtsY3TFN6OAEmOeCXG2OyfU+cSTXIIOnrgXoedQLlfrsXReS+UBTm0MVBLX4QVPaPaC4=; 7:zH1t1G608UYrReby1WOv+jwdc+lXk8L8xNtKjXKrDTfTmufb49sDr8mX/IEpSKiZzj2TwIwwcfD+fQ1v/7oSlRFlSyOGUtosMvnExj9vYQTNFhuKr9gfS+SrY5WNpG2kKrpnRT+NLvNSXNBt4ZMfblgDNDATDVrOtFope+SLRDVr/+6k+ijMf9zhDC3zrb3xETyL8kvXE+c3Id3N64WvRpCkVEmISqGnII7iKc45nZ0ozQCoHgqIwRIVZke8lge6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:W6Pw56HjTrB90R2sXHGqTN9iKyUrgGvPuZtCvSp+4bcK3sTjpCUUr8achkg2CHnUdXjys03GDi8Tzohat0IXwcDqREd0/mIS5dlcMUq0DwDZ34datMBSxc06isbrHHeWXdglzxvWQwyPLSCEtOjAx39yB0yYknrZEi0MI2jKAB5wmmJ5G7eDCT0hU7zo3XyeQtErY2VY4x2Xb/ZB82eogG1Wr6qN45wPvtc3vYl1o3/pIMOOLRdtZISQzAMs0j3c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:52:47.6992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 534f8da1-721d-45af-fd01-08d55422143e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1506 Subject: [dpdk-dev] [PATCH v2 01/16] net/axgbe: add minimal dev init and uninit support 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: Fri, 05 Jan 2018 09:52:52 -0000 Signed-off-by: Ravi Kumar --- MAINTAINERS | 6 + config/common_base | 6 + drivers/net/Makefile | 1 + drivers/net/axgbe/Makefile | 146 +++++++++++++++++++ drivers/net/axgbe/axgbe_common.h | 172 ++++++++++++++++++++++ drivers/net/axgbe/axgbe_ethdev.c | 219 ++++++++++++++++++++++++++++ drivers/net/axgbe/axgbe_ethdev.h | 145 ++++++++++++++++++ drivers/net/axgbe/axgbe_logs.h | 152 +++++++++++++++++++ drivers/net/axgbe/rte_pmd_axgbe_version.map | 4 + mk/rte.app.mk | 1 + 10 files changed, 852 insertions(+) create mode 100644 drivers/net/axgbe/Makefile create mode 100644 drivers/net/axgbe/axgbe_common.h create mode 100644 drivers/net/axgbe/axgbe_ethdev.c create mode 100644 drivers/net/axgbe/axgbe_ethdev.h create mode 100644 drivers/net/axgbe/axgbe_logs.h create mode 100644 drivers/net/axgbe/rte_pmd_axgbe_version.map diff --git a/MAINTAINERS b/MAINTAINERS index f0baeb4..4af700e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -347,6 +347,12 @@ F: drivers/net/ena/ F: doc/guides/nics/ena.rst F: doc/guides/nics/features/ena.ini +AMD AXGBE PMD +M: Ravi Kumar +F: drivers/net/axgbe/ +F: doc/guides/nics/axgbe.rst +F: doc/guides/nics/features/axgbe.ini + Atomic Rules ARK M: Shepard Siegel M: Ed Czeck diff --git a/config/common_base b/config/common_base index e74febe..4f6ab7b 100644 --- a/config/common_base +++ b/config/common_base @@ -445,6 +445,12 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_DRIVER=y CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # +# Compile AMD PMD +# +CONFIG_RTE_LIBRTE_AXGBE_PMD=n +CONFIG_RTE_LIBRTE_AXGBE_DEBUG_INIT=n + +# # Compile the TAP PMD # It is enabled by default for Linux only. # diff --git a/drivers/net/Makefile b/drivers/net/Makefile index ef09b4e..986724a 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -39,6 +39,7 @@ endif DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += avp +DIRS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) += axgbe DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe diff --git a/drivers/net/axgbe/Makefile b/drivers/net/axgbe/Makefile new file mode 100644 index 0000000..c8a1e87 --- /dev/null +++ b/drivers/net/axgbe/Makefile @@ -0,0 +1,146 @@ +# +# Copyright (c) 2017 Advanced Micro Devices, Inc. +# All rights reserved. +# +# AMD 10Gb Ethernet driver +# +# This file is available to you under your choice of the following two +# licenses: +# +# License 1: GPLv2 +# +# Copyright (c) 2017 Advanced Micro Devices, Inc. +# +# This file is free software; you may copy, redistribute and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or (at +# your option) any later version. +# +# This file 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# This file incorporates work covered by the following copyright and +# permission notice: +# +# Copyright (c) 2013 Synopsys, Inc. +# +# The Synopsys DWC ETHER XGMAC Software Driver and documentation +# (hereinafter "Software") is an unsupported proprietary work of Synopsys, +# Inc. unless otherwise expressly agreed to in writing between Synopsys +# and you. +# +# The Software IS NOT an item of Licensed Software or Licensed Product +# under any End User Software License Agreement or Agreement for Licensed +# Product with Synopsys or any supplement thereto. Permission is hereby +# granted, free of charge, to any person obtaining a copy of this software +# annotated with this license and the Software, to deal in the Software +# without restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished +# to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" +# BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS +# 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. +# +# License 2: Modified BSD +# +# Copyright (c) 2017 Advanced Micro Devices, Inc. +# 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 Advanced Micro Devices, Inc. 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 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. +# +# This file incorporates work covered by the following copyright and +# permission notice: +# +# Copyright (c) 2013 Synopsys, Inc. +# +# The Synopsys DWC ETHER XGMAC Software Driver and documentation +# (hereinafter "Software") is an unsupported proprietary work of Synopsys, +# Inc. unless otherwise expressly agreed to in writing between Synopsys +# and you. +# +# The Software IS NOT an item of Licensed Software or Licensed Product +# under any End User Software License Agreement or Agreement for Licensed +# Product with Synopsys or any supplement thereto. Permission is hereby +# granted, free of charge, to any person obtaining a copy of this software +# annotated with this license and the Software, to deal in the Software +# without restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished +# to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" +# BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS +# 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. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_axgbe.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +EXPORT_MAP := rte_pmd_axgbe_version.map + +LIBABIVER := 1 + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) += axgbe_ethdev.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h new file mode 100644 index 0000000..168dbb5 --- /dev/null +++ b/drivers/net/axgbe/axgbe_common.h @@ -0,0 +1,172 @@ +/*- + * Copyright(c) 2014-2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * 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 Advanced Micro Devices, Inc. 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 + * 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. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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 __AXGBE_COMMON_H__ +#define __AXGBE_COMMON_H__ + +#include "axgbe_logs.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BIT(nr) (1 << (nr)) +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +#endif + +#define AXGBE_HZ 250 + +#endif /* __AXGBE_COMMON_H__ */ diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c new file mode 100644 index 0000000..0b7894f --- /dev/null +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -0,0 +1,219 @@ +/*- + * Copyright(c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * 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 Advanced Micro Devices, Inc. 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 + * 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. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + */ + +#include "axgbe_ethdev.h" + +static int eth_axgbe_dev_init(struct rte_eth_dev *eth_dev); +static int eth_axgbe_dev_uninit(struct rte_eth_dev *eth_dev); + +/* The set of PCI devices this driver supports */ +#define AMD_PCI_VENDOR_ID 0x1022 +#define AMD_PCI_AXGBE_DEVICE_ID1 0x1458 +#define AMD_PCI_AXGBE_DEVICE_ID2 0x1459 + +int axgbe_logtype_init; +int axgbe_logtype_driver; + +static const struct rte_pci_id pci_id_axgbe_map[] = { + {RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_AXGBE_DEVICE_ID1)}, + {RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_AXGBE_DEVICE_ID2)}, + { .vendor_id = 0, }, +}; + +/* + * It returns 0 on success. + */ +static int +eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata; + struct rte_pci_device *pci_dev; + + pdata = (struct axgbe_port *)eth_dev->data->dev_private; + pdata->eth_dev = eth_dev; + + /* + * For secondary processes, we don't initialise any further as primary + * has already done this work. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + + pci_dev = RTE_DEV_TO_PCI(eth_dev->device); + pdata->pci_dev = pci_dev; + + PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x", + eth_dev->data->port_id, pci_dev->id.vendor_id, + pci_dev->id.device_id); + + return 0; +} + +static int +eth_axgbe_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) +{ + /* stub function */ + PMD_INIT_FUNC_TRACE(); + + return 0; +} + +static int eth_axgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_probe(pci_dev, + sizeof(struct axgbe_port), eth_axgbe_dev_init); +} + +static int eth_axgbe_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_axgbe_dev_uninit); +} + +static struct rte_pci_driver rte_axgbe_pmd = { + .id_table = pci_id_axgbe_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = eth_axgbe_pci_probe, + .remove = eth_axgbe_pci_remove, +}; + +RTE_PMD_REGISTER_PCI(net_axgbe, rte_axgbe_pmd); +RTE_PMD_REGISTER_PCI_TABLE(net_axgbe, pci_id_axgbe_map); +RTE_PMD_REGISTER_KMOD_DEP(net_axgbe, "* igb_uio | uio_pci_generic"); + +RTE_INIT(axgbe_init_log); +static void +axgbe_init_log(void) +{ + axgbe_logtype_init = rte_log_register("pmd.axgbe.init"); + if (axgbe_logtype_init >= 0) + rte_log_set_level(axgbe_logtype_init, RTE_LOG_NOTICE); + axgbe_logtype_driver = rte_log_register("pmd.axgbe.driver"); + if (axgbe_logtype_driver >= 0) + rte_log_set_level(axgbe_logtype_driver, RTE_LOG_NOTICE); +} diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h new file mode 100644 index 0000000..5f8931f --- /dev/null +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -0,0 +1,145 @@ +/*- + * Copyright(c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * 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 Advanced Micro Devices, Inc. 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 + * 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. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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_ETH_AXGBE_H_ +#define RTE_ETH_AXGBE_H_ + +#include +#include +#include "axgbe_common.h" + +/* + * Structure to store private data for each port. + */ +struct axgbe_port { + /* Ethdev where port belongs*/ + struct rte_eth_dev *eth_dev; + /* Pci dev info */ + const struct rte_pci_device *pci_dev; +}; + +#endif /* RTE_ETH_AXGBE_H_ */ diff --git a/drivers/net/axgbe/axgbe_logs.h b/drivers/net/axgbe/axgbe_logs.h new file mode 100644 index 0000000..aaa8efc --- /dev/null +++ b/drivers/net/axgbe/axgbe_logs.h @@ -0,0 +1,152 @@ +/*- + * Copyright(c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * 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 Advanced Micro Devices, Inc. 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 + * 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. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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 _AXGBE_LOGS_H_ +#define _AXGBE_LOGS_H_ + +#include + +extern int axgbe_logtype_init; +#define PMD_INIT_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, axgbe_logtype_init, "%s(): " fmt "\n", \ + __func__, ##args) + +#ifdef RTE_LIBRTE_AXGBE_DEBUG_INIT +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") +#else +#define PMD_INIT_FUNC_TRACE() do { } while (0) +#endif + +extern int axgbe_logtype_driver; +#define PMD_DRV_LOG_RAW(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, axgbe_logtype_driver, "%s(): " fmt, \ + __func__, ## args) + +#define PMD_DRV_LOG(level, fmt, args...) \ + PMD_DRV_LOG_RAW(level, fmt "\n", ## args) + +#endif /* _AXGBE_LOGS_H_ */ diff --git a/drivers/net/axgbe/rte_pmd_axgbe_version.map b/drivers/net/axgbe/rte_pmd_axgbe_version.map new file mode 100644 index 0000000..eabc9c8 --- /dev/null +++ b/drivers/net/axgbe/rte_pmd_axgbe_version.map @@ -0,0 +1,4 @@ +DPDK_18.02 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 6a6a745..5cec654 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -120,6 +120,7 @@ _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_STACK) += -lrte_mempool_stack _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += -lrte_pmd_avp +_LDLIBS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) += -lrte_pmd_axgbe _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond -- 2.7.4