From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0041.outbound.protection.outlook.com [104.47.42.41]) by dpdk.org (Postfix) with ESMTP id B2D0B1B73A for ; Tue, 24 Oct 2017 10:11:14 +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; bh=zfTH9baciwx/Ah9Q5fS558vIwrzPT494EMtq3GPexPQ=; b=MrN8sxjl6bkgfAbYlF59z5z4cyTMC91nE5joxjr0l+jSmG3dluzXtPBRDMThurv7COiYt0XRQsOOedBh/c6ZHydtGRGi1tNezUFfPu72bIRBYT6fdeXzrlawPTCm9L2i9Ed7S9hJAGtG5pOcKzO8gFUfuOC37HJHmEub+Ms6iYU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3461.namprd07.prod.outlook.com (10.171.252.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Tue, 24 Oct 2017 08:11:12 +0000 From: Pavan Nikhilesh To: nikhil.rao@intel.com, jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 24 Oct 2017 13:40:41 +0530 Message-Id: <1508832642-21984-2-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508832642-21984-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1508316342-17781-1-git-send-email-pbhagavatula@caviumnetworks.com> <1508832642-21984-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0081.INDPRD01.PROD.OUTLOOK.COM (10.174.208.149) To CY4PR07MB3461.namprd07.prod.outlook.com (10.171.252.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88c85643-6542-45de-28e7-08d51ab6cb6b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CY4PR07MB3461; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3461; 3:SHcxqn5uR6S7VQ1kJKco/4aDor20o6nJ5k4uJ8/K3Uy7gOMqe32f5qI79Rc0YhNfVyj9TzbZp4Ebq261h3JVzvxHtjBGFPSt7V0MBxpyuImH8vWtU3+g64I0BPNlT9YsMZxBI+P6aQbZ+fntGAExlQUAwsCt4xEz5rRdZVPcdhAOScGNBzYESoZMM+9Yq89gkcMUGewagJiy/1Lys4Zo81HHqUZQFr6YQI554tOLdd5WW98fFEFCQVPrW241v+1h; 25:DvH4NCOoope8ZLyOHSfiOjGLgcrsuzengZql3m+GGCm1JoStOpUnbmvNe6E1Q0gTRgfh3/YQlMqaEto+wxygM4WOMJDa3RszRD0L+EuxEJptmHvqxe8kZcnDsT3IxyJdNqW/UJByAZzfhrX1mhWA1lNuuFd90BUg5j4VTiNXoUNIol8WyiIYq+kRYNTYnjzTKXsBClv55ziiwQn4Dv0lDHdnKTzh/o7tOToj2ufHFtPQ3BhmgiXD5y8/MZWsvcAxAODetDh0eUn6Wbm13V81k8GqL2+5lZTfL/ABFkz7kxNEFJWVkU121zHtFGftDofJwhgEnFnqget4P9Z7tstZAQ==; 31:XOaDaLRJXEUp6J3Qiv4Ib5JSehcBOs1tlGVfuZTh7n+WDrBGPAcFDyQKa0gHR+atnWeTjX2Yq1oFboKri/IAgjvIJ2ifX2d5Iol3VqRcsqG3Yof/uhVLUrWFXSSt+31AoUOCb9CmhEZZ+gAXf85rZlzpllqdAsU+7S8UX1RJMO6nNDuu/V9Ofa2t1AcTvb1pizcc6i6ZlcDJkZik0sI2CmnBKFs6tcw0UYAnw3EJmwY= X-MS-TrafficTypeDiagnostic: CY4PR07MB3461: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3461; 20:UnOt4gnMiCqEtTln8Ee3vSN1RZiDS0Yh1xlD37TYa1I1M+n0jZ3xhSgvyV8eivfKKSoZ70GWvsirfZKEOi8DLONV/k+OofNC09fNhYdEotO8qNYSjpnNbKVrcHCZoXoU9ZgZdDAFN1DF5BszWqYclLawmGeOnJtwup78AA1hXS2WSOOq1XPDLQovV+rDeFjjl/AQqmGJ5RQNarOLckX8eoKSXKZ3vPMShiAeg1YFgwDzSXaSaD2TdD/GrWPYHFGWvfTwwB1DWMf5fTxuN9nR+ZrshSI4ZhE4QTeZO6jy5ANzDn81q1Jte3xmM28P1J3BkzyO7ocKZ/qSso0MbT6Sya+0VYe1SD4LLQ6tv8Hks/eADVHLzhmyWzO4YbMi/XPvecg2VPthzSse3fl8GhN9xYXs0JAr6ve0dj4JzqjQ3LsqSykXgDbSFY0yWDcQanSwdNPwkR7ki7UOarcnV417cTtKlpY6tbEX76qcx1phvM/ginJ2lVEA4uKG5QF+amR+GQ1/CPRw2jUma4WPyXas1QNCkkZvbLT0Dxzm2aCb16lB8yUtODPO86p0bnhLDjw5igUCLwdl1q75uErznsFHfkih1Z6mz3WJC2941jDx208=; 4:MQyZRO8UjihYf31LYvUMF2mpsQwGXCWw9+TGxpt+CkdF4AMGX7O4v8KNYcbRrTTPefwulJgDLwyO4kJqiyQzV96tsYuN15FqV1/YpxHIpsAUlzZuoN6yYscyyv8G5A+aywngF/Wjgsii4RQvPrdpyg7wgyc9CZNmWxYEYpsT9CztvTnrmBcrwXlmGNkSSophYXLBBT4Pdl5zBVQgFjQ/OBro7d3ZA31zjXCslSGrn5ePqmTi91K+/keLgAXA78YM X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(3231020)(6041248)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3461; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3461; X-Forefront-PRVS: 047001DADA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(68736007)(106356001)(6116002)(53936002)(36756003)(478600001)(48376002)(72206003)(50466002)(6512007)(107886003)(25786009)(50986999)(6506006)(5009440100003)(105586002)(6486002)(53416004)(101416001)(2906002)(5660300001)(76176999)(6666003)(2950100002)(42882006)(81166006)(8936002)(6636002)(50226002)(16526018)(3846002)(8676002)(7736002)(5003940100001)(305945005)(189998001)(81156014)(4326008)(16586007)(66066001)(69596002)(316002)(97736004)(33646002)(47776003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3461; H:PBHAGAVATULA-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3461; 23:7fUz3jESZ4hbje+azvGzuSWVMpXNiEMBlRmwR5jgJ?= =?us-ascii?Q?24evxvbxPUEKZ2D55JdbCCZoq/TZX0sxJTfgn4MLJrgVjMmNd2kROYZM2A68?= =?us-ascii?Q?sApvMyAdLDYMrPX7R6Jt910WAgxMhNeiQfl3fqpyjyX7twbQaXGj02mNM8yb?= =?us-ascii?Q?HdlbU/KGOrC1VNcS9sjHCQi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:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2017 08:11:12.3210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88c85643-6542-45de-28e7-08d51ab6cb6b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3461 Subject: [dpdk-dev] [PATCH v3 2/3] event/octeontx: add support for event Rx adapter 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: Tue, 24 Oct 2017 08:11:15 -0000 Add Rx adapter queue add and delete API for both generic eth_devices as well as HW backed eth_octeontx which supports direct event injection to event device. The HW injected event needs to be converted into mbuf, previously this was done in eth_octeontx during rx_burst now it is moved to event_octeontx as events from Rx adapter are dequeued directly from event device. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/ssovf_evdev.c | 126 +++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index d829b49..7bdc85d 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include #include #include @@ -395,6 +397,123 @@ ssows_dump(struct ssows *ws, FILE *f) fprintf(f, "\tpwqp=0x%"PRIx64"\n", val); } +static int +ssovf_eth_rx_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 = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP; + else + *caps = RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT; + + return 0; +} + +static int +ssovf_eth_rx_adapter_queue_add(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) +{ + int ret = 0; + const struct octeontx_nic *nic = eth_dev->data->dev_private; + pki_mod_qos_t pki_qos; + RTE_SET_USED(dev); + + ret = strncmp(eth_dev->data->name, "eth_octeontx", 12); + if (ret) + return -EINVAL; + + if (rx_queue_id >= 0) + return -EINVAL; + + if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL) + return -ENOTSUP; + + memset(&pki_qos, 0, sizeof(pki_mod_qos_t)); + + pki_qos.port_type = 0; + pki_qos.index = 0; + pki_qos.mmask.f_tag_type = 1; + pki_qos.mmask.f_port_add = 1; + pki_qos.mmask.f_grp_ok = 1; + pki_qos.mmask.f_grp_bad = 1; + pki_qos.mmask.f_grptag_ok = 1; + pki_qos.mmask.f_grptag_bad = 1; + + pki_qos.tag_type = queue_conf->ev.sched_type; + pki_qos.qos_entry.port_add = 0; + pki_qos.qos_entry.ggrp_ok = queue_conf->ev.queue_id; + pki_qos.qos_entry.ggrp_bad = queue_conf->ev.queue_id; + pki_qos.qos_entry.grptag_bad = 0; + pki_qos.qos_entry.grptag_ok = 0; + + ret = octeontx_pki_port_modify_qos(nic->port_id, &pki_qos); + if (ret < 0) + ssovf_log_err("failed to modify QOS, port=%d, q=%d", + nic->port_id, queue_conf->ev.queue_id); + + return ret; +} + +static int +ssovf_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, int32_t rx_queue_id) +{ + int ret = 0; + const struct octeontx_nic *nic = eth_dev->data->dev_private; + pki_del_qos_t pki_qos; + RTE_SET_USED(dev); + RTE_SET_USED(rx_queue_id); + + ret = strncmp(eth_dev->data->name, "eth_octeontx", 12); + if (ret) + return -EINVAL; + + pki_qos.port_type = 0; + pki_qos.index = 0; + memset(&pki_qos, 0, sizeof(pki_del_qos_t)); + ret = octeontx_pki_port_delete_qos(nic->port_id, &pki_qos); + if (ret < 0) + ssovf_log_err("Failed to delete QOS port=%d, q=%d", + nic->port_id, queue_conf->ev.queue_id); + return ret; +} + +static int +ssovf_eth_rx_adapter_start(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + int ret; + const struct octeontx_nic *nic = eth_dev->data->dev_private; + RTE_SET_USED(dev); + + ret = strncmp(eth_dev->data->name, "eth_octeontx", 12); + if (ret) + return 0; + octeontx_pki_port_start(nic->port_id); + return 0; +} + + +static int +ssovf_eth_rx_adapter_stop(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + int ret; + const struct octeontx_nic *nic = eth_dev->data->dev_private; + RTE_SET_USED(dev); + + ret = strncmp(eth_dev->data->name, "eth_octeontx", 12); + if (ret) + return 0; + octeontx_pki_port_stop(nic->port_id); + return 0; +} + static void ssovf_dump(struct rte_eventdev *dev, FILE *f) { @@ -488,6 +607,13 @@ static const struct rte_eventdev_ops ssovf_ops = { .port_link = ssovf_port_link, .port_unlink = ssovf_port_unlink, .timeout_ticks = ssovf_timeout_ticks, + + .eth_rx_adapter_caps_get = ssovf_eth_rx_adapter_caps_get, + .eth_rx_adapter_queue_add = ssovf_eth_rx_adapter_queue_add, + .eth_rx_adapter_queue_del = ssovf_eth_rx_adapter_queue_del, + .eth_rx_adapter_start = ssovf_eth_rx_adapter_start, + .eth_rx_adapter_stop = ssovf_eth_rx_adapter_stop, + .dump = ssovf_dump, .dev_start = ssovf_start, .dev_stop = ssovf_stop, -- 2.7.4