From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0045.outbound.protection.outlook.com [104.47.37.45]) by dpdk.org (Postfix) with ESMTP id 4D5CE1B3B8 for ; Fri, 28 Sep 2018 13:42:16 +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=h2U/MSxabjubf2nRqY4o7HcyIzg7Ys/DVcAr1HpO9sk=; b=B2jQFKQPwrp8RzooeY6pFavVslpiM20FB7kha9xd1ELZzZxrgis/RoRH9/97A4gftBObRp59JU3AvaYtAK124eRwN9SLb3gdsFVW+FPjvUtYMUDV/LGyYZNt41GrpjIJs2ZQTtXm5XbGMR8To0j4P1uD1s2T+tT/07T7kRb1Wbc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from wstn-pvn.caveonetworks.com (111.93.218.67) 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.1143.18; Fri, 28 Sep 2018 11:42:13 +0000 From: pavan.bhagavatula@cavium.com To: jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 28 Sep 2018 17:11:33 +0530 Message-Id: <20180928114133.11526-1-pavan.bhagavatula@cavium.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180831103405.18214-1-pbhagavatula@caviumnetworks.com> References: <20180831103405.18214-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR0101CA0051.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::13) To DM6PR07MB4969.namprd07.prod.outlook.com (2603:10b6:5:25::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83f5e4cb-8c13-48a4-63ae-08d625376fc1 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4969; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4969; 3:H9dBb2kFnSrkvjlhn8Mh9LHpIxqXNRpjCFiengjPWIji9UkMyhk3kmJpbjaEvyv4gFkg1MVFvn1X9QCOPKPjq8XDYuH4dkC740Dcs9cFL+hRFdJ7vlnpLPEWnV6dmzWa7HDkNJBSyjfEnF043vIBel9dkmeU7umcncmHfS8hzeHtIhkdRD4qcKAYA9P+inshLYu/V4xqHuRn4OCLshVO4OKozCO+U7N85BNrYPefeqKFeQb1O0UWowOJNTA0LkyP; 25:Ne47zQxiw0HKok4vv6cQ8BxoVdNbQg6Orcs2vkP7Yxe7liPWpOuGKJp6X+H/MoN1ozcCU1LnxTDvM20/SXwfFoFSUVyUSkRk4F5W8qwGppGui2LmSU9zrRZxIrqFrosEJmRsqnDW0bOlUeFSvuxOjUSenrjSxZOivi8RwRyOggLU1zYhuXoqC+UXMW3XJs5427FEh7dxdml1vb4DLGp+GP0+nMocKLvpKPiXl/7UkNm9zv+1P+ATZnn7S2tM4a6ZWeo5ZNhKOk7oCm8tdaBHnunDysxYcfzdD2FvEn/Ll9hjz06LzMnef0kO/NnmHw9n+8JM7gUnTB20TcCpeRZang==; 31:tkVOAWNnguBoi/QNoViUJtc86ybsoVntyA1qCDBmhUoZ+WXNlHzDT+GnBHPt7z46mU9JqgmnNy0+jVF8EeheGBmqfQX8qjUAq8QpzOCaOMeA9rULZumbdH4zsQQoWNIRryiwx2dsz1BQqL/9B02iXGeiXlFriie0gDDFYCjovNtRN/CqwA9rTjE8xTUEYxw6bNpwe0qAYGaXZCT7JkFhLHRgbkpk7ascfB4nYlvuAo8= X-MS-TrafficTypeDiagnostic: DM6PR07MB4969: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4969; 20:czD3gZ0F/wca0nMThYqw+907Hh4aut6lwkM2JZ8ap5lTLeYrtYovDGlIzYwtK6c7invgh2MUMD8VD+zT2TGIZ+7H4pNohfa16Til37TvLf2VIPnhOp5Tmneraw4/08qOdwc8ByHd3tICaukbC1f3N9K07Cr3QgROWamH0bNEF4jARFXlWlX+5x9a9XNhDqZujBiUVL1eyC+ZdlRPVX3lWxnUCL/yIkgcU6UlLvCQ+GQKrSNBAjXHHXqJbhdHWGgGJnt1P6RxtZ4cvAfhJ7cMGOl+PNKKWYOWCagS/A8T2yIkGpONF6NxSm/el0YQu5PnkXW6afyGspYyO8EtQqjckngTYGV8YZyxUF/dWlvXXr6og/nnGZb3QIMknmekbzWr4QRPVcX7SiG2WxwgFgqTIFCxY6xQC5JUMdPnimyFlmzhknn5rJn/yC/HxXd2e2z3tib8kD97fYdnz1V9++hZ5Z3wVBvx32Q/yC/SQL3dKUz/+t6MWdg3oTtUZDUYMLpf; 4:uTs2TxXGnF75sNEkObjM1+eQGS+ozAXPyG0kFSnVPaHSs8hBAZ5w/2lmERexryK4YqkEy0yeOqCBpkABq3Sa2ePulKyBimfFlJsDORVZcfWuXZkT8SKGhqMWFpTWSRlwd1Sdnan7LPXCevTEBn5/ICcYnsicu9fM3KVztxlu4nAm4cvv7fePL59AL5Kz+3nKWz0QGNKYOuHgHh9Eagea5B+u62IDh733sglyQ8c+9kQo9Z53zwvwzbLK0/3Vq9ZLnldTSGFezSLyHE1z7byHbQ== 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)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051); SRVR:DM6PR07MB4969; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4969; X-Forefront-PRVS: 0809C12563 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39850400004)(136003)(396003)(199004)(189003)(106356001)(446003)(69596002)(50466002)(2870700001)(1857600001)(48376002)(476003)(2616005)(3846002)(6116002)(53416004)(5009440100003)(2351001)(1076002)(105586002)(486006)(26005)(4326008)(16526019)(956004)(11346002)(34206002)(478600001)(97736004)(53936002)(6512007)(9686003)(6666003)(305945005)(36756003)(66066001)(7736002)(51416003)(81156014)(81166006)(316002)(47776003)(8676002)(6486002)(5660300001)(86362001)(50226002)(68736007)(107886003)(33896004)(34290500001)(386003)(52116002)(2361001)(76176011)(575784001)(72206003)(8936002)(2906002)(6506007)(85782001)(25786009)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4969; H:wstn-pvn.caveonetworks.com; 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:CGA9If8JsoD8XlcUfG7PM3Sgfu0WpdypJAyWwTK3c?= =?us-ascii?Q?DrsbzUiVvRYNzDD/x5k0pBHJrjEyKk4rbeYQSl46qrCmmIODEdZf4seztLRm?= =?us-ascii?Q?0TP3Kmqo3oRv3jGpDREM+jXGeLpyKJdCy0HdYZdQ82DiT+GWIkmSoOzL52AY?= =?us-ascii?Q?jt4vyPT64fc+Cuw7eE/EaT3IDtr4aCVIoM11h82riwKIMCdHD6kNUEti7wkl?= =?us-ascii?Q?85vxXShB5JuzzlbHXuJbKnGBkpmX+RhoE5xEhE0NWzpE1G5cc2qzdi2q7/kA?= =?us-ascii?Q?/SGL2zfNRFTiwwNj3xevSV7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eDArZARMi7zbDd/MURGfvysA+vEDSosvtmLA39axjQk9HoNq1ayBrEuc/eKWTFsD3n+P78B0m0ec6/eMIG+NP4/K+DfU6npfhIWBQzp6wF9SWlKLtVBxSHvsQze4NCaBu4o+IOR+u5eaZdL/GQmCV0auypf7BmiJ/j+S4JT6GA2AZejn8wUTxNm6wcAY7/N4iYlbzZT5dbkIfOG43tYWxQ==; 5:YtZ28H202uUELUw+aK/9zfcPZ01X1y1qOL8PtXz80WsbX838yz6zZSg7mB76AFTGreF3MtaqZl9/UvqM0MS07We1GSPWlpyPISbEfg3nwNpyOxqcfhWn2gN+paeTlGcAyTtBTPtZ0buOaz0sx/dTHYs6N9oR6V4eeRs+A3sp0YE=; 7:ykI515+gX+bHNc5XaJtEhqVnV9ntVPhjGBobE7RfcYRohT/L0JXYy2OOIAxFcagxkkZFD6GkuK1L6fmcYsoC7J/lzC2XCJu2u6K9jFX65s36aNl2c4amlD4XsAI6GNvVGz8uB4mrB6WRlUqzNkCDVQeH2dQDTZR9DCZpYcF2baMX2dmNGFUGKRNiotdahbkvBSpmD/Ppcax0tPxECJ1H1IiAU3tM7E2ubKItqCZFmHSu38HceFklcWsk5kr5jPim SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2018 11:42:13.2721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83f5e4cb-8c13-48a4-63ae-08d625376fc1 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 v2] 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, 28 Sep 2018 11:42:16 -0000 From: Pavan Nikhilesh Add Tx adapter support and move few routines around to avoid code duplication. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - Fix shared build break added -lrte_ethdev to LDLIBS list. drivers/event/octeontx/Makefile | 2 +- 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 +++++++++++ 7 files changed, 162 insertions(+), 35 deletions(-) diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index 90ad2217f..2e07890b9 100644 --- a/drivers/event/octeontx/Makefile +++ b/drivers/event/octeontx/Makefile @@ -17,7 +17,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lrte_eal -lrte_eventdev -lrte_common_octeontx -lrte_pmd_octeontx LDLIBS += -lrte_bus_pci -lrte_mempool -lrte_mbuf -lrte_kvargs -LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_vdev -lrte_ethdev EXPORT_MAP := rte_pmd_octeontx_event_version.map 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 f861313e6..1e201f322 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.19.0