From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0045.outbound.protection.outlook.com [104.47.38.45]) by dpdk.org (Postfix) with ESMTP id 3D8A41B489 for ; Thu, 11 Oct 2018 12:35:15 +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=gEeC4Z6yf1O+Ii7gjwM9oS/jkudXEy4QZwMftlnfVP0=; b=ESZkWbm1DSuAog2HmRK7gDjiuJfWrgWr3QMyNv7zIuJcYwKOWJZVrfVXTRcHAxJ4xvtu4cvanFyuZz+ckFLUUoTxwSXEAgQdym2PImk45SoEPyUguBZQ3l3Yk33A0s1VQG+S8xt6rV09bBLPCVrYorsmqSNavCEXArWDdzvmEpA= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1206.namprd07.prod.outlook.com (10.160.105.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Thu, 11 Oct 2018 10:35:13 +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; Thu, 11 Oct 2018 10:35:13 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v5 09/23] net/atlantic: initial support for Tx/Rx Thread-Index: AQHUYU4Xi8IW/qQfpEG4jrLoOqkggA== Date: Thu, 11 Oct 2018 10:35:13 +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: VI1PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:803:64::23) 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; BY1PR0701MB1206; 6:z7bYc17VojOtN6KOaLmDvXPWLsYE7lTprmgOO8FelyNQcc70kQFH1ylgk5B1/ofcwFzdbUqLKoTYQjc4rmUJz5hQyVEMhRSKl1kcNjrrwaNHVgRNue56dtp9tx9wyY9p/g+DSPe/07y5/MmRCbvLzE1Z7qSXVgYndSAp7afQrC5+1kdkNaQfbm7h9I7AbnMUzSjyKxlUZxMd1+qsRdj5pMBnsywBMcafyv/a6ENpv8jnO/Mft/cbpSi86eRR5sEEv+8jQAW52dxHFj2J2LBXt0N0zzVo3ahIaEJVH4d6cjwV+cqTvNimjAEwP+4E+gC6GIhJh9eLyvtMbpxLjyQAd/VYFgAmjs6AN/ijmKSUnMhvX3asky0cKljSvOd/wv7TLvxnd1Ppf5zQ62J8bhqxNnJTRM5JIk+xpnAL1pZJQB/Z68Sc1oSErGcUWen3yz/Q5foJYl2m/X6l7t2Tuw9r63KwdTgwUUCCWq+AWCo4WDw=; 5:KUuZ3GwPAuH4cD2Zn5fhjkOJh9EtWR2AV4NB8bnqUdDZtzR9yG20MuuVa0J5Y5b9mLhMa+3iYLFr11rp9UxEHFScZnsFnjGeqHjv+UTlvNLw6stX1qizRRZCf1c+JOZgbTgFVddXv38CWiKYEtKsbgozeX+U1rH4+1wY0nHtaO8=; 7:0C4HMt2CDu+0gr67PbIsj5N+ZmuiREl9UK+W0Q/FBKWk51dD2XtpzH3Y2gcpFKTP1p4AD6dRRfVaSwbY6S79iOFaY7etgps4arx6bEjzNJgeEroDfDGmzgINHC22jl3YhjHGmK1jtwkZxhBr9De44Q0P2N3rkRbO4cOUSK/Kx2zKZBV91i3fyD6f9Y11fRjaP2DehDSNkKlyjUBWAdmHW2GERa/cywi7E0FqFFmBvlPL6F+LMmETYqNyri2zROI3 x-ms-office365-filtering-correlation-id: 31d55a3a-49b6-43db-e0e2-08d62f6539e9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1206; x-ms-traffictypediagnostic: BY1PR0701MB1206: 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)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:BY1PR0701MB1206; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1206; x-forefront-prvs: 08220FA8D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(346002)(136003)(396003)(39850400004)(376002)(366004)(189003)(199004)(486006)(14444005)(256004)(2351001)(25786009)(186003)(44832011)(2501003)(26005)(6436002)(6512007)(118296001)(478600001)(5640700003)(305945005)(71190400001)(71200400001)(72206003)(4326008)(53936002)(66066001)(7736002)(8676002)(6486002)(102836004)(36756003)(14454004)(81166006)(81156014)(1730700003)(386003)(6506007)(6116002)(3846002)(446003)(54906003)(68736007)(11346002)(476003)(99286004)(76176011)(52116002)(8936002)(316002)(2616005)(86362001)(106356001)(575784001)(5660300001)(97736004)(2900100001)(105586002)(6916009)(5250100002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1206; 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: UJd5Z1xVut2bVZaXBylZzfWBCpL5X1JDmVwzgbRBhu98pepfT25wJN3Fz1IwORHKJHbWFRLQB8SE1RRPDketGyl1wlw3/7XJ3BAUQE//KjKkJlGstEyS440YVMvumggnithz8IhJq9cnS6PT2XeVlM+YYHXgMGpFdrfeRnVhb70ErsRFjV0lm5mfymgjGIWbWQl1dCrLWNgDRrOSrEIPSSsB7r0IINEVRdpdtHHuO6vhKY/NU/C1OfxW+DcRM6M7hmHOW7uM4xN+XDFyex7DIgqQhWcBCBjgGONyPrveKZOyQh5xnpT2+O0coNppeRP2PGRoqfNf4ke/zmZRCxoHoQ7XcyhHxMyrX4arVA3HpZQ= 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: 31d55a3a-49b6-43db-e0e2-08d62f6539e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 10:35:13.4899 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1206 Subject: [dpdk-dev] [PATCH v5 09/23] net/atlantic: initial support 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: Thu, 11 Oct 2018 10:35:15 -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 c1096fd168a9..9ffb3f61577d 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 x86-32 =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 acf851e39388..91a7e3cb530f 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