From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0046.outbound.protection.outlook.com [104.47.34.46]) by dpdk.org (Postfix) with ESMTP id 03A685F1B for ; Fri, 9 Mar 2018 09:43:12 +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=yL/nfnApfh3wYSspBhdKfYrR4c2BzspvtmSKZvCYFfI=; b=zxp0/wB5KYXllJ8FZCqJzY2gGNi6UDvc4yqSdxrnxfR02JOGpctB/AXKJEM57YGRubHlo12t536i8dJ6+h9xnAHlVhKkWZ+0zoRzQHKNkwo9yaEwyrLhULQzHhzOVdU7p1JRhCSh/USSbKdHSzETkmzkapMRUvV1SZ1nXVegPro= Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.12; Fri, 9 Mar 2018 08:43:10 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 9 Mar 2018 03:42:23 -0500 Message-Id: <1520584954-130575-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> <1520584954-130575-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: BM1PR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::19) To MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aa262111-4301-4c5a-e723-08d58599ca1b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1517; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 3:e8kbeikZejMOoiN8EAv416YcE3u4jrv9BIFqkUSRIQTpRzhf9WnzZcL1FLWKL6swV4qDjPpmKNIds2C5zermLA/Iu2LRiqlgWz1Yv/laMzrkif8IoeUkpy3QqYyZVbnrSkrUPJCLDZjiEv33eDe2T3gCrmCGu5hFSybvzLcGv/w9E0iiDj7HfwVrB1rD0hZuc8nu3mPO8NQkPv03SqUrp1fx5quiqyoeMBuwTNIbCp6umLMow33zKSNEDJYPxDA3; 25:rFkIa7L/aUPCDMWGY44/srA1OGMsU97M+GINudBGrW6t6f4omSUr4YFdUGJ+VXVxs0pYO4SXNRStXyi82u5JXMk+ll6mvfD+4yX4rsuieY7xgrNa/5h4hg8ykeDBffKAZ5CNZzQo5PyR63VucGFWIqTu3S+Uf9zmxLHjToOTlIVAINJKZoGYtTxm2IbELGK4LcyLvqYepT4dohqtaPMZ75UfpV0iurpNyFvdy3z7mLBrp0Zkf6KPxfineW4Nzv0DwAmk759zn0BT3JrD7XOk0qJDREKAsEeUY91rB4UTkgiRWlLjbP+2zRAVZGlcv7AGu9qHFCbNCs0+oI1fqqhaeg==; 31:s4rw7UZPQwjDQ4im/7V87s4YDv7M07VHI+iSFKNdVHKkgIVHi0QOYmD9v8fuuQUzSlwlTzRfrbQ7mZ+014da5s5RL9O2xJijiV6SrsJJlswpCYVARwSf3thHaxjQKDNLFuJq9rR8pBEg8B3aikKN0aHS7Y5GX8kCy4sKSQRwqYkFhYShtiJXTE58Uxjed7OI9kN2XpVncpZERWsZbYjoBRQie1z6xvlr+Ff7f26Df9E= X-MS-TrafficTypeDiagnostic: MWHPR12MB1517: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:H0OqIs5vtFwQrKWH8NOciRCBOXcXfSVinIhG06YKoIkSxLqQsJIE/omMxOjkJI6OjsEc2TvVvWuPOWsojiiTKw5vz/RXKq9bkbTLggsZjWPWXP8zYzaeBph6ne1Ec/8u47nGxNm1lxCEHJwfdYcKS5Kfxve9MjM7mI2z8cEy8tm+WvtO8P5xYiKLYKjrpYUbrKivYGS7IRQDBTIiEgrZqVxZmT/SbA37jJ+TomjcVD/0tNOgW+tleH47CBw53Sgym3GTd40+iT+Yk0DnCp6CVXHnkmCAHvY2Z/O7hkCZvmtZhfnUt+GFdag6X/ZM6KqZFNW8g0Buz4LRRRsfI9fKKnWViGxzFPKnECq7WkSe7wxnk45Y2mV7PBzSxRZi62R26sz+++mjqLVuTJlfX+hijBYcdNX82DIxyEZH0NrspV4Nd92k/Rr9xqyiqKlyDiIEazyL68q0S2gw0IuAO1a/4n9DSS5ZYE+sRO8iotvnLVnYnL9NuV6CgMJdBSKl8LWg; 4:bxs6RC/6eniwY3A8gRUs78H4G7R9xTuBi5CC6XwBh8n0AAHewXpzNW+xGElz+OEICpArsVjz0alvn0QeLc6LBb+rf/fCbxKfNRSRccC5eZ8A6MVaUMbUaNqYGZPKwBr/MrWilY/AR22P/Io06qPLNQ94OltWpfJbNmNeqMJik6+HFxYp743uq5Gc48s5NhaXd7TKgVXsGMggYXAAmk86s9aIWg6cf7xLtoSuJyRMmkY+vPX92IANiiSsM8fepFBAWK6IsepBtkQ0oa5Pi758KDXEMETlYgFOm6AbM90CyIw1Yb0pkegCBzhF/m9/p2Cl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR12MB1517; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1517; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(396003)(39860400002)(366004)(376002)(199004)(189003)(305945005)(50226002)(386003)(6346003)(26005)(36756003)(97736004)(25786009)(7736002)(50466002)(8936002)(4326008)(16586007)(86362001)(81156014)(81166006)(6666003)(2950100002)(6916009)(16526019)(186003)(5660300001)(59450400001)(316002)(8676002)(575784001)(76176011)(52116002)(51416003)(7696005)(53416004)(48376002)(478600001)(106356001)(6116002)(3846002)(68736007)(2351001)(2906002)(6486002)(66066001)(47776003)(105586002)(72206003)(53936002)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1517; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1517; 23:kZ2u2Me9Md5i976HAirFeu6a90ABcYp1beiNYOSJM?= =?us-ascii?Q?ChydjSvs7vnL2figNVgmMR6FQ0Gnu6gKdPNxug0td2kXLYkRbi8WJw08FeBr?= =?us-ascii?Q?NbFDYuu943cnus8ztPRiUWBuQ+zyl78OkKXK7WXvWNcSKqjrcHvi7abV2ItK?= =?us-ascii?Q?LZOsuYy/8BOQ3+MX4A2cnn1H1bpttkLOJW8o61yRUMw5+ANJ58wUyngHi5Ga?= =?us-ascii?Q?kygepyLL0puSlhrKPSNIUmkPXkEurYX+Ock6o35hDnd3a9+DDXiCMDUMGvqa?= =?us-ascii?Q?wtcsfHMIfK7XsDJEdOzwJkZwOLAMZ1YYKqm9f6rmoWbAEnL/GTdybaOCf6UD?= =?us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OCBe5EiZI6TNAk+qbbzyMn3GmPHyUzeT5m88FXcMFCOgtk1Dhm2cC44b09+srulJZpK/oLNLEps+Gl+oNs2tKiUUz6WRSZdKZ/4zwd81xqj994RL/ct/ksVZYmej8AbaYDJeGyKm1YuagjCofCeLq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:XFKFzKI9lXjEVVvf9FvDI6w/WX6lFPHL/WsBNECzpukZHjCCCU43hem+2V4sARthtTitavP1nTQ7Wku8iPx+FO6dDh6vGiE4E0NsELNa8QwvQdeSlL/wv2gOZ322BoyTjlLBJIHdZXmNrMs+etZT79N4A3EPNXrNb0uPTVG8RRIpva+0PbwKIxI/NN2Ug1fcpfUDVD9lqbJT2ZMRc7iKNt4w9tfmKAIOeYaprnFJxGmU9nKk4e0d6aJeLArdpr1w X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:43:10.0266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa262111-4301-4c5a-e723-08d58599ca1b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1517 Subject: [dpdk-dev] [PATCH v3 07/18] 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: Fri, 09 Mar 2018 08:43:12 -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 0dc424d..daea0b2 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 @@ -168,6 +169,30 @@ 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); + + /* Enable interrupts since disabled after generation*/ + 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; @@ -469,6 +494,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); @@ -479,15 +507,24 @@ 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 0; + pci_dev = RTE_DEV_TO_PCI(eth_dev->device); /*Free macaddres*/ rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = 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); + return 0; } -- 2.7.4