From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0075.outbound.protection.outlook.com [104.47.40.75]) by dpdk.org (Postfix) with ESMTP id 286F35A89 for ; Fri, 26 Aug 2016 18:55:07 +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=T5u+f+IlpvkqJK4A0JC4XlDEfeEfbjnz/FSox2WKbxI=; b=H2PcDKIS1zEFAarQ6k662IqXQKnlttJeC6qmQa0ks4CSteF0+BPgbGQIuww0WijSuYVUHOCPnkcrD3ISxv6Nxdmtm8BaTD2lqgB18hktmVq7PMtUEZtlCnB9jdO+nvF03Pfywl1De55ze2jLZnDVGEpVvnGidVoDxoOv0GXnpVs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Fri, 26 Aug 2016 16:55:03 +0000 From: Kamil Rytarowski To: CC: , , , , , Kamil Rytarowski Date: Fri, 26 Aug 2016 18:54:01 +0200 Message-ID: <1472230448-17490-7-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: HE1PR0201CA0008.eurprd02.prod.outlook.com (10.165.229.18) To CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) X-MS-Office365-Filtering-Correlation-Id: 5e789e2b-9b58-4aa7-285f-08d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Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY4PR07MB3064; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 4:kMFs0STtdGhLM9Htelzz9DU95D+IsOnLgb9LsRh7yehZiNtoh5fePwY+sD+xZm0PYoOBbY0jjlMzLjTLPvp7mlMlEsssFB9Tze24JzkUj/TwNS8xeraY6qFByDkkL6jW0SGi2k9khikRl1xBYzdbMkxKajawOxQhdsZQ+YVA/Q6qOmOVWjbXq1oncNHR4PG/MHyCuCsTna+r7TC1UDLvDmuKqDPaojNXRKKzAjAOXatxWWt+A3kKT2uad5Y6XM6lz0wx5RidtnYWegneAFLX75JNEIPKpCZkH8XuIEoLliFzgP+HwbiMsjHiNzAkTJLnjCiBTi/kBdgpOYLj2aA6YSt8vORWrho4sDIdWB1zKiGyaMcwtbe6tXH3duyj4y7CWV5GLe2WavImMUTA81ZVaw== X-Forefront-PRVS: 00462943DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(7916002)(189002)(199003)(81156014)(36756003)(77096005)(189998001)(2906002)(229853001)(2351001)(105586002)(8676002)(101416001)(92566002)(5660300001)(81166006)(6116002)(4001430100002)(2950100001)(7736002)(47776003)(4326007)(66066001)(586003)(50466002)(106356001)(50226002)(5003940100001)(19580405001)(19580395003)(305945005)(50986999)(110136002)(76176999)(7846002)(48376002)(68736007)(42186005)(3846002)(107886002)(33646002)(97736004)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3064; 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-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3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s4f5WEI8CJ2R6AwL?= =?us-ascii?Q?TC5fhourYBUTN2ube3bDsLsMb5/0n6Cg7ui3aOtdbaALY2T74a9yMxM13Uc0?= =?us-ascii?Q?SkJy5Foi+S0TVI4aTZix2ITvVWADc0fdWx+EICQH3xvxy7cv+G5pRpUM3Zlf?= =?us-ascii?Q?oj42lJNh/oDyh88IUqy/B0iQykqiX1mxHCVQ8s0/Julg67f8vL5qaDpdBvk2?= =?us-ascii?Q?5yvyAM7Qjtm+I/MFdovErZE2HDMr3y1kQslUiSyrGGzPTsYd8JTGKoRhVdb9?= =?us-ascii?Q?ff0sp62qsAatAjlz4GjMaI3sSSxR3ifqRAtVKkhw0/c78pQ9wv9jfdr0+TEf?= =?us-ascii?Q?OqxRfkag8lFAKSHCteBw8Ts3u1gxnitF12TjuclxeXfIAgYtYC+T50I5g=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 6:ti9RWdrxc91fiswHyWG29gxR41TrpJF7nN133LwJyYEulVL9q8a96teMScFKiXHcAK2n31HNCAbiZJwYPYBOb4hBfUMFSuv7If0auztWN/u29WccyfShQCIKG76krv0gOyMFtksJdBPkKIspRQ98JNQONbbCzRLGJ0mUdUJwWly8h4CjPT94Kh5y7ZD7KoD98rnEkKksKenLKw7G9GjyNU0dgEX0CSX/B9WslUZFj9KfKFrsdori5tZssI93dbsTe9z15uCZTczhNRVm2NXEn/uFed0zzrigebZfNfpL4ts=; 5:JnW3IDWJBp39n6nYDe2PF7bIkDOQZROkE+7Zyd5Yw1gtA4rxVYKtJx56x83iVXOEUl1c8yO91/CBf+CVJyPsxGd3LyRh/McRBuFbryYgJm8uQMlxD0g0556sy5e2cZUHMYZhUfyMjbYcKpZzBEkkuQ==; 24:DXY1SGdDmromSa4gaqkt0kknyeeWapbY7ZT7RsGWyk+H97avEr3HyHzw7Z3Yo05+DNTj0YT6rsUCfcBKjeZiPgC+xYu/5qVGjPRG+fMMdPE=; 7:zlWAuBDP7ZwMSmn6Dn3RUF66+tsV7sjTcJC6v9OfEL2yfjFRjC+MfyjaTH1kpn37WymqkUZrU4sonn+ynOeapJllTHwAvORCfJbilzL+5ik5jtjyKKLgwTrFf537GtVyGDnVp0uSJw5TwCXlQyjSDDWeAl1BEtIjzFTQ/cNAMIblrXArstkF6m8e6sgN2GfSy8Fh3uBwVqEfTKjS5fn7aYPHVAG4ozHJ+79BZ+sNwI3y+47mim2Rj01GGf1gRSjz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 16:55:03.4990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3064 Subject: [dpdk-dev] [PATCH 06/13] 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, 26 Aug 2016 16:55:07 -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 48f2cd2..55f6480 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); } /* @@ -1512,12 +1521,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 @@ -1668,7 +1675,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; @@ -1729,7 +1736,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