From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730079.outbound.protection.outlook.com [40.107.73.79]) by dpdk.org (Postfix) with ESMTP id CF4BD1B123 for ; Sat, 29 Sep 2018 12:31:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DI49s/ddsnQeo62Zwz2ipQONKT41YuWBwLXmKXtB5Oo=; b=YVdd7NwcpEAWBfXHBMLw9MgM3Em8YaXTqSpWwwpsIIifsM83FFjDVrHcQAOSYxxoW01Rt0YXwdFOJ3XW5pU87y/jBEqhaAiv22FbHrtHZmaxl2gCRsLeH9fXoyE8fnjua3TExKcY7/FYznJWa6qQItQVWlGPsAkLW8g5WOj4I2A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Sat, 29 Sep 2018 10:30:56 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com, Pavel Belous Date: Sat, 29 Sep 2018 13:30:15 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d15b29a-2620-4c8e-7812-08d625f6a7f9 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:8wjR65/NTsXjvtMuZo2og4atH3wEzdebBFzVh7CmjQuoGetI4NxpQvTlRiRR/7NjzD70hXjRBUhrxxAAun3EhE94HULJ9JRvJ39rj1rmaJLrtKDIm5ExYodVouLixD3rcvrO/ofQpIYYtqZk6+2ik2Fc7S60wdS2IFjdDKOlohJh9y3MvHfzynwfjALHPdnhQL+ozNvEwkivKbF4+7wKm/ICY4VzaVMzmRseRMQQtENWz6pgsZPJFnuNsfl7mHQM; 25:MLo82J3oy8gXsjcAZbZjsc8FNfKUFSJrvixgiWZkkNIQMNmrUfXLeOXH+hBQ1GPs0PtFFuSIcN6uA15qDvL9ALfsf/dUJX8MQmVbaws4FGgGirPKDto2ydfwvHr6FYaRVDIZdq14CfAkjwWjnnyCpK23lIN/NoTYbec2XvvNBcoBs+joZ2TjHF3eU0ANBhJePhRAaLjr9YL/DBYDBvrZj3EJugpMx1wAyPi4lcVrjFEiGfzMoOEcyB9Ik1S8sNlh1NpKarsOoOSvPCAXS1Sty+1cGtVQCIExE25IvFHVVhdyXn8GocJStTuBwdRaC2zui6OWP+mzohi6k4jv/5xzrCiINwj44dOmi9nXM3sbULY=; 31:8EVt2qQxoofHQbwj9/kvdZQEeLfXM2s3HAKtmiMPtcfZAKKNIrG+y2sYKldxsLO3NKZgLqHQikVNGKuAXr6ior3BggAZ6Za7xUKE16/JShA4lzEBpfjaEQW848CuhdacYqTpelvUbO+NxoCd4n4W+mr+Csa4xUJxvbZxfaMR7LFzeSu6xxCqEyFZ41exYxT5qQz8vxKtS+HIR51GMpblaxxZpNToglRy78Q8HL+86SY= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:CS0Sa6MTcqNwO4L6ViPNJN234KhVq+2r+oLjFRh1lc8ex2aobQfL8ftYUzRkQh7SgmopHPK+U4o1ATfQFbRYOC9MambXEmvcFyBX93gKfFeYng/ukidFKvK2JvEkFrQVO6ig4opkTNtdGJERSwI38M2lqB1fTwDznRoUvQTqRnU+1QQecRcO/dDPjw2JZAumt+eCEwgbKTY1/DRcVQuLi+k/iShC8DaxBGp5jrzCRfo7AAYS2rD2iUJO8lsnp1notEqHNUN0ILNFB4mvvb7uBCm+juy02H7WtaObEF1PHhkjvRmtXaqi4s/1vRTc+40sQ3gPY/2w4o86ZAiAd/falw68plpfeOjZ/SI8rCd98KBtoDf9vERLH0euWdxBpskOnrpm1l93O8JHfgaOlCu0pdDIPzECFa5yk1Th8cg8p7igGmVAjjs5y869PddlWMkyJZLPLO1pzE11Om0ZS6aK11i6F+t0wGa8JRRKd3tvHNOgf8FYjpHB1cSIbtQWMYOG; 4:YRTP0094/p+RJ58Zq6aZkimvZ6OvoREmGD8A4OWurRFUInIQHpQtUiN7WZd4EgVsz57wAmE08vCi9/oAn0v3N6bU6vz4PRnpV+T1HByH0SphcmTjSelDVksqz0DQeCfhbXys0Tt2sMzWCStBAheln3PnU3wxa+BvQwuBM+pLvvDH9PeXWzMJJwG06SfH8imJwa5OsOzWDKaAmwYqDObWXDzFFZSxYUyy8xs/qRgsRIxzPXEocI0BwZU/CYeBG8iEQmuyRz+lu/PwMC0IrVNDZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 0810818DA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(376002)(346002)(396003)(136003)(189003)(199004)(6486002)(105586002)(118296001)(16586007)(6116002)(53936002)(3846002)(386003)(72206003)(2361001)(478600001)(11346002)(7736002)(2351001)(106356001)(48376002)(25786009)(305945005)(50466002)(66066001)(486006)(47776003)(44832011)(186003)(476003)(2616005)(956004)(107886003)(7696005)(51416003)(52116002)(26005)(6666003)(6916009)(2906002)(97736004)(16526019)(14444005)(76176011)(446003)(575784001)(86362001)(5660300001)(50226002)(34290500001)(68736007)(81166006)(81156014)(36756003)(8676002)(8936002)(4326008)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:Q7k3LxFQ9dch9khK8plBgHwa93DJ/Vi+pNiIxFk?= =?us-ascii?Q?IHZMW5FCA6lV9fjaBZ7NITrjTUkNpaCTYbCRgptBlZWH1OJ5rlolR+s+0oW6?= =?us-ascii?Q?Xjyd9DNk8r3LhtseYqReJDIztGGWG0i2rm2UspDbXOJpwvarnZNxugPLWBnP?= =?us-ascii?Q?OkFaLGt/ephz1mY+mJ8ELEyOc7RPB+jAtUHFeayQKjX1kOcBRnt7BjSjTJrN?= =?us-ascii?Q?2glBaRzGRIGyqD6LV3VQfqbjMQ6la79JP1rBT2Y+4yTY6+FWxf1TlhaoGUN6?= =?us-ascii?Q?m4IFxDWZlWFRNjTlwR+RSGkN/tlJdiDaKHBs6PYMH2D4Idb4xdf+IQbS/60K?= =?us-ascii?Q?HXOv2Haz9bV+Xkh/iTwkTbqvQXFNE1SbYxlw1u5hr7dCu9CBv83+v0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FRhMQQlfjcAB1Ewq4U83KJiCOQgGx1cequ0Wpb2CaSV5w7dS6cupdfMTOSUflz+2OqPyBrMpazaP4k8OxQGh5lX9ou23zzxYeGlI=; 7:0I92JyY9TPoLc+Pv1fGrZ7cuTlP//uqFFZ1BeTYO+InSv7PLcB4SlvyT5Lh45kLs8M+BU4UXIGL8VJaUOcHaQHkdkPqCkyYV5rN2NUdX5BTyqRVb4AMU3NrVGgHgjV/IngN4ld33L7OMMv5kurUi67FPnGqjQmUQUmEPwSMpfcravWb08OWZEMpljZzDZqkP0EjozF23QKnW45xmswLCf+9EXconTISKaPJ0+tE4ZEe/MgFuVrbtTBgyPUaCZ8v0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2018 10:30:56.9046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d15b29a-2620-4c8e-7812-08d625f6a7f9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v3 01/22] net/atlantic: atlantic PMD driver skeleton 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: Sat, 29 Sep 2018 10:31:05 -0000 From: Pavel Belous Makefile/meson build infrastructure, atl_ethdev minimal skeleton, header with aquantia aQtion NIC device and vendor IDs. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- config/common_base | 5 + drivers/net/Makefile | 1 + drivers/net/atlantic/Makefile | 27 ++++ drivers/net/atlantic/atl_common.h | 96 ++++++++++++++ drivers/net/atlantic/atl_ethdev.c | 145 ++++++++++++++++++++++ drivers/net/atlantic/atl_ethdev.h | 15 +++ drivers/net/atlantic/meson.build | 10 ++ drivers/net/atlantic/rte_pmd_atlantic_version.map | 4 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 10 files changed, 305 insertions(+) create mode 100644 drivers/net/atlantic/Makefile create mode 100644 drivers/net/atlantic/atl_common.h create mode 100644 drivers/net/atlantic/atl_ethdev.c create mode 100644 drivers/net/atlantic/atl_ethdev.h create mode 100644 drivers/net/atlantic/meson.build create mode 100644 drivers/net/atlantic/rte_pmd_atlantic_version.map diff --git a/config/common_base b/config/common_base index 155c7d40ea31..ba51ffbd43ce 100644 --- a/config/common_base +++ b/config/common_base @@ -635,6 +635,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n # +# Compile Aquantia Atlantic PMD driver +# +CONFIG_RTE_LIBRTE_ATLANTIC_PMD=y + +# # Compile raw device support # EXPERIMENTAL: API may change without prior notice # diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 664398de983a..8ac6b9db5916 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -10,6 +10,7 @@ endif DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark +DIRS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atlantic DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += avf DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += avp DIRS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) += axgbe diff --git a/drivers/net/atlantic/Makefile b/drivers/net/atlantic/Makefile new file mode 100644 index 000000000000..e42ce5b178ab --- /dev/null +++ b/drivers/net/atlantic/Makefile @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Aquantia Corporation + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_atlantic.a + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +EXPORT_MAP := rte_pmd_atlantic_version.map + +LIBABIVER := 1 + +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev -lrte_net +LDLIBS += -lrte_bus_pci + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/atlantic/atl_common.h b/drivers/net/atlantic/atl_common.h new file mode 100644 index 000000000000..b3a0aa5cd212 --- /dev/null +++ b/drivers/net/atlantic/atl_common.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ + +#ifndef AQ_COMMON_H +#define AQ_COMMON_H + +#define ATL_PMD_DRIVER_VERSION "0.4.1" + +#define PCI_VENDOR_ID_AQUANTIA 0x1D6A + +#define AQ_DEVICE_ID_0001 0x0001 +#define AQ_DEVICE_ID_D100 0xD100 +#define AQ_DEVICE_ID_D107 0xD107 +#define AQ_DEVICE_ID_D108 0xD108 +#define AQ_DEVICE_ID_D109 0xD109 + +#define AQ_DEVICE_ID_AQC100 0x00B1 +#define AQ_DEVICE_ID_AQC107 0x07B1 +#define AQ_DEVICE_ID_AQC108 0x08B1 +#define AQ_DEVICE_ID_AQC109 0x09B1 +#define AQ_DEVICE_ID_AQC111 0x11B1 +#define AQ_DEVICE_ID_AQC112 0x12B1 + +#define AQ_DEVICE_ID_AQC100S 0x80B1 +#define AQ_DEVICE_ID_AQC107S 0x87B1 +#define AQ_DEVICE_ID_AQC108S 0x88B1 +#define AQ_DEVICE_ID_AQC109S 0x89B1 +#define AQ_DEVICE_ID_AQC111S 0x91B1 +#define AQ_DEVICE_ID_AQC112S 0x92B1 + +#define AQ_DEVICE_ID_AQC111E 0x51B1 +#define AQ_DEVICE_ID_AQC112E 0x52B1 + +#define HW_ATL_NIC_NAME "aQuantia AQtion 10Gbit Network Adapter" + +#define AQ_HWREV_ANY 0 +#define AQ_HWREV_1 1 +#define AQ_HWREV_2 2 + +#define AQ_NIC_RATE_10G BIT(0) +#define AQ_NIC_RATE_5G BIT(1) +#define AQ_NIC_RATE_5G5R BIT(2) +#define AQ_NIC_RATE_2G5 BIT(3) +#define AQ_NIC_RATE_1G BIT(4) +#define AQ_NIC_RATE_100M BIT(5) + +#define AQ_NIC_RATE_EEE_10G BIT(6) +#define AQ_NIC_RATE_EEE_5G BIT(7) +#define AQ_NIC_RATE_EEE_2G5 BIT(8) +#define AQ_NIC_RATE_EEE_1G BIT(9) + + +#define ATL_MAX_RING_DESC (8 * 1024 - 8) +#define ATL_MIN_RING_DESC 32 +#define ATL_RXD_ALIGN 8 +#define ATL_TXD_ALIGN 8 +#define ATL_TX_MAX_SEG 16 + +#define ATL_MAX_INTR_QUEUE_NUM 15 + +#define ATL_MISC_VEC_ID 10 +#define ATL_RX_VEC_START 0 + +#define AQ_NIC_WOL_ENABLED BIT(0) + + +#define AQ_NIC_FC_OFF 0U +#define AQ_NIC_FC_TX 1U +#define AQ_NIC_FC_RX 2U +#define AQ_NIC_FC_FULL 3U +#define AQ_NIC_FC_AUTO 4U + + +#define AQ_CFG_TX_FRAME_MAX (16U * 1024U) +#define AQ_CFG_RX_FRAME_MAX (2U * 1024U) + +#define AQ_HW_MULTICAST_ADDRESS_MAX 32 +#define AQ_HW_MAX_SEGS_SIZE 40 + +#define AQ_HW_MAX_RX_QUEUES 8 +#define AQ_HW_MAX_TX_QUEUES 8 +#define AQ_HW_MIN_RX_RING_SIZE 512 +#define AQ_HW_MAX_RX_RING_SIZE 8192 +#define AQ_HW_MIN_TX_RING_SIZE 512 +#define AQ_HW_MAX_TX_RING_SIZE 8192 + +#define ATL_DEFAULT_RX_FREE_THRESH 64 +#define ATL_DEFAULT_TX_FREE_THRESH 64 + +#define ATL_IRQ_CAUSE_LINK 0x8 + +#define AQ_HW_LED_BLINK 0x2U +#define AQ_HW_LED_DEFAULT 0x0U + +#endif /* AQ_COMMON_H */ diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c new file mode 100644 index 000000000000..5728d9037d72 --- /dev/null +++ b/drivers/net/atlantic/atl_ethdev.c @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ + +#include + +#include "atl_ethdev.h" +#include "atl_common.h" + +static int eth_atl_dev_init(struct rte_eth_dev *eth_dev); +static int eth_atl_dev_uninit(struct rte_eth_dev *eth_dev); + +static int atl_dev_configure(struct rte_eth_dev *dev); +static int atl_dev_start(struct rte_eth_dev *dev); +static void atl_dev_stop(struct rte_eth_dev *dev); +static void atl_dev_close(struct rte_eth_dev *dev); +static int atl_dev_reset(struct rte_eth_dev *dev); + +static int eth_atl_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev); +static int eth_atl_pci_remove(struct rte_pci_device *pci_dev); + +int atl_logtype_init; +int atl_logtype_driver; + +/* + * The set of PCI devices this driver supports + */ +static const struct rte_pci_id pci_id_atl_map[] = { + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_0001) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D100) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D107) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D108) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_D109) }, + + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC100) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC107) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC108) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC109) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112) }, + + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC100S) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC107S) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC108S) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC109S) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111S) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112S) }, + + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC111E) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_AQUANTIA, AQ_DEVICE_ID_AQC112E) }, + { .vendor_id = 0, /* sentinel */ }, +}; + +static struct rte_pci_driver rte_atl_pmd = { + .id_table = pci_id_atl_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | + RTE_PCI_DRV_IOVA_AS_VA, + .probe = eth_atl_pci_probe, + .remove = eth_atl_pci_remove, +}; + +static const struct eth_dev_ops atl_eth_dev_ops = { + .dev_configure = atl_dev_configure, + .dev_start = atl_dev_start, + .dev_stop = atl_dev_stop, + .dev_close = atl_dev_close, + .dev_reset = atl_dev_reset, +}; + +static int +eth_atl_dev_init(struct rte_eth_dev *eth_dev __rte_unused) +{ + return 0; +} + +static int +eth_atl_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) +{ + return 0; +} + +static int +eth_atl_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 atl_adapter), eth_atl_dev_init); +} + +static int +eth_atl_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_atl_dev_uninit); +} + +static int +atl_dev_configure(struct rte_eth_dev *dev __rte_unused) +{ + return 0; +} + +/* + * Configure device link speed and setup link. + * It returns 0 on success. + */ +static int +atl_dev_start(struct rte_eth_dev *dev __rte_unused) +{ + return 0; +} + +/* + * Stop device: disable rx and tx functions to allow for reconfiguring. + */ +static void +atl_dev_stop(struct rte_eth_dev *dev __rte_unused) +{ +} + +/* + * Reset and stop device. + */ +static void +atl_dev_close(struct rte_eth_dev *dev __rte_unused) +{ +} + +static int +atl_dev_reset(struct rte_eth_dev *dev) +{ + int ret; + + ret = eth_atl_dev_uninit(dev); + if (ret) + return ret; + + ret = eth_atl_dev_init(dev); + + return ret; +} + +RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd); +RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map); +RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic"); diff --git a/drivers/net/atlantic/atl_ethdev.h b/drivers/net/atlantic/atl_ethdev.h new file mode 100644 index 000000000000..ae87517560de --- /dev/null +++ b/drivers/net/atlantic/atl_ethdev.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ + +#ifndef _ATLANTIC_ETHDEV_H_ +#define _ATLANTIC_ETHDEV_H_ +#include + +/* + * Structure to store private data for each driver instance (for each port). + */ +struct atl_adapter { +}; + +#endif /* _ATLANTIC_ETHDEV_H_ */ diff --git a/drivers/net/atlantic/meson.build b/drivers/net/atlantic/meson.build new file mode 100644 index 000000000000..90ee5288206a --- /dev/null +++ b/drivers/net/atlantic/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Aquantia Corporation + +sources = files( + 'atl_ethdev.c', +) + +deps += ['eal'] + +allow_experimental_apis = true diff --git a/drivers/net/atlantic/rte_pmd_atlantic_version.map b/drivers/net/atlantic/rte_pmd_atlantic_version.map new file mode 100644 index 000000000000..521e51f411fb --- /dev/null +++ b/drivers/net/atlantic/rte_pmd_atlantic_version.map @@ -0,0 +1,4 @@ +DPDK_18.11 { + + local: *; +}; diff --git a/drivers/net/meson.build b/drivers/net/meson.build index f59bea7905e3..8208ab101ed5 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -3,6 +3,7 @@ drivers = ['af_packet', 'ark', + 'atlantic', 'avp', 'axgbe', 'bonding', 'bnx2x', diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 899d51a23b2c..fd06e7df014e 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -157,6 +157,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -ldl -lmnl else _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -libverbs -lmlx5 -lmnl endif +_LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += -lrte_pmd_atlantic _LDLIBS-$(CONFIG_RTE_LIBRTE_MVPP2_PMD) += -lrte_pmd_mvpp2 -L$(LIBMUSDK_PATH)/lib -lmusdk _LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null -- 2.7.4