From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720051.outbound.protection.outlook.com [40.107.72.51]) by dpdk.org (Postfix) with ESMTP id EE3D01B589 for ; Fri, 12 Oct 2018 13:09:24 +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=RYT6LmAdvUU/RpsMBSWzEtSAwvAl9ucjpkcsw9PwurQ=; b=OT6WwO9ESSHWzXtbGEnHyt/G0OyQhATAICjKXHhPfEOJlg0sRuJAyWB6cbOzv4Uj5AtK52TgckPFmE7FpxuhNEfMqANmnvVL3diZ5Z/Fo1j42iXW+FVO43uNTLbP/MucHIt8NZSoSlThQvFqg4BXIBKgIAeeuk0jyYmmhJb06rI= 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:22 +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:22 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v6 08/22] net/atlantic: implement core logic for Tx/Rx Thread-Index: AQHUYhwH8y1Xq9SRGkiVcyraeXDHLA== Date: Fri, 12 Oct 2018 11:09:22 +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: 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:0L9CF9X5AEtqixaHY6RS3ZCVGWfTuYPCF4tRzBiOU8m01UlixyAdlOaneVxaifKB4itJ/yoGJGFe5kkKeP0M6HwUyl6h/GK+mIP7v+IOvizpyM6zKSCUYxyA+DmbwmGjRZLqkR2DDg22Nz6cV5QCiXLW8tz5lMLxQUlmL9qTb6EozFW0z9TfmXt1JhDoTnlbfZnHbcD/Fty61NDZq1hKzkk4ABmbJIiXbyYYyTKpWAGcDIBeDkq0S8sxzNJuzHvNvtXzjcTUoVY7CjPJ7PkaY7mbLbZd6ao4NQJMfEROTfGrUmsk/jT/ITSf8b87YcmQKauVlxnLTz+K/Wzdr4/I1W8+WSW4yrkFA6j+ZjogSIL6w8fgCEWBNyWbmt4znH4plkBmr4E+osL7GfsrCtS+WTQNDEX3Tmuqcf95p02GS5tmtjHeO7maN3TzR+1otUiBWvQCsyCoplXkAMeUasyHmmYfRZXOHzH3fUzgXJ100yI=; 5:ALFouJoXOAUOjYDdgIR4iCYMGIrNeAJ8s9c8g8J27A1LyhP4uBDcvwLPV6a/Z45QV+tBa70UrvL1+OIxsL7GbT6KvUIiRj8aS6aaMBxVpNVygRtMfvaQ0jGjjrId4zZkcsCMOb5oJa61pJUkXPi+JY6GWNXfsWko6idrHUzecCM=; 7:fTDQdVrdlWnBrGAVWauAGs8I1wqWM/a7U32DMhhHDtWt+XBjmNgbKTnhVIDFB0JlN3718gQfoLWt2ZoCqpOfmtQ+IeHhVCCAKZmUDeN3Wrq8VzFmwN7rxS3Ec+QLnwXUARPsamx3+evnvEgEdtks5qaK5ZyAIs+TmyIGP07EcwKs8E4KewVsxN63+iq4oAU6V0cG6/kzPvihIsO6mBAtg7MLUPRxACjOf6yiPILMjNYle40gfI/jlmBrgLgF7070 x-ms-office365-filtering-correlation-id: 8da77de3-5554-426f-22bb-08d6303329cb 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)(1496009)(346002)(376002)(366004)(136003)(39850400004)(396003)(189003)(199004)(6436002)(5640700003)(3846002)(68736007)(2900100001)(478600001)(6486002)(14454004)(2906002)(72206003)(71190400001)(71200400001)(26005)(2616005)(44832011)(102836004)(446003)(486006)(256004)(118296001)(186003)(105586002)(2351001)(6116002)(106356001)(6512007)(97736004)(6916009)(5660300001)(54906003)(6506007)(386003)(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: A1TyFdn0OHlxweM58h033Oz3eooWUgS1urAJKvwWsUGzSjKiTH5mm3wahziTeUHXZMK6TDMMVvSmLe8MzVMV7j/vCRhTaYnFVXdpOn6L8zlRsRyUZtiUYzcsfQbIF22rl/DFqwGh7ydJI5k56fKH/aatUayYmTugOuhPg820wPWPveyPhQbnwYWih/nlCxb9WfeX2PUeMFOKEqQcYjyqYlBF0tWVFzjh96vODoQLDrEztO11AGVNjyzlDcYhRA+im2+oYAWukIAH/F+kEtarYYQiGmfpMeqQjW5wkDIUhiXrKaIEP05Wk9pkHKDeylOw/0aO6FQPCcMnJ1NbIMaDvfU1bzuMS84NUvJ0zLrt/Co= 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: 8da77de3-5554-426f-22bb-08d6303329cb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 11:09:22.7472 (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 08/22] net/atlantic: implement core logic for Tx/Rx 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:25 -0000 From: Pavel Belous Add RX/TX function prototypes for further datapath development. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- doc/guides/nics/features/atlantic.ini | 1 + drivers/net/atlantic/Makefile | 1 + drivers/net/atlantic/atl_ethdev.c | 14 ++++++++++++ drivers/net/atlantic/atl_ethdev.h | 15 +++++++++++++ drivers/net/atlantic/atl_rxtx.c | 42 +++++++++++++++++++++++++++++++= ++++ drivers/net/atlantic/meson.build | 1 + 6 files changed, 74 insertions(+) create mode 100644 drivers/net/atlantic/atl_rxtx.c diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/featur= es/atlantic.ini index 1b9cbf95077f..c603b7bfcd42 100644 --- a/doc/guides/nics/features/atlantic.ini +++ b/doc/guides/nics/features/atlantic.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Queue start/stop =3D Y FW version =3D Y Linux UIO =3D Y ARMv8 =3D Y 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 d756ad4c8b99..870eafba3e13 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -104,6 +104,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) @@ -155,6 +158,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; @@ -208,6 +213,15 @@ atl_dev_start(struct rte_eth_dev *dev) err =3D hw_atl_b0_hw_init(hw, dev->data->mac_addrs->addr_bytes); =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"); + return -EIO; + } =20 PMD_INIT_LOG(DEBUG, "FW version: %u.%u.%u", hw->fw_ver_actual >> 24, 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