From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0080.outbound.protection.outlook.com [104.47.42.80]) by dpdk.org (Postfix) with ESMTP id B310E3790 for ; Thu, 30 Nov 2017 14:11:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bG2cNOJ9ENkkMBU5p45ghb64IQovSYnugwfWd9mi3RY=; b=H/OkHbF4HPEqtLaOCE5Ne9OFfICU16EXlpHJmd9WeSoD1TPP2DOxPRj9hwhFth3mOfixS9V1YWx2T1mZCaBrHi/kMyYf13tp8LxAuL5nMnWmaonmUA5rcoTaMin7ecNWeGErOUSGf53jrA0DNWN7ZMw5hbJx8EHbx2jqZ1UPUr0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 13:11:48 +0000 From: Ravi Kumar To: dev@dpdk.org Date: Thu, 30 Nov 2017 08:11:03 -0500 Message-Id: <1512047472-118050-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.56.17) To DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf049ca3-e336-46b2-3e33-08d537f3eab6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286); SRVR:DM5PR12MB1514; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 3:nH7l0joqgYvCDO+pI+king7ltIgytlrm+u38W4GharFxHUGDM2FISkn4qlZzH7mppPbLNmttxC1rbmGqG4LZ+LxRoAB+oqXTQXdu8JzV++UNKC04YFYz7pIEufUV0jjlvQWRiAqDO09Az4TSt5aMfWyhkB/3W8M4K2ucWz3vEII8mmpY61ehec2ToI9koxOyw3HpJysAMATYWfeEopoXR/Bay3briHYRa/Id8sznL0Jw37kGF7DY5LyS3b0I0p5U; 25:drN0DXIr7ttzl2PhQAH49Sl/vNvDfr4Q+F13YD+cGdfhpYO9IJX+6WXhYM+g+Sz7vwjrrzHVXY4sBYsGjC/TaJcJTDAmViUvWOU00jQi2px3FHC847RThyyXKbgnPD1tpkURCkEoV4HhFqJZFBp8G4sL+VYa4nNcKiPn04mCXWpE3XKAB99TvPSKAcxyIyRjqvVLFRFF7GzCePU15LggWes6vKAggUlfnjeVUHgHlqEOG99nZ3j43lYN4xQK4q/NotAzGcsWRbxI5iwVP/QE+Lwrp/b/Bq1zypazX2am3Bhf8QQCAnPeQRXlcbAa1R/7XGH/MKt2SBjOyrCft/TEBg==; 31:Lx3OKXDyj/+oYcnrAzpx+Qx8rgVCTBHsKpWamcU0JfRdhExsmaAv/lPHbft1Lt6q/20qFJA1YzUHYc4AHu8GxqzybNPGHG1Q9nY0hZBL7vODDW914TEpFn5FJXFXggyKGJIewB3i5CTpyzlhbTZA5HgLDlgIU4ibminyX2L9KAST1vV/SP882+UKudk/8lzwrRIH7k+VORLJ2+s17CLspocxqPj88rKqWJbSIFG9TUw= X-MS-TrafficTypeDiagnostic: DM5PR12MB1514: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:RsRfpCDTnPVdjMxlaMl9+e6ZqB2wT+PaHzCSY0wlhKOFP7Z6A9tj5NbPSQEcsXSPWqI8ZqkhFP4DKld2oNb8HB7Gz8F/fb4F4LI29C2toKXsIwIWPd4jnW4UmudsV5QfdUTiCfjrnqf6q2cIda2xrKvc0SGdDEBaIxvPD0HeqoQb46mghEg/4+V4amAvo7VVt5yseYU18E0J2BeFAAqUq2clLnASFEpXTMnGNliKWnyTegXOrO7Wp0cph7AjPMOTFlgyeJUAqpqF80DgGT5LMdZ8rcX/ZIwADr6i/GyoxhbJQRTQnGmu9tJlMEdmvUV8aPBxvxuRxOT3i4iquEL+OxNf4w+VuVh/MAZi7KCCxZxKvwjh6nkgWhFpMyaGoSJpKsyON32cIaRulBncdIczDNKGODpezzBgxwDBdsq5Cb55fNOUcoRByFwZkTjbyc9knb9TAKpM3m3ryT2hlBcA1te7d39n2MyHn3B3F4p4fUvxDltVDes7ecwrTVgrRdSt; 4:WHkmpR95q5V43wVb4e+NrZTlTI7TQPHPm9V5xxR342IsUmy+N3s/OtvvJS5t1AbVn40lV7ExKOfoylQRc6rn2qIvUDlhTI1iXnKcVR0JebD8/R7EDHEIfzGAQudVKJ33Pk/Iafd1rNvxMX8Mo3j/G1CurGblp6UdjJ5bTJCNPSQ3+W9Mf+22TdXz+z+X5c0CGueNJrTRIQd0CPNer8+Q/Yd2OL2COgPKdOvWxG26tknHBguw2arShoFSi+urdqHbA27kHYGtmEf8tYtjT3Hee39IDea1gD9B6fsf0HGcCwd+wVh4T2jT17jvMuBfMyMM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231022)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR12MB1514; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR12MB1514; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(39860400002)(376002)(199003)(189002)(48376002)(16586007)(6666003)(68736007)(86362001)(316002)(101416001)(2906002)(50466002)(8676002)(51416003)(6486002)(72206003)(50226002)(16526018)(50986010)(76176010)(53416004)(189998001)(7696005)(52116002)(97736004)(53936002)(6916009)(2351001)(2950100002)(105586002)(66066001)(106356001)(3846002)(25786009)(2361001)(81156014)(5660300001)(36756003)(6116002)(47776003)(305945005)(478600001)(8936002)(7736002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1514; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1514; 23:tkR0Wlw9NsiQ/UAsw1qdxr0mdZ8R0Dpp3wG82QnGI?= =?us-ascii?Q?MVVMi+otf377rGNTPjdTA3sBemrFVcl7GXv+DnmcTjzzCE8BOK14af//aJ58?= =?us-ascii?Q?RMHn3OojjUPk/dTKWrFEtkbV9+ch8ZNHVcnOznogeYQxTDyRkjaPkyhaIvlV?= =?us-ascii?Q?vlyihEMGFYpsx1mhryuiQNpf+qle/25XDhjflDmFxB2OJ5BbXq8JB4/bOrKl?= =?us-ascii?Q?5qtzpFxlSjd6HS8o4rjZcKgM6WevOSaH/3J4hpC9aXFbhh+aIshwdhgrL6B5?= =?us-ascii?Q?mmRxSbqlUYU14qqTwTfMjEJ9rUBpyXWNTvs4tHloZf6B75XlaLhhKVlDFV7J?= =?us-ascii?Q?uQ/xloH0Kkv5klGVPvaxMAOwjxWtlTA3+JJCrkBUdbbFGhd9FDq42kQSmhpV?= =?us-ascii?Q?mYnJ68IRGS/J4/SGsMCICLUuDwJoYF4+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Jii4oSc8sBqeA7bZpRNR5qy8jXb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 13:11:48.9217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf049ca3-e336-46b2-3e33-08d537f3eab6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1514 Subject: [dpdk-dev] [PATCH 07/16] net/axgbe: add interrupt handler for autonegotiation 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: Thu, 30 Nov 2017 13:11:52 -0000 Signed-off-by: Ravi Kumar --- drivers/net/axgbe/axgbe_ethdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 65a04f4..341808d 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -131,6 +131,7 @@ static int eth_axgbe_dev_init(struct rte_eth_dev *eth_dev); static int eth_axgbe_dev_uninit(struct rte_eth_dev *eth_dev); +static void axgbe_dev_interrupt_handler(void *param); /* The set of PCI devices this driver supports */ #define AMD_PCI_VENDOR_ID 0x1022 @@ -165,6 +166,29 @@ static struct axgbe_version_data axgbe_v2b = { .i2c_support = 1, }; +/* + * Interrupt handler triggered by NIC for handling + * specific interrupt. + * + * @param handle + * Pointer to interrupt handle. + * @param param + * The address of parameter (struct rte_eth_dev *) regsitered before. + * + * @return + * void + */ +static void +axgbe_dev_interrupt_handler(void *param) +{ + struct rte_eth_dev *dev = (struct rte_eth_dev *)param; + struct axgbe_port *pdata = dev->data->dev_private; + + pdata->phy_if.an_isr(pdata); + + rte_intr_enable(&pdata->pci_dev->intr_handle); +} + static void axgbe_get_all_hw_features(struct axgbe_port *pdata) { unsigned int mac_hfr0, mac_hfr1, mac_hfr2; @@ -468,6 +492,9 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) return ret; } + rte_intr_callback_register(&pci_dev->intr_handle, + axgbe_dev_interrupt_handler, + (void *)eth_dev); PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id); @@ -478,15 +505,25 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) static int eth_axgbe_dev_uninit(struct rte_eth_dev *eth_dev) { + struct rte_pci_device *pci_dev; + PMD_INIT_FUNC_TRACE(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) return -EPERM; + pci_dev = RTE_DEV_TO_PCI(eth_dev->device); + eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; eth_dev->tx_pkt_burst = NULL; + /* disable uio intr before callback unregister */ + rte_intr_disable(&pci_dev->intr_handle); + rte_intr_callback_unregister(&pci_dev->intr_handle, + axgbe_dev_interrupt_handler, + (void *)eth_dev); + /*Clear macaddres at time of dev init*/ eth_dev->data->mac_addrs = NULL; eth_dev->data->hash_mac_addrs = NULL; -- 2.7.4