From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0050.outbound.protection.outlook.com [104.47.34.50]) by dpdk.org (Postfix) with ESMTP id 6E16F2BA3 for ; Fri, 31 Aug 2018 12:34:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IKOrYMJDfnD3OiyfLrAzA6LG8seSgdZ7i1UAT9joBKA=; b=B/bEpCsbseNOui+m7E7iT3NPEcrhEb5wD2RKLWMS26XmOwSi+8XJ43xz0K08NvVE+Hcf3s4LFUuU8rJLUnntm8XLNEBa19UcyxVeVvn2LRiLBbFb51Q5m+TttmOMPq5T6oKa1AWoHZxIwli4uWd/QRBEL3zBk/LVF45zQFU+bMw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (115.113.156.3) by DM6PR07MB4969.namprd07.prod.outlook.com (2603:10b6:5:25::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Fri, 31 Aug 2018 10:34:41 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, anoob.joseph@caviumnetworks.com, nikhil.rao@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 31 Aug 2018 16:04:05 +0530 Message-Id: <20180831103405.18214-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: MA1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::27) To DM6PR07MB4969.namprd07.prod.outlook.com (2603:10b6:5:25::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ecc0ac2-cd93-4227-61a6-08d60f2d5e88 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4969; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4969; 3:oEPFG3B3avEk8+Lu+b4YN0Gx1Lga/5A2TK7iWwtdvPv4mDayHZcytsZ6ythdOm8vNUHz1UvtSIOUykrS86WKoEw8YdVLx57VXL6SwOfsC2jvYvJEue2gkxvuyvfFUtQvP02109Sm5KvJ9EYHnz9SBKZak+reIzvuxkkSDWi405hbctILBGpRWYguqVTwrHpTrGwKFce/bK9nIBbb+lq7xV28DsplWw/lWtXvKI4nPt9wlbr19dP9Az1UllALGMU6; 25:N9lqjtHE2C9e9rEoI87vYZ/N4jEld9nwDdpJZdhw95xKZ6FvTec+fKpS/3lzSZ9Z+OmzFTI3EX8dU8ErnAfG4bk3pwRtZqxDlOOWfPz56SJec1/GAeFf+S0pifv0gJ1qORMyD/qPt1Gokc/GakZDvDvNQStJPW9BTJ6cVa9q80CdR7bEnIxacr4CQEWGq/Z6aREUO6VgcicmzC0H3GMY4HNhCjeExZNrNjGQR7xBMNU3wx8sxoXegqUhL5axG1d9W86sj8eAGygI+y+u9lOhxzlo010PoQpZag5/KdKhJ1wVY8dUdMq1rK+ZCGNmF6R4CSKvl3q2LI1sqdUC5nr8fw==; 31:jt2Vs879rKzMroHj0iOCwWWNpZdIQ6E7A5WqfnYsh+0Me9VJPS65uoYxMBDkq3ofbPAhbdOIqey9WduhVxsYEDjWLWbNT1dGQXF2zqPg/wEkVadoTFmL5NuoJUaVh5T/gPb5dzKC5j95e7qrgGmy7gTP6pJLRHiSEFY8UFgpFAK0Ncf+ywmrU2QUDS6CKZq3J9OgkaUlJOQCyUZmxjISfTNAon2SSxgCZUEQ1QqqPYM= X-MS-TrafficTypeDiagnostic: DM6PR07MB4969: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4969; 20:fkpYNrNlRw5dQXn54Yww8vuAbN1TCvefKD8GSKzB1TUFz/rHBh5pZSGNLO4QNZuRUbAREyva8KhCoElGA/bxWyzHMd44Xo3u7vC7/xWEJW9ODW9UlSHtvheQnCBgKGeKNYjQuE2jOuDv9rbUK0u8M1xsU/Sl6ju0Ae7hdh5uJBd90wO3RD6VjXcd6N9jCZUO2dNDitsmVcEdj7ZA6RZejG3l755u3DLnUrsAT8Y76DT+Gwgf+pFKvfLgL7nK6kLLbqKg4qnKMk76Eh7jF6ZK1bjdiY94Yjwc1ubqnQ0mX32SjU/DwL4VLKTu6VOlpsmHPlrStAZeoFrTKrhfKBtrdkWPYMeIBBdX0rcE9luKS5y4f4JIkKvLeZ4ojfwkBYu/Fn6awDIFlJdffeLXfzppBOZ+3pA/fy0WzCL2VkP3GjE44H9/35KQO+xINfpmHaPA52NegUNts1wI0yIKNM0vnMYh2CtJ1fdaV1DO40obieKSGosPAj4tVs+WNPIgF0jtETy5z5SYcbvtmMVMW97rRGfjmj6bGVZ8i75ksRm4i5aCOdc6nTSU9wMlIdVvtkDGw6GUOwyOmyL0pWAvXjz7KtD1GT7m/UI6vRZkuUZXlvg=; 4:s8L3q7Wldq4ibIncj/NS+fbMhdHEPxqw4ym5y/st1sA5CQ9VGCP8F+MRL//FqlbNtnq7XnEuuWfffIVFvLfDXJIffYljxR8gV8waTgwlr9c6Y2uaHsQSL/MpzNEXzpZjRv3xoxWuwTCl9L0VXH3qd5OP2jLbKYozZ0OqbmIGew01X8Xicu0Ph+YRUDBb/UdbKJ1/h1A1RIVuvQqMIeaW9DnbULdHqtJLy9I9YBmxBN2JuWL8+DiM7gBq10WCQP0sTtGRRKln58aEzuDQMnLTyA== 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:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016); SRVR:DM6PR07MB4969; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4969; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(136003)(396003)(366004)(39860400002)(376002)(346002)(199004)(189003)(105586002)(6116002)(4326008)(25786009)(1076002)(6666003)(16586007)(106356001)(48376002)(36756003)(97736004)(3846002)(486006)(53936002)(72206003)(966005)(316002)(50466002)(6486002)(51416003)(7736002)(6306002)(478600001)(66066001)(386003)(6506007)(956004)(5660300001)(575784001)(476003)(26005)(1857600001)(52116002)(81156014)(16526019)(2906002)(2616005)(8936002)(8676002)(81166006)(305945005)(42882007)(107886003)(6512007)(68736007)(50226002)(47776003)(69590400005)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4969; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4969; 23:t3oujHTkvSKoGz2eFfSmzT46y92l/AeuwMXKLyVNH?= =?us-ascii?Q?XGt5PgzQVRFP/K5TnsSaRim3ZWE0gYBjXGkEq7NKRFfFyOvYpcPNFwHGPYPf?= =?us-ascii?Q?WPfqe5pP4PgWPI8CAXCBUb3cumxZpBBfDsdlNF6WQFvOg3AVocAbpavwVP/n?= =?us-ascii?Q?AxeGOU08i1c/rmdkZ5TZ/6oF00h6o2VVxSgrDSa42BO9Ed/udbkJu7Ubd870?= =?us-ascii?Q?joQiXRHEBS1cxAF6N/Iq3N90kRwnthK8hWx8NvpZrHKDe5E5dvuaOZMMaHtj?= =?us-ascii?Q?l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neKOEv7m3Iqh71g==; 5:jrdIzPLVUZ5NzyjbJQzSy2sWuP7c+2Ur7wrhIdDqQRSjQ/gv+cfVwcE4DRDaHDImkhuA87FpLfxX01t7zEG4jmUN3+tNgYQYzLE+VDMzkoFhtXfPdUXcaQ9IdHMjTd1K8VNTGntByyHsTzJXFdf1Ur7HcNiMfBWbhc+JVwaLATM=; 7:Es+975+VNG6QP6mtPZkIIqS1WATIKtIPp6Zpju7QAd789TkbJoZyvT271WpoNhNmag7jeVVDtc2L/750KqR4WCjdTnCBbOmFHizFQOtgscJAHWhLxdXODU/mxDZrDX30XxQQM5jjzBpk2TiBeZkdIi8jnnyGCMmeuVLzjmSydoEWC4nhMXlTyAP/CFOogv38H4jy8TioeOItxfRgpncAhapPpwAaKhqJPGy5qGRiQRGY0eG9IQ2s+9uJrtJ9RTjO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 10:34:41.1557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ecc0ac2-cd93-4227-61a6-08d60f2d5e88 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4969 Subject: [dpdk-dev] [PATCH] event/octeontx: add Tx adapter support 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, 31 Aug 2018 10:34:48 -0000 Add Tx adapter support and move few routines around to avoid code duplication. Signed-off-by: Pavan Nikhilesh --- This patch depends on the Tx adapter series http://patches.dpdk.org/project/dpdk/list/?series=1121 drivers/event/octeontx/ssovf_evdev.c | 80 +++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 3 + drivers/event/octeontx/ssovf_worker.c | 44 +++++++++++++++ drivers/event/octeontx/ssovf_worker.h | 1 + drivers/net/octeontx/octeontx_rxtx.c | 34 ------------ drivers/net/octeontx/octeontx_rxtx.h | 33 +++++++++++ 6 files changed, 161 insertions(+), 34 deletions(-) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 16a3a04b8..c5e891cdb 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -146,6 +146,7 @@ ssovf_fastpath_fns_set(struct rte_eventdev *dev) dev->enqueue_forward_burst = ssows_enq_fwd_burst; dev->dequeue = ssows_deq; dev->dequeue_burst = ssows_deq_burst; + dev->txa_enqueue = sso_event_tx_adapter_enqueue; if (edev->is_timeout_deq) { dev->dequeue = ssows_deq_timeout; @@ -491,6 +492,77 @@ ssovf_eth_rx_adapter_stop(const struct rte_eventdev *dev, return 0; } +static int +ssovf_eth_tx_adapter_caps_get(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, uint32_t *caps) +{ + int ret; + RTE_SET_USED(dev); + + ret = strncmp(eth_dev->data->name, "eth_octeontx", 12); + if (ret) + *caps = 0; + else + *caps = RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT; + + return 0; +} + +static int +ssovf_eth_tx_adapter_create(uint8_t id, const struct rte_eventdev *dev) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + return 0; +} + +static int +ssovf_eth_tx_adapter_free(uint8_t id, const struct rte_eventdev *dev) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + return 0; +} + +static int +ssovf_eth_tx_adapter_queue_add(uint8_t id, const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, int32_t tx_queue_id) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + RTE_SET_USED(tx_queue_id); + return 0; +} + +static int +ssovf_eth_tx_adapter_queue_del(uint8_t id, const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, int32_t tx_queue_id) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + RTE_SET_USED(tx_queue_id); + return 0; +} + +static int +ssovf_eth_tx_adapter_start(uint8_t id, const struct rte_eventdev *dev) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + return 0; +} + +static int +ssovf_eth_tx_adapter_stop(uint8_t id, const struct rte_eventdev *dev) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + return 0; +} + + static void ssovf_dump(struct rte_eventdev *dev, FILE *f) { @@ -619,6 +691,14 @@ static struct rte_eventdev_ops ssovf_ops = { .eth_rx_adapter_start = ssovf_eth_rx_adapter_start, .eth_rx_adapter_stop = ssovf_eth_rx_adapter_stop, + .eth_tx_adapter_caps_get = ssovf_eth_tx_adapter_caps_get, + .eth_tx_adapter_create = ssovf_eth_tx_adapter_create, + .eth_tx_adapter_free = ssovf_eth_tx_adapter_free, + .eth_tx_adapter_queue_add = ssovf_eth_tx_adapter_queue_add, + .eth_tx_adapter_queue_del = ssovf_eth_tx_adapter_queue_del, + .eth_tx_adapter_start = ssovf_eth_tx_adapter_start, + .eth_tx_adapter_stop = ssovf_eth_tx_adapter_stop, + .timer_adapter_caps_get = ssovf_timvf_caps_get, .dev_selftest = test_eventdev_octeontx, diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 18293e96e..b1856c15b 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -5,6 +5,7 @@ #ifndef __SSOVF_EVDEV_H__ #define __SSOVF_EVDEV_H__ +#include #include #include @@ -179,6 +180,8 @@ typedef void (*ssows_handle_event_t)(void *arg, struct rte_event ev); void ssows_flush_events(struct ssows *ws, uint8_t queue_id, ssows_handle_event_t fn, void *arg); void ssows_reset(struct ssows *ws); +uint16_t sso_event_tx_adapter_enqueue(void *port, + struct rte_event ev[], uint16_t nb_events); int ssovf_info(struct ssovf_info *info); void *ssovf_bar(enum ssovf_type, uint8_t id, uint8_t bar); int test_eventdev_octeontx(void); diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c index fffa9024d..d940b5dd6 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -261,3 +261,47 @@ ssows_reset(struct ssows *ws) ssows_swtag_untag(ws); } } + +uint16_t +sso_event_tx_adapter_enqueue(void *port, + struct rte_event ev[], uint16_t nb_events) +{ + uint16_t port_id; + uint16_t queue_id; + struct rte_mbuf *m; + struct rte_eth_dev *ethdev; + struct ssows *ws = port; + struct octeontx_txq *txq; + octeontx_dq_t *dq; + + RTE_SET_USED(nb_events); + switch (ev->sched_type) { + case SSO_SYNC_ORDERED: + ssows_swtag_norm(ws, ev->event, SSO_SYNC_ATOMIC); + rte_cio_wmb(); + ssows_swtag_wait(ws); + break; + case SSO_SYNC_UNTAGGED: + ssows_swtag_full(ws, ev->u64, ev->event, SSO_SYNC_ATOMIC, + ev->queue_id); + rte_cio_wmb(); + ssows_swtag_wait(ws); + break; + case SSO_SYNC_ATOMIC: + rte_cio_wmb(); + break; + } + + m = ev[0].mbuf; + port_id = m->port; + queue_id = rte_event_eth_tx_adapter_txq_get(m); + ethdev = &rte_eth_devices[port_id]; + txq = ethdev->data->tx_queues[queue_id]; + dq = &txq->dq; + + if (__octeontx_xmit_pkts(dq->lmtline_va, dq->ioreg_va, dq->fc_status_va, + m) < 0) + return 0; + + return 1; +} diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index 7c7306b51..d1d3a52ae 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -42,6 +42,7 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) mbuf->ol_flags = 0; mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF]; rte_mbuf_refcnt_set(mbuf, 1); + return mbuf; } diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c index a9149b4e1..2143f9e8e 100644 --- a/drivers/net/octeontx/octeontx_rxtx.c +++ b/drivers/net/octeontx/octeontx_rxtx.c @@ -19,40 +19,6 @@ #include "octeontx_rxtx.h" #include "octeontx_logs.h" - -static __rte_always_inline uint16_t __hot -__octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_va, - struct rte_mbuf *tx_pkt) -{ - uint64_t cmd_buf[4]; - uint16_t gaura_id; - - if (unlikely(*((volatile int64_t *)fc_status_va) < 0)) - return -ENOSPC; - - /* Get the gaura Id */ - gaura_id = octeontx_fpa_bufpool_gaura((uintptr_t)tx_pkt->pool->pool_id); - - /* Setup PKO_SEND_HDR_S */ - cmd_buf[0] = tx_pkt->data_len & 0xffff; - cmd_buf[1] = 0x0; - - /* Set don't free bit if reference count > 1 */ - if (rte_mbuf_refcnt_read(tx_pkt) > 1) - cmd_buf[0] |= (1ULL << 58); /* SET DF */ - - /* Setup PKO_SEND_GATHER_S */ - cmd_buf[(1 << 1) | 1] = rte_mbuf_data_iova(tx_pkt); - cmd_buf[(1 << 1) | 0] = PKO_SEND_GATHER_SUBDC | - PKO_SEND_GATHER_LDTYPE(0x1ull) | - PKO_SEND_GATHER_GAUAR((long)gaura_id) | - tx_pkt->data_len; - - octeontx_reg_lmtst(lmtline_va, ioreg_va, cmd_buf, PKO_CMD_SZ); - - return 0; -} - uint16_t __hot octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h index fe3e5ccd9..d0d73b304 100644 --- a/drivers/net/octeontx/octeontx_rxtx.h +++ b/drivers/net/octeontx/octeontx_rxtx.h @@ -100,6 +100,39 @@ ptype_table[PTYPE_SIZE][PTYPE_SIZE][PTYPE_SIZE] = { }; +static __rte_always_inline int +__octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_va, + struct rte_mbuf *tx_pkt) +{ + uint64_t cmd_buf[4] __rte_cache_aligned; + uint16_t gaura_id; + + if (unlikely(*((volatile int64_t *)fc_status_va) < 0)) + return -ENOSPC; + + /* Get the gaura Id */ + gaura_id = octeontx_fpa_bufpool_gpool((uintptr_t)tx_pkt->pool->pool_id); + + /* Setup PKO_SEND_HDR_S */ + cmd_buf[0] = tx_pkt->data_len & 0xffff; + cmd_buf[1] = 0x0; + + /* Set don't free bit if reference count > 1 */ + if (rte_mbuf_refcnt_read(tx_pkt) > 1) + cmd_buf[0] |= (1ULL << 58); /* SET DF */ + + /* Setup PKO_SEND_GATHER_S */ + cmd_buf[(1 << 1) | 1] = rte_mbuf_data_iova(tx_pkt); + cmd_buf[(1 << 1) | 0] = PKO_SEND_GATHER_SUBDC | + PKO_SEND_GATHER_LDTYPE(0x1ull) | + PKO_SEND_GATHER_GAUAR((long)gaura_id) | + tx_pkt->data_len; + + octeontx_reg_lmtst(lmtline_va, ioreg_va, cmd_buf, PKO_CMD_SZ); + + return 0; +} + uint16_t octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); -- 2.18.0