From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0088.outbound.protection.outlook.com [104.47.32.88]) by dpdk.org (Postfix) with ESMTP id 71E9B58CF for ; Fri, 30 Sep 2016 14:06:53 +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=IrhsYnS7uilVUGjrE1inTU/5d+AtDBva566Bvu3NUvE=; b=mND8ivsSBTsMFqERgXrSz+D/7DuBT/wc60OHROdHQf9K3nOxFQVbQ8r4ybVWuDUniXs2C9IVEeZhJlZeFlqM3LQVLqH0MiANJCpWxRb4nAdFc8q+BDDxPQ86S+5CAMN10xS+nrWdb2JFAk9gfJLJXmvfLzFeS3WnBsd2Tw6hPI4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 30 Sep 2016 12:06:50 +0000 From: Kamil Rytarowski To: CC: , , , , , , , Kamil Rytarowski Date: Fri, 30 Sep 2016 14:05:45 +0200 Message-ID: <1475237154-25388-7-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR07CA0001.eurprd07.prod.outlook.com (10.163.160.139) To CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) X-MS-Office365-Filtering-Correlation-Id: 3022cfbd-99b6-435c-0a63-08d3e92a4395 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 2:WeLFU2q1KKhtonz7VfLNZCdsNeGOl+seTpIpF5VA+oXfsrSFvNnP8aqqjL1SBFn70yZKO8Xip4nBDxWjnVjRHquspIHqOLp2i0NETlcuBViG+fRVckd/qm1WCDfyhhOTfa1JMaEpwN7f4yt1gqLu0irzS7q3oZaAHAbu178lTf3K9f30R61ojSb2U4cDDwyD; 3:efa/jNYPliYqra9V39M0ZhLMlrw+yExMp7+RTa+klsd3gsP0jS1q4weiVvQuwTqufzAVSyztFhsPFBUM5y6YgjkzZ7a9rjQwTmZ2PME88rz0SyHyrg3Pi6LKSCNi+yAu X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 25:xfS0ECL0J4W1okB8jdtQiisP+Zax3+L6VpMdHXLoY+PaZUx7MUUgnYvQz+gNimO5iF9vpuQEIRodhdYlMn5p9us8ubRDHy4Zx4PbBOwO4GVN9hsnChU2ZNhDa2xO2TCMp8zVs1bsMppk/ZX09kYW3MZZ2PXqqJd2CwX9hSJvbPnm8th9qJVb4Rnl9d3pKftcizzn8WUlWSay8uLOMwbky+j5FIS7doKYqlbogfODUSDQQRGlkn+6UYhOJqJO2Dq3b584lwAoe09K7iVBaUGxyatryZeIGgKash+T7101ixcSwOX+112z0GZjuMSlGrq9ezlY82oeEaN7npe815BsNGdNLLYTsQho+NfKlwG2Lf3vOkQ3Poiszm8//WUJwtGmN7YGdBYhXQgDAPhe/iRDIZmvzYBaWnNKT06kA2nD0Ostgyo7pyMedbF7F/f4dq9X6LNdwRUf5KhiXKcKR2Q89bN2paZtDlVK/YIcEWJ5XxHJLYwJw5hRD+Abzw9KVv+tf7qIwrXgEQo8RhvgAuUbtmKOt2b7lUdnF99gn5FwAJBiZnM6Ola9f0nFOro1MvYHs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-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY4PR07MB3063; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 4:Uf/N8rNY7NzQCm/guhuPHFQsvXH0Jf1PG/aHXSvvkAJyHsSQ/noKPuPnzHieXUsNbEOitS21MPULrZBl87e6LzavrL4wuX7umwCAN/UkxeXAbQ1BvmVEYUa8SB/TEIZDkC5jyB3ojjJVnZtKne2Bs6O+6i7hJCE976vg0R4PrDeP/TYsl/FMWM8RqSPW6bdXsyhO1KxqhwDDUhng425fjOxqPH7WxGNsHvOBNi61V8DwaMLh0gnYqYaWFR9yfT4e9TGUUiJ5l2zcJs7BWBYe1jUoi1mxcs/ajTMNAOyyVpGYiU9y4mB0JxgHdqScJp6iy1e5UhCuixOcGZfoD2KAGn8smd0gMRSL8m1zEwGwm+r0AtFTUJ9eaoEYX7Ms7Q3xy23fTENNdYbcQc4TYzoOXw== X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(92566002)(3846002)(66066001)(189998001)(47776003)(42882006)(36756003)(105586002)(19580395003)(97736004)(6916009)(6666003)(68736007)(42186005)(19580405001)(50986999)(50226002)(77096005)(76176999)(5003940100001)(6116002)(7736002)(2950100002)(101416001)(586003)(106356001)(7846002)(5660300001)(4001430100002)(305945005)(33646002)(229853001)(110136003)(8676002)(4326007)(81166006)(107886002)(81156014)(50466002)(2906002)(48376002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3063; H:cavium1.semihalf.local; 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-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YFKakTFWDJPzBfkQbH3mVn1v6HZYL3+Py2mnQDDT49raAAvpmijNM6Z1Gj17IfWk8A+FisKPQp8O3JrO4QLzcAPizQ33IqmyOidbb1G1l7nIQyT7DGfK6QL0wEVigWBD0638fcbY4HPCSfpT6tMULBg+i62xZCOKum+Sk11+1mGsvrAfn2dbefvjlQtb1L75UOt25gfl3Gv9kE79lBGZ8BSgTHsIhw/UhaIOrnevt2Oh0TAnZWSd1TktooEYzLbWfqtrHTro4BwbqfqQQ6SWgfhDlpGqqqrA5LDXEL98Z9a0+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 12:06:50.4247 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3063 Subject: [dpdk-dev] [PATCH v2 06/15] net/thunderx: add secondary queue set in interrupt functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 12:06:54 -0000 From: Kamil Rytarowski Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki Signed-off-by: Jerin Jacob --- drivers/net/thunderx/nicvf_ethdev.c | 41 ++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 3cf32bf..72e6667 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -101,31 +101,40 @@ nicvf_set_eth_link_status(struct nicvf *nic, struct rte_eth_link *link) static void nicvf_interrupt(void *arg) { - struct nicvf *nic = arg; + struct rte_eth_dev *dev = arg; + struct nicvf *nic = nicvf_pmd_priv(dev); if (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) { - if (nic->eth_dev->data->dev_conf.intr_conf.lsc) - nicvf_set_eth_link_status(nic, - &nic->eth_dev->data->dev_link); - _rte_eth_dev_callback_process(nic->eth_dev, - RTE_ETH_EVENT_INTR_LSC); + if (dev->data->dev_conf.intr_conf.lsc) + nicvf_set_eth_link_status(nic, &dev->data->dev_link); + _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC); } rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000, - nicvf_interrupt, nic); + nicvf_interrupt, dev); +} + +static void __rte_unused +nicvf_vf_interrupt(void *arg) +{ + struct nicvf *nic = arg; + + nicvf_reg_poll_interrupts(nic); + + rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000, + nicvf_vf_interrupt, nic); } static int -nicvf_periodic_alarm_start(struct nicvf *nic) +nicvf_periodic_alarm_start(void (fn)(void *), void *arg) { - return rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000, - nicvf_interrupt, nic); + return rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000, fn, arg); } static int -nicvf_periodic_alarm_stop(struct nicvf *nic) +nicvf_periodic_alarm_stop(void (fn)(void *), void *arg) { - return rte_eal_alarm_cancel(nicvf_interrupt, nic); + return rte_eal_alarm_cancel(fn, arg); } /* @@ -1519,12 +1528,10 @@ nicvf_dev_stop(struct rte_eth_dev *dev) static void nicvf_dev_close(struct rte_eth_dev *dev) { - struct nicvf *nic = nicvf_pmd_priv(dev); - PMD_INIT_FUNC_TRACE(); nicvf_dev_stop(dev); - nicvf_periodic_alarm_stop(nic); + nicvf_periodic_alarm_stop(nicvf_interrupt, dev); } static int @@ -1675,7 +1682,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) nicvf_disable_all_interrupts(nic); - ret = nicvf_periodic_alarm_start(nic); + ret = nicvf_periodic_alarm_start(nicvf_interrupt, eth_dev); if (ret) { PMD_INIT_LOG(ERR, "Failed to start period alarm"); goto fail; @@ -1736,7 +1743,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) malloc_fail: rte_free(eth_dev->data->mac_addrs); alarm_fail: - nicvf_periodic_alarm_stop(nic); + nicvf_periodic_alarm_stop(nicvf_interrupt, eth_dev); fail: return ret; } -- 1.9.1