From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42]) by dpdk.org (Postfix) with ESMTP id 2EBE21B3A7 for ; Tue, 9 Oct 2018 11:31:44 +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=Mr0utCxj782H3A6TVnqyD509IkREfrrnk/9eqpHvkik=; b=IYmPSxbkqKHyQ/ZrQpe0qXY1Q/uJkACWAnpWYxKVtZQFxyMQKtnddFJxtJnZLcSdnaFqpVZ5q36rhDxGUgwEvOtlEUzjdBcGU2W3w2fkl6SsBw7wdkLZ+8Ax0njs0FANNXnlvWOlBeB8u49F3wnTVYQS8+UL78AOmesykOfOoSQ= Received: from BLUPR0701MB1651.namprd07.prod.outlook.com (10.163.84.21) by BLUPR0701MB1650.namprd07.prod.outlook.com (10.163.84.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Tue, 9 Oct 2018 09:31:42 +0000 Received: from BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46]) by BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46%3]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 09:31:42 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" , Pavel Belous Thread-Topic: [PATCH v4 08/22] net/atlantic: TX/RX function prototypes Thread-Index: AQHUX7Lj7o+8EUntr0GdmwVp2TEGIw== Date: Tue, 9 Oct 2018 09:31:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0028.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::41) To BLUPR0701MB1651.namprd07.prod.outlook.com (2a01:111:e400:58c6::21) 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; BLUPR0701MB1650; 6:SgeFgvA4FCOIXLuNwt1FNf3d3YuoNu1vBxXz1+AmnkJuahUk65gda82TZ3j/80RrJBC4jNhQH5GhGgaEuXOsQ0wWkrS23xBSAWu5fB/MpyMFvjUbl/o+1oPn8iin/L0tBi6lPS6ei9xY5Wj7BQnmrA3axrhZV3I1/XrXwm68fLalH5ncG06eJwXXIX3BmtpiBlW0xS29ck+zmf1Z++EYIRQbpSZWrKIpTsVc7nFF7VRBEB8xYNYtWkEHQtflcHMYfrGZ80CJNekqzN24byb1AopgBsAeUgW9Ne70n0pJkf/j00jeGTmcukiCsLzzoxD2niS+8PdMkCyy3xrYpBh1c/OFYG6WIQg7i8vIBd65z3FZuW+rPdv9x2TituYKuy/ng3KyphJxrXuVKDf8ekgXLAQEdhs4/D1cJ7Ng2RROj3CAA6Yk3HKzmRXh+SLVWOFov1HAYGEjRoW8o7OIQs9OAQ==; 5:Bl1sYjS4bmV/GI0jHqQlHeRzkdO2vJPldKEfEACJHJiqkR/pPke9qUEaCZqvc5O/0ygKil87CP+XfZAPjKl+f2ZDhjjJ4VskwgP6Yg5KtpdyXFCnAmXOVnSQKGLMUNna6XBrpLB7uqUqPvlJNkWGDZcqBVEyjt2OqCfOPaZ/vG8=; 7:diI95xgWu7TiKu9HiXTFBwL7CtrX5uUqaypHASXCAvsH+4JedBx3NCqp3Sx4UEXSACM70Zb9YEoKDj8K3ohS9aqwFlx1LZA4DPWwwC6Hb/FxQ9PfsOi219NtuGs8+GK3v7siJHBowvcv01WB9f9On0SstvV5GnwMhb3T5FL/Xe5oe6S8Gyb3bm2FQ268Uz2gZkFZDRO9dDQSQdhbKD8/j1cGZ8jOHH4icLpo/ZCeJr0FNzFtmRLasddy9wyhUdWx x-ms-office365-filtering-correlation-id: 0099d418-a68c-4cba-750b-08d62dca05ca x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; x-ms-traffictypediagnostic: BLUPR0701MB1650: 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)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(201708071742011)(7699051); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39850400004)(346002)(376002)(396003)(136003)(189003)(199004)(81156014)(5640700003)(6116002)(71200400001)(105586002)(68736007)(316002)(3846002)(107886003)(71190400001)(26005)(118296001)(2616005)(5250100002)(25786009)(4326008)(102836004)(44832011)(446003)(476003)(11346002)(186003)(2906002)(106356001)(97736004)(2501003)(2351001)(486006)(478600001)(99286004)(53936002)(386003)(1730700003)(5660300001)(6506007)(36756003)(66066001)(54906003)(305945005)(256004)(14444005)(86362001)(575784001)(7736002)(2900100001)(76176011)(8936002)(52116002)(8676002)(6486002)(72206003)(6436002)(14454004)(81166006)(6512007)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:BLUPR0701MB1651.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: 4pa6VDv8c081lgIgdyO49Rr/uAmSCjSokATfi9pvU5PHSSsIeS887+OSrRV675vNgW9aWbWmgB27dMjQVhPt1tii1gNU+uHK6fXgT4L4ZesVREAOAFx6Eoef9Zb2TnpPQmUXMJpqUx8UCC5aChxWgioCt94SsJPLZ/tJfMp1mUwM6+ZuHnb2eEjG93Nd3gk/TFl0oPdXtyh7Chq8fqcnWqoRZIbLKfQ8pFvSUqdQXfWlJVtaMWiKuU+tibfigyCyLVIMijrKWEaPTfxMqdU2/EcB8xcGe7MlpP9jIXHAhazsofmHJSL4D/Iaj9MpTEEdJ81mBR4BmjdGYMQ8L9lJCb8m3OvRSN47/Cbq86SGPfg= 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: 0099d418-a68c-4cba-750b-08d62dca05ca X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 09:31:42.7585 (UTC) 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 v4 08/22] net/atlantic: TX/RX function prototypes 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: Tue, 09 Oct 2018 09:31:44 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous Signed-off-by: Pavel Belous --- drivers/net/atlantic/Makefile | 1 + drivers/net/atlantic/atl_ethdev.c | 20 ++++++++++++++++++- drivers/net/atlantic/atl_ethdev.h | 15 ++++++++++++++ drivers/net/atlantic/atl_rxtx.c | 42 +++++++++++++++++++++++++++++++++++= ++++ drivers/net/atlantic/meson.build | 1 + 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 drivers/net/atlantic/atl_rxtx.c diff --git a/drivers/net/atlantic/Makefile b/drivers/net/atlantic/Makefile index 91306d71ba97..b88da362146d 100644 --- a/drivers/net/atlantic/Makefile +++ b/drivers/net/atlantic/Makefile @@ -24,6 +24,7 @@ VPATH +=3D $(SRCDIR)/hw_atl # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atl_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atl_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D atl_hw_regs.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) +=3D hw_atl_utils.c diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index a28e10af9781..3f7a3d23d6bb 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -114,6 +114,9 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); =20 eth_dev->dev_ops =3D &atl_eth_dev_ops; + eth_dev->rx_pkt_burst =3D &atl_recv_pkts; + eth_dev->tx_pkt_burst =3D &atl_xmit_pkts; + eth_dev->tx_pkt_prepare =3D &atl_prep_pkts; =20 /* For secondary processes, the primary process has done all the work */ if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) @@ -167,6 +170,8 @@ eth_atl_dev_uninit(struct rte_eth_dev *eth_dev) atl_dev_close(eth_dev); =20 eth_dev->dev_ops =3D NULL; + eth_dev->rx_pkt_burst =3D NULL; + eth_dev->tx_pkt_burst =3D NULL; =20 rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs =3D NULL; @@ -224,10 +229,23 @@ atl_dev_start(struct rte_eth_dev *dev) err =3D hw_atl_b0_hw_init(hw, (uint8_t *)dev->data->mac_addrs); =20 hw_atl_b0_hw_start(hw); + /* initialize transmission unit */ + atl_tx_init(dev); + + /* This can fail when allocating mbufs for descriptor rings */ + err =3D atl_rx_init(dev); + if (err) { + PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); + goto error; + } =20 atl_print_adapter_info(hw); =20 - return err; + return 0; + +error: + PMD_INIT_LOG(ERR, "failure in atl_dev_start(): %d", err); + return -EIO; } =20 /* diff --git a/drivers/net/atlantic/atl_ethdev.h b/drivers/net/atlantic/atl_e= thdev.h index c0cc5475a091..990e8e4e9978 100644 --- a/drivers/net/atlantic/atl_ethdev.h +++ b/drivers/net/atlantic/atl_ethdev.h @@ -21,4 +21,19 @@ struct atl_adapter { struct aq_hw_cfg_s hw_cfg; }; =20 +/* + * RX/TX function prototypes + */ +int atl_rx_init(struct rte_eth_dev *dev); +int atl_tx_init(struct rte_eth_dev *dev); + +uint16_t atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); + +uint16_t atl_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + +uint16_t atl_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + #endif /* _ATLANTIC_ETHDEV_H_ */ diff --git a/drivers/net/atlantic/atl_rxtx.c b/drivers/net/atlantic/atl_rxt= x.c new file mode 100644 index 000000000000..0fbd93038075 --- /dev/null +++ b/drivers/net/atlantic/atl_rxtx.c @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Aquantia Corporation + */ + +#include "atl_ethdev.h" + +int +atl_tx_init(struct rte_eth_dev *eth_dev __rte_unused) +{ + return 0; +} + +int +atl_rx_init(struct rte_eth_dev *eth_dev __rte_unused) +{ + return 0; +} + +uint16_t +atl_prep_pkts(void *tx_queue __rte_unused, + struct rte_mbuf **tx_pkts __rte_unused, + uint16_t nb_pkts __rte_unused) +{ + return 0; +} + +uint16_t +atl_recv_pkts(void *rx_queue __rte_unused, + struct rte_mbuf **rx_pkts __rte_unused, + uint16_t nb_pkts __rte_unused) +{ + return 0; +} + +uint16_t +atl_xmit_pkts(void *tx_queue __rte_unused, + struct rte_mbuf **tx_pkts __rte_unused, + uint16_t nb_pkts __rte_unused) +{ + return 0; +} + diff --git a/drivers/net/atlantic/meson.build b/drivers/net/atlantic/meson.= build index a0ad8f088571..28fb97cace6e 100644 --- a/drivers/net/atlantic/meson.build +++ b/drivers/net/atlantic/meson.build @@ -2,6 +2,7 @@ # Copyright(c) 2018 Aquantia Corporation =20 sources =3D files( + 'atl_rxtx.c', 'atl_ethdev.c', 'atl_hw_regs.c', 'hw_atl/hw_atl_b0.c', --=20 2.7.4