From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720071.outbound.protection.outlook.com [40.107.72.71]) by dpdk.org (Postfix) with ESMTP id B27411B463 for ; Fri, 12 Oct 2018 13:09:05 +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=UNnvq7E+PfqaAmN0H7xEFfagOGYHL8A6D3r6F9A8koI=; b=gLOdTlspKsZPkR0wgZwb5uCrzxfVpESvt1xhAIuj26WXuteoLnckjd6vTDsOJUTtpQ1wxCPVQ43v0K4LhPZ6XZoamItJ2RYkTZ2o3+0WdkJIK0/TJMU5nwXm3ptvw4dTVdgOpN0krOzQO4Y54jAzz/HIMVM0wiGZ0KAcDdExw+s= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1879.namprd07.prod.outlook.com (10.162.143.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Fri, 12 Oct 2018 11:09:04 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%3]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 11:09:04 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v6 01/22] net/atlantic: add atlantic PMD driver skeleton Thread-Index: AQHUYhv8tWO5jmHvNEKuhVEhT8GFwg== Date: Fri, 12 Oct 2018 11:09:03 +0000 Message-ID: <60035a144b2ecf4190fd1ed4c5aef70e24dafdee.1539338074.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0701CA0008.eurprd07.prod.outlook.com (2603:10a6:203:51::18) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY1PR0701MB1879; 6:MbGRVltWRU9UhFgZz4Jc18zNrkcE9ImsPn9JwBv/EOGF70KIXy5+pUHJqiGGSXSqWiyAb8XYCLbNvM2u6ip8Nb49zZ84c1DQfspjz6GzcBds3PKhVB+9abdWMy+CxDVLIjzBu7YyHVG5REr11Z7HWM1yHZiZVLNdYxuViQc8netI9JzXMxPl/L0QAXmr44kdw5uQszOcc6lbV46Az6VVw5tOA5+xgRjhlQdiOOyvE2f8j/CXE47WNsFc2iNPgOaXpq+MTtCh27/Q6KTzbxcI9L3OxAXCR9Woj0XFCM97EQR11Be6w4fsRg5pb2Pujl82kNx06/odo/lKNDwwS6jIFaDYZihJZRkx5fJptFTYZYgr5Uc89PeiHim3qQCSqhxrQcj3mKFVq5zKpk9L+2KoR/kqAA7wd30jvBnFRgO78iVxqCXP3AMeI+LEVLAcBJTarsErzjFjoaL5FcJO47qs7SA6FZ7NF8pDM4XJqnmEn/A=; 5:o0+ST+rOKPieJirdwE3t1kPZWmfGzRlu9DWZmdpKcRjn+ekTUXD3CplZFvJkG7AX8esFPK5DU/mJxkZrrOZnD3EI1jdTKmvBu0LPI1m/UjAd5xK9aYod2HPBb//xmAO5Y8+ptTX/lU7WvwA12ZdfYESQY4tlDf1pJF/KQmkqycY=; 7:Lo8/Ac/JII/jKjHV9mZd3qzxwXM7irajg5SFVINKb9pZTXOlfmpMQpVGIOgzvBPi9GuESwYZhXn2681OgkteC3tYnh59lW0uKBhGtzZtjBXfughymrCR6RWOoV+SIaE9GwvrJQnz7ENhs+O7K97BmfaIuGKDVNmhC5OoirFJJyLb9Fu6/E6WwE8J7KkUioCvh1TQm0ZoG5oboZ6rac/pTip6+02kJEe9bNNRI4HGQrpKn+nSuH8BLAFAgYaqBtU+ x-ms-office365-filtering-correlation-id: 90bf74fc-f171-46c5-f63b-08d630331e5b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1879; x-ms-traffictypediagnostic: BY1PR0701MB1879: 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:BY1PR0701MB1879; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1879; x-forefront-prvs: 0823A5777B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(136003)(39850400004)(396003)(189003)(199004)(6436002)(5640700003)(3846002)(68736007)(2900100001)(478600001)(6486002)(14454004)(2906002)(72206003)(71190400001)(71200400001)(26005)(2616005)(44832011)(102836004)(4744004)(446003)(486006)(256004)(118296001)(186003)(105586002)(2351001)(6116002)(106356001)(6512007)(97736004)(6916009)(5660300001)(54906003)(6506007)(386003)(53946003)(6306002)(11346002)(476003)(14444005)(53936002)(5250100002)(2501003)(25786009)(8936002)(8676002)(4326008)(86362001)(305945005)(7736002)(575784001)(99286004)(81166006)(1730700003)(81156014)(66066001)(52116002)(36756003)(316002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1879; H:BY1PR0701MB1660.namprd07.prod.outlook.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-antispam-message-info: brfrQSMJKz2ebGI72cJBXqLnKzq9rjAdpDmBUmeYeN2VX9aLAG80t+/rZMf26OhF6TDrua1RKW50Dkexv1SNpBzNX69rLvqv1TsEWgBehOCTq6pLGHighu6aGoarjGDPGQ2DSN43g6ZVMejBViGyIlE6H6XTJYyTPWGtUXp6KPRG19LUqn13e1VXjvZUzacEb41J3+CCHv9Ndu4uFBFt27ojcmEEKeRll4lRJw4qGPVNL04ky4/c6oEw6CXWWaW+7ACo4fxj7XhuFJO736VmxuPw9rVkUcCL5oXaTof4PhIS3L6i19fKJ/oc3J8K0x4C+taIBjhz5/pglYgu5nUthsJl/LewopdReANJXRuitJg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90bf74fc-f171-46c5-f63b-08d630331e5b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 11:09:03.9349 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1879 Subject: [dpdk-dev] [PATCH v6 01/22] net/atlantic: add 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: Fri, 12 Oct 2018 11:09:06 -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 --- MAINTAINERS | 7 + config/common_base | 5 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + doc/guides/nics/atlantic.rst | 37 +++++ doc/guides/nics/features/atlantic.ini | 10 ++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 1 + drivers/net/atlantic/Makefile | 27 ++++ drivers/net/atlantic/atl_common.h | 96 ++++++++++++ drivers/net/atlantic/atl_ethdev.c | 170 ++++++++++++++++++= ++++ drivers/net/atlantic/atl_ethdev.h | 15 ++ drivers/net/atlantic/meson.build | 6 + drivers/net/atlantic/rte_pmd_atlantic_version.map | 4 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 15 files changed, 382 insertions(+) create mode 100644 doc/guides/nics/atlantic.rst create mode 100644 doc/guides/nics/features/atlantic.ini 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/MAINTAINERS b/MAINTAINERS index 84b9ff786628..80c964a5144f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -485,6 +485,13 @@ F: drivers/net/axgbe/ F: doc/guides/nics/axgbe.rst F: doc/guides/nics/features/axgbe.ini =20 +Aquantia atlantic +M: Igor Russkikh +M: Pavel Belous +F: drivers/net/atlantic/ +F: doc/guides/nics/atlantic.rst +F: doc/guides/nics/features/atlantic.ini + Atomic Rules ARK M: Shepard Siegel M: Ed Czeck diff --git a/config/common_base b/config/common_base index acc5211bcc17..090ed26d13a1 100644 --- a/config/common_base +++ b/config/common_base @@ -641,6 +641,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=3Dn CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=3Dn =20 # +# Compile Aquantia Atlantic PMD driver +# +CONFIG_RTE_LIBRTE_ATLANTIC_PMD=3Dy + +# # Compile raw device support # EXPERIMENTAL: API may change without prior notice # diff --git a/config/defconfig_ppc_64-power8-linuxapp-gcc b/config/defconfig= _ppc_64-power8-linuxapp-gcc index a52e22efcc9d..8cbf7ed50c15 100644 --- a/config/defconfig_ppc_64-power8-linuxapp-gcc +++ b/config/defconfig_ppc_64-power8-linuxapp-gcc @@ -48,6 +48,7 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=3Dn =20 # Note: Initially, all of the PMD drivers compilation are turned off on Po= wer # Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_ATLANTIC_PMD=3Dn CONFIG_RTE_LIBRTE_IXGBE_PMD=3Dn CONFIG_RTE_LIBRTE_VIRTIO_PMD=3Dy CONFIG_RTE_LIBRTE_VMXNET3_PMD=3Dn diff --git a/doc/guides/nics/atlantic.rst b/doc/guides/nics/atlantic.rst new file mode 100644 index 000000000000..21e52bb26625 --- /dev/null +++ b/doc/guides/nics/atlantic.rst @@ -0,0 +1,37 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2018 Aquantia Corporation. + +Aquantia Atlantic DPDK Driver +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D + +Atlantic DPDK driver provides DPDK support for Aquantia's AQtion family of= chipsets: AQC107/AQC108/AQC109 + +More information can be found at `Aquantia Official Website +`_. + +Supported features +^^^^^^^^^^^^^^^^^^ + +Configuration Information +^^^^^^^^^^^^^^^^^^^^^^^^^ + +- ``CONFIG_RTE_LIBRTE_ATLANTIC_PMD`` (default ``y``) + +Application Programming Interface +--------------------------------- + +Limitations or Known issues +--------------------------- + +Statistics +~~~~~~~~~~ + +MTU setting +~~~~~~~~~~~ + +Supported Chipsets and NICs +--------------------------- + +- Aquantia AQtion AQC107 10 Gigabit Ethernet Controller +- Aquantia AQtion AQC108 5 Gigabit Ethernet Controller +- Aquantia AQtion AQC109 2.5 Gigabit Ethernet Controller diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/featur= es/atlantic.ini new file mode 100644 index 000000000000..e6c5676acf7a --- /dev/null +++ b/doc/guides/nics/features/atlantic.ini @@ -0,0 +1,10 @@ +; +; Supported features of the 'atlantic' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux UIO =3D Y +ARMv8 =3D Y +x86-32 =3D Y +x86-64 =3D Y diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst index 59f6063dce92..7925c2bd86ff 100644 --- a/doc/guides/nics/index.rst +++ b/doc/guides/nics/index.rst @@ -12,6 +12,7 @@ Network Interface Controller Drivers features build_and_test ark + atlantic avp axgbe bnx2x 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 =20 DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) +=3D af_packet DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) +=3D ark +DIRS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atlantic DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) +=3D avf DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) +=3D avp DIRS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) +=3D 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 =3D librte_pmd_atlantic.a + +CFLAGS +=3D -O3 +CFLAGS +=3D $(WERROR_FLAGS) + +EXPORT_MAP :=3D rte_pmd_atlantic_version.map + +LIBABIVER :=3D 1 + +LDLIBS +=3D -lrte_eal +LDLIBS +=3D -lrte_ethdev -lrte_net +LDLIBS +=3D -lrte_bus_pci + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atl_ethdev.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/atlantic/atl_common.h b/drivers/net/atlantic/atl_c= ommon.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_e= thdev.c new file mode 100644 index 000000000000..a9d7a5a49398 --- /dev/null +++ b/drivers/net/atlantic/atl_ethdev.c @@ -0,0 +1,170 @@ +/* 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); + +static void atl_dev_info_get(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info); + +/* + * The set of PCI devices this driver supports + */ +static const struct rte_pci_id pci_id_atl_map[] =3D { + { 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 =3D 0, /* sentinel */ }, +}; + +static struct rte_pci_driver rte_atl_pmd =3D { + .id_table =3D pci_id_atl_map, + .drv_flags =3D RTE_PCI_DRV_NEED_MAPPING | + RTE_PCI_DRV_IOVA_AS_VA, + .probe =3D eth_atl_pci_probe, + .remove =3D eth_atl_pci_remove, +}; + +static const struct eth_dev_ops atl_eth_dev_ops =3D { + .dev_configure =3D atl_dev_configure, + .dev_start =3D atl_dev_start, + .dev_stop =3D atl_dev_stop, + .dev_close =3D atl_dev_close, + .dev_reset =3D atl_dev_reset, + .dev_infos_get =3D atl_dev_info_get, +}; + +static int +eth_atl_dev_init(struct rte_eth_dev *eth_dev) +{ + eth_dev->dev_ops =3D &atl_eth_dev_ops; + + /* Allocate memory for storing MAC addresses */ + eth_dev->data->mac_addrs =3D rte_zmalloc("atlantic", ETHER_ADDR_LEN, 0); + if (eth_dev->data->mac_addrs =3D=3D NULL) + return -ENOMEM; + + return 0; +} + +static int +eth_atl_dev_uninit(struct rte_eth_dev *eth_dev) +{ + rte_free(eth_dev->data->mac_addrs); + + 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 =3D eth_atl_dev_uninit(dev); + if (ret) + return ret; + + ret =3D eth_atl_dev_init(dev); + + return ret; +} + +static void +atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_inf= o) +{ + struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); + + dev_info->max_rx_queues =3D 0; + dev_info->max_rx_queues =3D 0; + + dev_info->max_vfs =3D pci_dev->max_vfs; + + dev_info->max_hash_mac_addrs =3D 0; + dev_info->max_vmdq_pools =3D 0; + dev_info->vmdq_queue_num =3D 0; +} + +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_e= thdev.h new file mode 100644 index 000000000000..622806837379 --- /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 +#include "rte_ethdev.h" +/* + * 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..c5a2546ef657 --- /dev/null +++ b/drivers/net/atlantic/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Aquantia Corporation + +sources =3D files( + 'atl_ethdev.c', +) diff --git a/drivers/net/atlantic/rte_pmd_atlantic_version.map b/drivers/ne= t/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 5906283c2f5c..32374141a9ea 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -3,6 +3,7 @@ =20 drivers =3D ['af_packet', 'ark', + 'atlantic', 'avf', 'avp', 'axgbe', 'bonding', diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 32579e4b7587..009280701034 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -123,6 +123,7 @@ endif =20 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) +=3D -lrte_pmd_af_packet _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) +=3D -lrte_pmd_ark +_LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D -lrte_pmd_atlantic _LDLIBS-$(CONFIG_RTE_LIBRTE_AVF_PMD) +=3D -lrte_pmd_avf _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD) +=3D -lrte_pmd_avp _LDLIBS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) +=3D -lrte_pmd_axgbe --=20 2.7.4