From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730061.outbound.protection.outlook.com [40.107.73.61]) by dpdk.org (Postfix) with ESMTP id 676AD1B1AB for ; Sat, 29 Sep 2018 12:31:40 +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=XtJyIql02OHd9GRWhQ6MwDVzjo12OjDYAIWzlWT9HJI=; b=ouwBIdFxVfoqizOrHRM8XPAAulSJ1Uoel/g3yTX0d6YcPSrsls3xkDIuJpoDqusxG3SM+3uIFzcsDESeZ9sd5hDiGEGLtjUS5A8gC6Rj+HReIKBQbhZYUsjXuecQWddL+YAJpAj3b+odxYHf+Cwc6lVvB8LMyATjxmKerMN8NDY= 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:31:38 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com Date: Sat, 29 Sep 2018 13:30:22 +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: b69809be-22a0-4ca7-744d-08d625f6bd78 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:qJl7lyUynCibV9Yhx6sGOHR2fowFTCUkFR4my4OgU0nKhwym7+4Kjual3Wj9eeCYMPoJZ3MXfnozoBEPql7mCupgcUu/O8gzkhrVXBzl/eMj6+NDJsMmZnB/F0DGQLsS4mXdTn4rb0i7eHELWBLa3rdQ1O2rYiXkPCB+F0vB953CcDNvX9Ra7lZKi4/a3yZeguGS2up/SwhhBFcgwnDj9UYG923hTnHSHciANt/4yyqnP4ShOpshygOkZHTQV+da; 25:jocY9PcIZHqYU5kDbJpCf8/oVGaqyybInyQ7q8hoQwk6QWBEQ40K4SOeba50NBdM/q6yJl7aHX2Bd/P7DhKEZ1CwdnAuvw4sBCR+VhDaF2EsSz2wa/Ep6keFZuCx1sxX9FuKMBRxyCUIHXlpFeRFjNRiRUWjKPPV3Lv/GG6pECv8G0lqSKqc4VW/bJ/GvW8tyvlk7ousvluwt9lgHcrsESdW4MJ7W/N+r2vadT7TSZm++UswzErgKgZPgSsRSq+G8h36npSJ3H3a2FaedzdGQd21qh38yVQOq9++L725yU0UN95NTOQL18DWE52wUmvwPRhzPNWIkTWcHV/5aPEKSXr8/gCmCm9lXMdZuZfG4RU=; 31:9NiugVS8ZBED4nuWHmKHFWEnagkXkogj4MtIohwUe92rud4GZlLljyA48BalhrJwGW73I9CIFnFD9T91zTve8iLMHrFKvxgXxqWxamWNlxjNFCz9x5WN3SdrlL7aMnJWtygAlehuhDnFodRQVNU57EEoX4L7xAzYBQYeSDEUmW0Q7i1SddD8EYT97cKDjQOQX8moroFmvpzxfBTl87QnVfwjSN6MnMwe5TzS6o2lWKc= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:Yf5nkZpVsgVoeN8+fsKuP8ZzbnHAnQPciTUseKCe5PMbxjh6rY6rX4iKVuBMtI4ADYHRC3v+Ol+l3dxVKEQ9zYrPWdesAfpqGVW3DuIL6jyhVaCeyipK4khmGHjc5ZuarJ54u+WbiFNCz3VAIfsc+fXJ1iEXllxwOfJJ/jWzTmpj3UWAQ6PnWeMfwBdoGsO7Q9aak0sPkly2k8QT2e3ZubR2uYARg5JXNWpBSuzkoSDjd+ABAEhMJHTs3aDEd70Sdja1Jf77JzWZ34X3JVtkg+pu/1xtMgcCcbo0H0g01AQpXUizG3mZfxEXShegyznjX/bdn72Ew6QQ5C+fPGckMSLlEqydCrGgoYEM0KpHvDc2rIZQyouGrtaOmxkFbOem07cYkFDtHE3Xi/4i/rdO6r4qfxk95EG+OsC2HqF3l6wkPzFbhw7bnvAJkE5p3aEOIEe7vFxt7wnMXHC3Ztdc7gybCNYYryhnITSUbmUFevgTG1N5bYxsaorTeO4oovXb; 4:GDTSgRxPiqqa+Z1heLes49yRJQ67pt4+KawQA0OldnNhqpyiVJsvXcnT7gQReXTQvi+OVVQBNdJuaFTfkkxRLgUu9AV4/e2TswPIUHLZ7i+apxOGPOoim5vt8/XrljwG2+aU3e2RgosXCHjRqoZIzt2u5hph1FAMKvuI+AN0l6TFlTYu7fhiVnbVwJt83cJvsubZ1RVdrrTMTSb/RnorgnFnJwYr+15ujLsBji/eE6g2+/iXOnO1lrxu4k16t9kF/PY/Ga/ODX2ag6REghgcXg== 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)(346002)(136003)(396003)(376002)(39850400004)(366004)(189003)(199004)(16526019)(14444005)(446003)(76176011)(2906002)(6916009)(6666003)(97736004)(8676002)(81166006)(81156014)(36756003)(4326008)(316002)(8936002)(50226002)(34290500001)(575784001)(86362001)(5660300001)(68736007)(16586007)(118296001)(72206003)(3846002)(6116002)(53936002)(386003)(105586002)(6486002)(47776003)(66066001)(486006)(25786009)(305945005)(50466002)(44832011)(956004)(2616005)(26005)(107886003)(52116002)(51416003)(7696005)(186003)(476003)(478600001)(2361001)(7736002)(2351001)(48376002)(106356001)(11346002); 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:6DIrxSnln0hRm6qG04sn3ZcM6d5seaxc6DMtSS9?= =?us-ascii?Q?kFaiItYDaT7SAsMq+49lyRx8z6OCLBGwr5TF1Y/AnQ/9TC7fH8v1PBXYJ0b3?= =?us-ascii?Q?+Xgdgl93rpuRvMLaBbEgcS1YK7bu4VxOqMs/zWYYmGKgXxFt2tTJBIO91NuT?= =?us-ascii?Q?kJog9IA5pW4IQ/MBUTeUv5QW+AHeQE7PKZQsepfN1tDHrvonRi8wiIPpGKNj?= =?us-ascii?Q?XXYsBYUXqTuPO71j/7VpBP40gFy6UqTYO8x5s0vKiM73JgSF9pN8ogAFO93/?= =?us-ascii?Q?e6JvB21KmwJq35qCxqNaoAQ5poAFMNkJ4T1hkAfnpo5y6/3itqaOVsb3MIhH?= =?us-ascii?Q?6MvU/Rlg3YJT40pXpFhcfMkbSpNQUPMA2Qd1M8nUbp+IMSO5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GcgLsoL4qTCwogr9FvzIs/EJ5URKkeGjzLekHoLjH50Jq88PKGhFknarSz4MKoNl0CiRmlwj4sjptbcrr7cvYtBTPd4k=; 7:Z7bgIam4IxTmo3wmDJlaAmmq51e7xGFbFQMhR1lOAWeEJ/rpyD7J9Rlnesy8fbEnEf3IpM+KKmaloeReri1Y8gX5T+rA8FZpQ64V6kMvLTmbPFsvNiGotntQP6s3M/u2Rn8MU6Rl0kAEnK701yiF+OuPo4FaVh1VsEVHyRKHkM1UrZqJ2CEgkq4zmzryU4SWfs8gdxEtPZXCYNCtUa3PvPgTLTdCDGPiP295Jh3B8W0W6sUHsF5oVdzl2oAPaQ6x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2018 10:31:38.1411 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b69809be-22a0-4ca7-744d-08d625f6bd78 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 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: Sat, 29 Sep 2018 10:31:41 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh 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 += $(SRCDIR)/hw_atl # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils.c diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index afb2972ffcc2..4347f9772358 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -111,6 +111,9 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); eth_dev->dev_ops = &atl_eth_dev_ops; + eth_dev->rx_pkt_burst = &atl_recv_pkts; + eth_dev->tx_pkt_burst = &atl_xmit_pkts; + eth_dev->tx_pkt_prepare = &atl_prep_pkts; /* For secondary processes, the primary process has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) @@ -164,6 +167,8 @@ eth_atl_dev_uninit(struct rte_eth_dev *eth_dev) atl_dev_close(eth_dev); eth_dev->dev_ops = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = NULL; @@ -224,10 +229,23 @@ atl_dev_start(struct rte_eth_dev *dev) err = hw_atl_b0_hw_init(hw, (uint8_t *)dev->data->mac_addrs); hw_atl_b0_hw_start(hw); + /* initialize transmission unit */ + atl_tx_init(dev); + + /* This can fail when allocating mbufs for descriptor rings */ + err = atl_rx_init(dev); + if (err) { + PMD_INIT_LOG(ERR, "Unable to initialize RX hardware"); + goto error; + } atl_print_adapter_info(hw); - return err; + return 0; + +error: + PMD_INIT_LOG(ERR, "failure in atl_dev_start(): %d", err); + return -EIO; } /* diff --git a/drivers/net/atlantic/atl_ethdev.h b/drivers/net/atlantic/atl_ethdev.h index 0b5db79e1c22..53fbc0a17bd2 100644 --- a/drivers/net/atlantic/atl_ethdev.h +++ b/drivers/net/atlantic/atl_ethdev.h @@ -20,4 +20,19 @@ struct atl_adapter { struct aq_hw_cfg_s hw_cfg; }; +/* + * 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_rxtx.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 e7b4e0cba574..7575e471e306 100644 --- a/drivers/net/atlantic/meson.build +++ b/drivers/net/atlantic/meson.build @@ -4,6 +4,7 @@ #subdir('hw_atl') sources = files( + 'atl_rxtx.c', 'atl_ethdev.c', 'atl_hw_regs.c', 'hw_atl/hw_atl_b0.c', -- 2.7.4