From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0050.outbound.protection.outlook.com [104.47.32.50]) by dpdk.org (Postfix) with ESMTP id CA4A11B7E4 for ; Tue, 24 Oct 2017 15:01:08 +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=qPeVvmxHf/5QapUseHfF73z+aWGYdlBHfFTSsiwi+Jg=; b=WPNSPhDTnNP/GW5bJGh0ZneL0oYpSbdeY4lwSxHavNnWiICxGRu3INlecLgX5k3oPLO8dOCxpIwWHknsGPblggrBIHh0qhxaT9o7FS6ELpq7duzVoBRCjAG97q1acnNcRyLvtJmsau9GImsrwpuVqrAwYAZJteIfIkYAourlcQk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) 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 13:01:05 +0000 From: Pavan Nikhilesh To: nikhil.rao@intel.com, jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Bhagavatula Date: Tue, 24 Oct 2017 18:30:36 +0530 Message-Id: <1508850037-16394-2-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508850037-16394-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1508316342-17781-1-git-send-email-pbhagavatula@caviumnetworks.com> <1508850037-16394-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (10.174.56.24) To BN6PR07MB3457.namprd07.prod.outlook.com (10.161.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 253ae134-cf5b-4378-8f85-08d51adf4a9a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR07MB3457; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 3:IEAANZa+S+NpI0TJs8qm+pfRWOveTIoCAgS2IwPnrol2SsAKOtGBOCd1XgILWG6ZYPTGaC8kTrYZwgKLcTmkxZuOqa/f+FyxPs1lkxkNmPKQzCSXAqupdRYYOoHUCcdwG9YOpRl9+8Sw7+SBqWh07JhiAbmQoP5xQZj+yjVK96AmMt09U8N9GP6G3sDC1FVzixTyavVOin0xAN2FHbfmcpO7I5bYtTcaDH7CiVQiNcD3bIeAPGbdTHVXd0Xjov8M; 25:oL6v2guOKCuV+np41W7W66uU6YcQiKG7BRSfKcGKkQCCZ0SPLCYSOiKD3D3UzhPpgkzlCY9JqK7p5f5VO1JVR/lIMu5WWs58jYDdl6HVjzsNTCD7npG9H+j+e3Uy7CqdyBzfCyxC+IIGFrjaGAaAHUrZbDtdcfOAK4JsUm6Akbr89G0LxMFelZDTHK3FfJQINGhNyD2HD9TUQuFIUekuUQ+6rqGB1ilyblKYGyhs49AokhJxOIMphzmlxBGjOdmLOpNoOuSg4JqEtMwsLZW5pCWqhLyUx8Gf6F9BH7RoqrjgjF2aiZCRytpNvbpvsok4Ov4h78QOtnjgDWYfocBSBA==; 31:tm6Kb3HrlUQMNttSH/eEQxfSgXDCloC7zJPbRgaLqPhg5qJl3gyI5lqFMyi6EqqPonOgEtb1zeLMgnI3PocWeib5MpgI7g8lkva4CM/km6QbimSgA0cMYB8YXtB/kyEQwcYNm57W0U2CQ7PQHoosQlIYd9Ci4V5Dp/Du0YMyeIKGmKyDx1BEVq1GKIPnjGtTYLHJrP2ZPNev/qxy92s3Hkl6OG0ruiS1RReLwy/Pzr4= X-MS-TrafficTypeDiagnostic: BN6PR07MB3457: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3457; 20:1xvhEHTXbK3+xesIjwUfT3px+uo4NKCiAGXaqGQUhMX+RNGUgoVJh4c4OtWVvr0WJwgR/mWRtlod1YA5yVcPpom+YbfQ3oCq3cafZSzmmk6fjwkBeCPolgiMr6xGwXUKPsCJY32vn3tyJ4CHyN/gFnq0OLrPzY+T/NSpcE+WigflNNcsEZrfyQlu3J13CceSusnIdgblVE3d4mFordyVCY+4DHnYuwcYTTeEUSN8koSnbvnjUxXlYROi64df1UDqIxSF3Hko6Nsx4MudRSANsiKgl8aaXiOnUPBn7TZaABFNUfE55UwFhVlJsN0Nsext5c09L4SquOXcdagzbYoMU0Qu5Zef4gJRfJbo1ltffT/IZmrJWR8IyPMFt7w3lSZ30cQcNs524eIqfi9/QBtbdvhqheTL6Is2aUbvfYSqc3+O7o42Xa1YT0mShDHtW30MCGt5Nx7RNP/4XyN4XALu94MR+qUYqrtSm0Xh/5vpEyK0Nr3N5Hc/hRdHtPT7rJXErrM0BiiKqiG2pg5PorAUme0Nr6h09PEvhnNkO55SNRB9ccAsncma9Y1RD+Xzt+LDucIWHW/R5VXBcJEIrouBjfQHlV1GO8yXaFoPZ5uOf/I=; 4:v05Cbtfo41ecyKrwo4AtP1HfoPDvy7aZ0t546IPTx+rJURZgzOHH9PidVrWfBLBA02jIse0eFgXEVa1t2buFM6CdVisjTdiSvnO4ZwefEed9LRAv+lRVoZ5JlJCUwItbODKwmmvMk5DM+OG87PHyo2J/DEk/H4PFhKlGVjn8PFDj7ihQswYjYuYMRpP9H7zGgDLE7DzJf3hAtSz0a5aPdwjh0SDgzr28OWmFEiJhKZuE5LYMogNnXavJiQILdXNg 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)(8121501046)(5005006)(93006095)(100000703101)(100105400095)(3231020)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3457; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3457; X-Forefront-PRVS: 047001DADA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(81166006)(36756003)(6636002)(16586007)(5009440100003)(6486002)(97736004)(5003940100001)(6506006)(316002)(50226002)(101416001)(69596002)(66066001)(8676002)(50986999)(33646002)(2950100002)(478600001)(42882006)(72206003)(81156014)(6666003)(47776003)(53416004)(8936002)(107886003)(76176999)(68736007)(105586002)(3846002)(48376002)(53936002)(6116002)(106356001)(2906002)(7736002)(5660300001)(189998001)(50466002)(4326008)(6512007)(305945005)(16526018)(25786009)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3457; H:PBHAGAVATULA-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BN6PR07MB3457; 23:XxpnVfapoJhB5hmTuss4wEmpyppMiyaAna7hrzo6y?= =?us-ascii?Q?Riv1l1TsWN5hGslx90Qsk0YoMDKJJluIab3Vfscn0ByvDInlqPwCvHAf7BPJ?= =?us-ascii?Q?4bD0ULa8i687SDD0I0c8TCyodnX/9PbcjW2KzVKpts7lBceaiz7DIoU1lNR5?= =?us-ascii?Q?H4VNTvlTfK7XQzCGUZ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q4NSc0Nw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2017 13:01:05.4934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 253ae134-cf5b-4378-8f85-08d51adf4a9a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3457 Subject: [dpdk-dev] [PATCH v4 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 13:01:09 -0000 From: Pavan Bhagavatula 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