From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02hn0208.outbound.protection.outlook.com [104.47.36.208]) by dpdk.org (Postfix) with ESMTP id 1DB311C90F for ; Thu, 5 Apr 2018 08:40:14 +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=GY53XeGIae/7YF6KGmJudxMt5IAtrlwEAwoOPfhhJc0=; b=bv6Yb6kZqoFhgSUjCkoqwq2+rh+wp0c0IKBSsdprsvVjb0DKN1Mr9ABISt2PP6IVKeG818qmp1rnaFG2CKRaktycqFBZSP5zmNXBUINMxF2Au1KIRdWrUpzZ4H/qOwJXnDZ3HMvT571A0GqY+1PhM+xnpE688vBPUagZHxWlRY0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Thu, 5 Apr 2018 06:40:11 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 5 Apr 2018 02:39:33 -0400 Message-Id: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584954-130575-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: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::26) To BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 374b36ca-012a-4481-ccc7-08d59ac0155b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:b7Y9f4eKRFo9x5xHVZIS/IXOEFbA0lRKf4vBn4d7JER3G2RLeRTCapqlbzu/uHEgzcIH3j6ppy+UVey3zgMtZFWG+Q04CWFNFLLDRHvkpIeMC2MJWuDH+2oIW2a5Sk+Ht77vmO1qUDjEZTSyRnlmeTMWDqrsJciDuDYJH8D8JUsLwwf0zqNIsov3CXBRVrWUvboyu5xhBm6R8xB9cRrpfM0wyWzGrRxQGxH5E/yDTFPySxN/weG1sUBnY6eePFFd; 25:u4WiXY8k/0j+CRA9By4LGe8cQDXUDup2wXMgd3A1S8emLTXKdcUle3NSztJpMiwSOFVj+8JiOoVO45ObVcJQAm2d4dKz1EB+KLad6tFDjJy46i3AUyj6HxaJllPjXWfhg4eUUfeVeDlpLtlEQBenkoznfgwTNXe2FLyWfADlfq1BRNqaMk6hC1Jh0yTKTW9LKxJ9RfrCQCw28Wyl+kq1SByxn1xsAfEiO0bZUMhvr8Wgg6cuJkk1WdTtnS7Ht0bEh2IkAosPtr7MaKpjIUJGmO0iZ1YNuPHnYrcX6DfHll/Fx1rRV/gGjibDKn4AM8/6W8KVuraCKRlBYoFiRBaqwg==; 31:ttaqnd/69s073OGSmmrJaEpBUCr+gfdA+9aS1AhtzgXxcRadavEoUYB1WT42mx3k5co1LWrB/sk/9zvhJ8DXFYu/SL6v0n9YLuWGqnTuGm4rQc4fghmmWZPFhr5wmfEHFGGQUdb9cpFLFVOl518FKNgFmjFmBGym6UMYpKmgzc4NWp13Po8AOA/X+STQKK8UktntYovzPfzWS6PKr9m06lugBstyfvfzAt205ko6w1k= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:PvlU0zcgYeAJcII6ewr5TTJrNHSj1f4jQ7r0Ag3YZPUoKx6IbRINLoFqsTRcb49KC3BLPx04GDF0t33YBqfU6PMgREES6FjpLN3q6oIViCxBv+ieDrlYlJwAzwXd/fOShOJyRdXIBAsZRyQO2En+HfF8nISMxeWt4a+h9LVkOCNmVwOd8lsgt7AfVyUXWflKGYiOTZsWxXKv9+cRUwgEMysKqD+Ey4EdGiHZH1Dj5RBUN39j0p6zDqSIFvi+KSEGSIzl64DH9tD8QAICqZYuuJOQRxUBjFQHs1Avwkvp3ApusM1Rz/GWeiXjUe90dFoOTPtJggbx571Jzvv+qWSA2WhcsIyXtNgkoTyXkYDz6q8WU6Mf4ji7lEgk6PTOr8LQfR0TPLyJdo5SQkXQO8ZvxGwSocYSd5RlrYwsreX3SpZF7gVBhuvZIAJkB31hnuLMAQE0rqlhsJ128yDDOmcXrc7avC3YqoETsaueDjjcg1WPa5OK2aiapoJlNxL4SWLz; 4:73A4Zs/yEazWzI7gIsQKlo/VT6a670RutC6Zx8yCv8mINY7WfWU0MO88MLHPmwvBfXu3lDS5l9pvsDAAoFXY4CqDuG5i9CDEKFMAUWZvI4bv4TVN7KRFTdSw3zaNaRTdsIZR3WwBcImwoMVS8ppo6b07eKDQxBKrBhZ3SaxlQV9ruAOIv4Lf5U6sJN9WMMD5438SpVuCAxfjHn+x/X2jLReHkw1XxY6nHbahm5toFbKY4Yibx/bYqClcWhBYP7ly/MAlvAMPnkrVmXm3Gapc+JpPuGpQ5H8xXonB8Yz3xPNo6oxR9iWq1NYJYM9GXOV2S2IGItV8yIavWmcXGdebxt+WLePThROrxaECUN+wjtMdrPn8vbOZ8EhrmjH5lqsA 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)(8121501046)(5005006)(3002001)(3231221)(2232076)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39860400002)(39380400002)(199004)(189003)(3846002)(476003)(2616005)(316002)(446003)(956004)(305945005)(7736002)(478600001)(16526019)(6486002)(2870700001)(186003)(76176011)(5660300001)(59450400001)(97736004)(2906002)(6116002)(486006)(386003)(26005)(50466002)(11346002)(25786009)(8936002)(86362001)(50226002)(66066001)(47776003)(23676004)(2351001)(6666003)(2361001)(6916009)(4326008)(81166006)(36756003)(53416004)(68736007)(7696005)(8676002)(106356001)(105586002)(52116002)(81156014)(53936002)(72206003)(59010400001); DIR:OUT; SFP:1501; SCL:5; SRVR:BN6PR12MB1505; 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?MTtCTjZQUjEyTUIxNTA1OzIzOmRneFNpYmhWcUZQR2QrRDNCMzRTbTRhM0dr?= =?utf-8?B?dWZIV1ZIRFpWTjlERHFidXZqREVJRkI3bncwZWhqaTNodXM0eEVhTkpQdDdm?= =?utf-8?B?ODdvb2hzcloxUlRnMmRjNUx0VllMb1VOZHh5M3VqT3BTWko4dUZqVVp5cTdM?= =?utf-8?B?UzMyK1VaN3JXbWhmUTRGUjFWUjlhUXFQYVpOZlNSV25DM2dyTlZaV1lzc1Zw?= =?utf-8?B?ZUFxSlBQS0N5V0xuSTROczlQbzlVbElwK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zcq+3HO/RkStTS2e/m3YHQi0w2cOManavap3yS02uhTKjVTcTn9QYjf1CmF4Wq/4ghXwTgxld+pDanwuzyra/HamkPnA/fVSbDLJPmJdL1Z4Mw/nK3bKsh+s03a0FDm7WQ/Zsx/xPBKzQokK1HoRuvUEnI+gPpyhICalIfpJhBas32sBmdWNuH6wpefAdFBjps+tZtJq/hj81MNy4kuf1J2uSsK/Z X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 6:AAbTsbpc5unmAVVTmGuxKSgvddrSJcgbm9VWDjERJeyQCwD/g13SzxAn4+5/XW/7fhelbH4Rr33M6okOZqrHt4kiiQuOfxs2Lm5An9XMcM9uZcVry6FQL9CJaFNmX9+PXcxthjUMOtP8Sk/NyIwL2hJ6gYV463dxALZJUb/9EAwL9zOW1n+z/VPKd327KMdeWRIRHZEHjOwIwhujheLB2xE22Is08WpXchYNMdUhvICxmMKSVAJ7AVOYoW/3hecJ0uBscQzvIxIOcvKuPAe9sfK+/SCNvk0LvvC6A+NH9Wavoy/L2MYPydehxOF/RPW1hY/nXFcijCoWAkapt1P6earPm+k1L9XVFqJVIjC1IaB9pgriYl49KZBkExPY6jF0MY2x04/tFyratsuuSRr3Uq7ULmJBbR3u6CPw7apipDrIT8Lj+Ukjw736j3IcwGUa3MToisdtasKfc7djj8o3KsDgbTyC9a0jfY0XQSktCxCGvF/vde3/9Tkhips5CT23; 5:XB6z5s8fcMsp0jWHANq+NJHs0M7Z/8B2hMrbp8LVq6BHOl+nVwz1ZvMcNlw+ZIp/0kH1ZbciAbQLjgFClw+IhBvkQvC0QhajWFeYHg/1OJ9rSVVeGggtS9YcoCRCBLec9dIpcQnykRwBuZywnCJvgzitKyqQUS7seFKYsAqvBUg=; 24:AatVIY2iAevfoPWovsTZZ1swx+mbsy2rCCU3uFjyVOzeXFMdzhOzaTviR6E8tH9qN79ckhhDBUXNBGyoAxQzgA== SpamDiagnosticOutput: 1:22 X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 7:AXdKkB+qEIt3Z6BXfopzdmppeimyu/+v+1ppURrobNIlIF4BnM5fjNAu4NbWU4OSxKbWyqBE3X+gr8HkRa5w7lw9EfKAIXwxLAPLIX5omalzx/FfNsx73R0d69IT+/ReeCliH51Hh8WiRVOHa6/12AVg02iyX+rUqGJ/pjVIksQd6KJyhj/KzocbEM0jXwIh/dGqBgIM9GLqD2OXhv0Sbh/eVIYMEIfNvzFqeLOHqt3HneiwSuZVnFTbdwcMVuHX; 20:CpUiDRXO1b1joPhQVuuO/zosdhCRK3tzTaiKTJa/gWu/V0htf+2WMFwB6txP3yMd3n+zG2JBphLW4PwXaf/WXGvqXymBXyb6CtUXubgSjGvsZTw3ibaXCNWHIXih2kxEGLPVqjrMP92o/kombjcz++/w8641yU+OyOpNWddBt0umR2MjG2+KU+VlfnhISeggIQ/1KTtUqR1vxTvZVlgFREGrQE8FT/IcgtI9A3S1ZTi8U0M8yGf0lyetWUCDZYUW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 06:40:11.6511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 374b36ca-012a-4481-ccc7-08d59ac0155b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v4 01/17] 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: Thu, 05 Apr 2018 06:40:14 -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 | 23 +++++++ 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, 242 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..5da265b 100644 --- a/config/common_base +++ b/config/common_base @@ -410,6 +410,12 @@ CONFIG_RTE_PMD_RING_MAX_TX_RINGS=16 CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y # +# Compile AMD PMD +# +CONFIG_RTE_LIBRTE_AXGBE_DEBUG_INIT=n +CONFIG_RTE_LIBRTE_AXGBE_PMD=y + +# # Compile the TAP PMD # It is enabled by default for Linux only. # 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..277ef2d --- /dev/null +++ b/drivers/net/axgbe/Makefile @@ -0,0 +1,23 @@ +# 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 + +# +# 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..020bcef --- /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_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(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