From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01hn0230.outbound.protection.outlook.com [104.47.32.230]) by dpdk.org (Postfix) with ESMTP id 6882E1CF8F for ; Fri, 6 Apr 2018 14:37:18 +0200 (CEST) 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=CpSVfRvO4Harrgodjt9ZMcEfxI01wGy/FdWKxwcIu68=; b=JSfzzljDgL+EGi/J+Wqvk5ONIDiT/1NxrH4GfF08FiIb6cFmPAvtkR78AOCWEEN07sinQqdG9EPQKJkUOWb5T0eQkJIbbNqdMTUXU26c70A3Wd1L3zgrBMxcc6BKbyRDaXK2Rhs+HnJesGihUOYwzEtK2UCCRZJxcWWYYt2yOgg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 12:37:13 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 6 Apr 2018 08:36:34 -0400 Message-Id: <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> References: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3af4fb7b-a64b-4512-6db2-08d59bbb2047 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:RZScSqOywOn8p5YjLUxnx77APaYlCvPvREFFZTVnuShIsDffBhAEgZZm77RZOAh5408TcXCh3MbiC0LK/AzFFecg6VkdbkAZjI5bkPAl03SoOMMvs/SfyTIGS0WVrHvAYJOFD8qkBhWkB+NdIl9cgR05HlJzYb/vAg0uPbE4hsz0EeJMqV71eP/QAFBtl1PWbpttrILlUYpcJl7H87MxAqtsH6aDSJuydVdvyj85ZUlRA8ZcZBmClw3Gtw04JtMG; 25:Cr608s4lg7AO6uoAosusSYtMNSA4XoBRRz+1Y2925VWOebw42SkPU/2EZfvd4O/DC45uTzLS3mmmCGgvI4Sk8/fIx8qHti8I9/TWfqva/qttzi4nxhE+tEOd2uSm4ccUz0PCCgGpl8HEoO3LgSsB1JzSIkUCg6/PZMa9o7fp5mrmOYbUJleUhNnudNkpsLnxJSOCFvcIlYIM5qv4OhdkIMCdIrDXNP8Eg9FAAEy1Dq5Y/BlCgXitVix3GFpIAd/9yx/kKwqQ7IFcUNyBZrpuVQ+bM97T2Hrl+Qlzd0nhUI39jVEPIg2JsnKNFR3rRCCD3jJP3KUn5Vl8M+7WcAVp/g==; 31:FqSrSnsIJBRn7rbsNVjVUIBnuWYS9fRl+GDs+8wL2h1pnzck2M/vEkvIc5+OCq2eQcrx5LnRPboSsCo9t+F0fUjho433kiFLtFTtRSxjYl0XQ0P1g9d2veDaH2qn130kBPe5pv8PPLuMjj1UX4VVSbcCKHUQ+iI9q2S7qECqO+xh8a5+QE1h64o8ZJKkQCGbYUwzPirqHhcj+qry8StA5KxsNyOJIyexbx1uYLWOna4= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:/ew/AADGxiJnfKXRwYVkCmhtR64zSW5hO0LTSKYJuAtzQE/M5R+eShg+5g8nUwB+XYvdhUZaaqVmqntEDYge8VmhNbxEofJqX7jRHMrH+YM5jzvkjaFAZUDUHnDT4QYdIw8yoEq/jaEoyQeLXYqAgzwN63upqKU+pISleSm1/ffDuqoZfD+/EX2HMVDflnTsR0fvOGvrQzwSStxeyE7gh2CbGyTNTh3mjcERd8dpQB/Kr/2bmR7X0unT3ia2ApjTmQMkMhj2ajZqJbd5najLyUgML0fBCeXIFiHExzjIcXyiTSy16WSbq2XcGPjI0emK4UXOpf59YjxeHsJjS8ZAIS8S6Fm8xnoYWmBE4Vpt9R62uP0IbwX1pr19+fTlYqwfUiAbkGGNm4EHkWuYHdfw1y/yx/soTGYXVSTN51MrjHDUXlXTrDxpRRubP535rMN/+VLS6HwhCxU18siF7MbxO7jbkzV7mVHpZbghV+VJJr+C/CrCFlSFG+Z60RdFUUh/; 4:5oXY/8XtcE7D/LOt12VFymOQOYlDZLWDdkUyoI2H4Twi9LVwj+arINa+cAwvM6ZpfueuPsFafyg7n4Q89ubzBKDmqRZEqePBLDgugPQWvHqMDbRXV6fKLxyyHoBPvDcSJ8jaDLE0bnX0yy7IITlkqnlZ6+O7W2mBDhRW++5hSmv9xRKpNu2aMUpA2x/OJueG8X/EDfX/APRRM6ljdFNgD0h9CHcRjIIP4C7XlItBZgUsu7TvXZh82KJUBC8RKPAn56bwuLSrf3fLqooggG9ssgZ2Q6ODePRaEvkftQ1vUdxR+z50tAebQH+LTAjvwMYmlmZCwob8fE5l79ClBPKZkZyFdA0PPIIffsR9OeZEAPcoUTQxKPrF2SyLFBYG//j2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(66839620246622)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(2232076)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(366004)(376002)(199004)(189003)(72206003)(7696005)(105586002)(478600001)(6116002)(50466002)(3846002)(446003)(486006)(53936002)(11346002)(68736007)(2906002)(2616005)(386003)(16526019)(186003)(26005)(76176011)(956004)(23676004)(50226002)(476003)(316002)(97736004)(305945005)(2351001)(2361001)(25786009)(7736002)(36756003)(59450400001)(2870700001)(5660300001)(52116002)(8676002)(6916009)(6666003)(47776003)(4326008)(6486002)(86362001)(53416004)(8936002)(66066001)(81166006)(81156014)(106356001)(59010400001); DIR:OUT; SFP:1501; SCL:5; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxNTA5OzIzOkdHc09DVXZKRXdFWXZBRmZ0QjhpcHd1TVlO?= =?utf-8?B?OTRXWElsa0xRYnA0eVhDYW5ULzFDcWpiam9rdkZLU3FNK3NLcDFjaHlEb2xv?= =?utf-8?B?RDZSQzIwZ0xYcVVYclkyU1c5RUsrc0swNTYzVzVnTVRjeUN2bS81USs1Ulk4?= =?utf-8?B?eUF3M3RhMjhycjZEYXc5V1BtYjV3VjBhYlVFVUxKbnd1bk9jMk9GcVp5N1RM?= =?utf-8?B?RjBEemZ3S2xOVDIzNkc5SGN5O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soft-Exchange-Diagnostics: 1; CY4PR12MB1509; 7:JOo8rRfti6+RAXF6TPKHP/gGiD+qsvZ2xZ9yuY+VQ/kV3vvb/kg++B4DU6DMR8Ko5JhTaVqB3ymmUc48CEtiOYaqXFG+sJWViBtLdDcm+GhfnYA8RnlfkwFRs3NYbdSS+BQIa/QNaIcvFP6oT8VtreJb3uW9ownB1aB6iksoPkjobzFYHcFQptvWpOF3Tn9iQsjSZBJ77XEj9i/OCtz1kkGtJGnqr39WJ4B8gJAxmww7rNZl4kHCCtl7bXuYaopu; 20:TRB3Y6FqrhuEwLSDn3S0iOpGPFFFx55CIvKuZTCu+mcSptQoBrGDNYrG3Fucq8n878LfzLa+0TRA/6PMa/wUugdHdz+IvN+3LwuQvTfFSoqWBz9OpNFSYPVSnaiWxk3ufW/BEMloysJAyGqaBDMHZ4iJ47RWwfFWSqp50iGRuhd+oC4b4LzpyTBStn9uLiEujTtTzppGNeVgQ+ELeXd7XMRpVCL2Tymw08LcueeODkAZitDwjcm5w5ZiP4GUmCYq X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 12:37:13.6003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3af4fb7b-a64b-4512-6db2-08d59bbb2047 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v5 01/18] 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, 06 Apr 2018 12:37:19 -0000 Add ethernet poll mode driver for AMD 10G devices embedded in AMD EPYC™ EMBEDDED 3000 family processors. Signed-off-by: Ravi Kumar --- MAINTAINERS | 6 ++ config/common_base | 6 ++ doc/guides/rel_notes/release_18_05.rst | 5 ++ drivers/net/Makefile | 1 + drivers/net/axgbe/Makefile | 27 ++++++++ drivers/net/axgbe/axgbe_common.h | 50 +++++++++++++++ drivers/net/axgbe/axgbe_ethdev.c | 97 +++++++++++++++++++++++++++++ drivers/net/axgbe/axgbe_ethdev.h | 23 +++++++ drivers/net/axgbe/axgbe_logs.h | 26 ++++++++ drivers/net/axgbe/rte_pmd_axgbe_version.map | 4 ++ mk/rte.app.mk | 1 + 11 files changed, 246 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 ed3251d..1bf7c03 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -349,6 +349,12 @@ M: Ferruh Yigit T: git://dpdk.org/next/dpdk-next-net F: doc/guides/nics/features/default.ini +AMD AXGBE PMD +M: Ravi Kumar +F: drivers/net/axgbe/ +F: doc/guides/nics/axgbe.rst +F: doc/guides/nics/features/axgbe.ini + Link bonding M: Declan Doherty F: drivers/net/bonding/ diff --git a/config/common_base b/config/common_base index c09c7cf..6c7e7fd 100644 --- a/config/common_base +++ b/config/common_base @@ -145,6 +145,12 @@ CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n # +# Compile AMD PMD +# +CONFIG_RTE_LIBRTE_AXGBE_PMD=y +CONFIG_RTE_LIBRTE_AXGBE_PMD_DEBUG=n + +# # Compile burst-oriented Broadcom PMD driver # CONFIG_RTE_LIBRTE_BNX2X_PMD=n diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index e5fac1c..dddd2db 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b/doc/guides/rel_notes/release_18_05.rst @@ -58,6 +58,11 @@ New Features * Added support for NVGRE, VXLAN and GENEVE filters in flow API. * Added support for DROP action in flow API. +* **Added Ethernet poll mode driver for AMD XGBE devices.** + + Added the new ``axgbe`` ethernet poll mode driver for AMD XGBE devices. + See the :doc:`../nics/axgbe` nic driver guide for more details on this + new driver. API Changes ----------- diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 37ca19a..dc5047e 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -12,6 +12,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += avf 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..9d9c8d9 --- /dev/null +++ b/drivers/net/axgbe/Makefile @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. + +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 + +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool +LDLIBS += -lrte_pci -lrte_bus_pci +LDLIBS += -lrte_ethdev + +# +# 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..3591d77 --- /dev/null +++ b/drivers/net/axgbe/axgbe_common.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + * Copyright(c) 2018 Synopsys, Inc. All rights reserved. + */ + +#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..8d7ff28 --- /dev/null +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + * Copyright(c) 2018 Synopsys, Inc. All rights reserved. + */ + +#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_V2A 0x1458 +#define AMD_PCI_AXGBE_DEVICE_V2B 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_V2A)}, + {RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_AXGBE_DEVICE_V2B)}, + { .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; + + /* + * 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; + + pdata = (struct axgbe_port *)eth_dev->data->dev_private; + pdata->eth_dev = eth_dev; + + 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 | vfio-pci"); + +RTE_INIT(axgbe_init_log); +static void +axgbe_init_log(void) +{ + axgbe_logtype_init = rte_log_register("pmd.net.axgbe.init"); + if (axgbe_logtype_init >= 0) + rte_log_set_level(axgbe_logtype_init, RTE_LOG_NOTICE); + axgbe_logtype_driver = rte_log_register("pmd.net.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..fc20169 --- /dev/null +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + * Copyright(c) 2018 Synopsys, Inc. All rights reserved. + */ + +#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..d148701 --- /dev/null +++ b/drivers/net/axgbe/axgbe_logs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved. + */ + +#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_PMD_DEBUG +#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(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, axgbe_logtype_driver, "%s(): " fmt, \ + __func__, ## 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..b26efa6 --- /dev/null +++ b/drivers/net/axgbe/rte_pmd_axgbe_version.map @@ -0,0 +1,4 @@ +DPDK_18.05 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 2585908..005803a 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -137,6 +137,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += -lrte_pmd_avf _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