From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0074.outbound.protection.outlook.com [104.47.34.74]) by dpdk.org (Postfix) with ESMTP id 8328E1B1BD for ; Fri, 5 Jan 2018 10:53:02 +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=fu5BKLg75MQ6YibvXZbttZrHswY/f3vefIuilMvVk5+7iO+ryB5aA1e+fwlmMhF1b3a/1RO2kky5/xSNmjc46XzylflLIraOZyM++edB4traV46K3OFSmk7nCLbDwmiKXZIzRyKVOOYg/d+wFhHkdZ4nUmKOtSMeUwgq4shYcfY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:52:59 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 5 Jan 2018 04:52:09 -0500 Message-Id: <1515145938-97474-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> <1515145938-97474-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.221.17) To BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 70221fe1-2c78-413d-6358-08d554221b17 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1506; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 3:Fm1gdT1fvPWYl9/bffY+CBKi0dQC7+y6hqvPqUwsIjihbYGZkV6B3RC6WBufLv5Bbv10Es/8Hn/RAPDJUp6pI1wY1eLgKUmv4OSEhzTP7cqDSufSNWtJszoW23G8VCtP881g3oY0lM4BwdP7KXb7rwlF/oDBk3LVObJ1NzVu3DO69GdqYDqF+y3uMlunhyneR9EWCkrz5bnE9td5zxM3hU5kxWZOOTZC0yMwJrfysF2vPrk7LIBSDPd2HsepjSqM; 25:VlDohUZlA6maWezTjd1p1sCBu0gBpf0+KLgXW/+ePdO4OKFXpJ3Gq5QxgpsDfngEE0N8oS+KrrQLoY3jjkWSH9sT0lNoxYbo80iaKE4692XcNVxRoFiVEP9NfwVO+jG+mzveM2RxUpgJ4sbhfOxLTi/9laF/9udtAh5Acgx0+/pd/Vjn/s3d42DC7PPMLvpmM4x2cScYgTjxxP6FqbmgUfJ3+6kGL0ZVt/aiX+pPyfzJVyGZ2AbfPOgKYVvW1X/lU2rs2Rv2KC4/HxGXW8qoLkY9XAbIXzKbmUgUBHroLMywCY299o5pe/Gta3CzIGXye6YCnFMK4EkHlr5O45hXew==; 31:fhNQm4mdKMsj2AAMzaPbrvu6zX70nrMa0mem+hhftU5cDCmtr8cVjgBbTbg9vJPrXqzo9wyeR0GgiNvXamFbaoThXipKR+0wdUBrE9fhW8Lmr/YdilZxO6fehJ8UflIx9BiMT4ajA+kFj48chvYpHU9cqQq/FBGG1g61vNKBq9EYNvnJLTXeJVbEdvcLHira3U5z+Z/YAQEs8c9sdNgSUYpue0+68FqaQz8VZ8A8aKg= X-MS-TrafficTypeDiagnostic: BN6PR12MB1506: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:tNmqMzdmpWDKoqVkgTmFC9JRFDdYyYVzy/0J+qWvA5EfPxTtCIv27jNx+XKwfLsiKm/0+Twct5kgtUHeaqg/pcRfFOvsm2seoeUIpIflAb2LhS/rxEW8tmLqibsbn3Eu+XCVctSh1ZV6I7WvyJzZA4zLaZufIUzcaDF+CZGYvQcTAY6EHcZ7YltEosMvjPAnOlyqQbn3kXfCAvJPnrfb8/jQ4llLUY+mzM/bUoSFWV7csQk+6Sd1WHivvu8y8LPFN8OUk7fRKWHgYUALlGv/HW8nDqzzyMGHLdDRnD9/PBIgYCTw4MLTk8MdsmKcvAuX79bbUIXaQBFmuDh14pdJlfW5FTH/ciolBD+ZnxSpvMRfgqW7Ee7zK5Rq9tvCRMA42ZIpzYb1Fg7TBWpUGjuhwg5TjQ/16J6PBVu6Qk/3CtopehX9PiWtWQFXy38jOUJ/T0gBHSn3bisUXcVKT5X3MKs++lcubssyZBvfOou4RTguhVTaYupbl9D8QojPAInK; 4:fOZh3FaMWc7KnqI+gP5BUSuuIY5TphQUI2V0KyjonL8LQGonnyRyYBcXxzG3Erjef9hvXgVv0It3NclFVbjfBRr86Hrz7l/MuWpLq5WKFQgMwoOCwnt7MVgCEjlbDNe3Y/d4KIVDVITRVZ0A2Dj9p8tqukg08+S56x0H6cvOYJr6L15ovqzG5Pr65HV+hYwUN8A6zH0nlYs4km6V36U3SpIiAPTDN+clQPkxmZCYbshkK9UWpm8CFIrwFQm1XFBdZM5Gyvm1La6oIAFrp3yLZ6lFlw31Km7YEzwp5q0EPw4rbZf0gzmWFXui4qxTM3gz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1506; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1506; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(199004)(189003)(105586002)(4326008)(53936002)(36756003)(68736007)(50226002)(7696005)(8676002)(51416003)(52116002)(25786009)(3846002)(106356001)(8936002)(2906002)(53416004)(6116002)(81156014)(2361001)(6486002)(81166006)(47776003)(97736004)(16586007)(316002)(66066001)(305945005)(48376002)(2351001)(478600001)(7736002)(16526018)(6916009)(2950100002)(6666003)(86362001)(59450400001)(76176011)(50466002)(386003)(5660300001)(575784001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1506; 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; BN6PR12MB1506; 23:nnjaOSMMSAwdEByssg+WhrL5r0BtnTA6BuJoQKmSz?= =?us-ascii?Q?FNH1y/bfbeDP8j2mObXV2FCxRq/gW2y1MdJxKhC1F4muaMQzJc3lMQDumoJd?= =?us-ascii?Q?rO6hN1tctZCxww+CqfEo7wliIvWHBVvixSHExVTQ4PqyAueDSkiy0kVsVnwx?= =?us-ascii?Q?3MS9n1/z2708Ib6+hbo7Liz2k3rkUQkxxAN+ujktAfnEgqGhcmQuYnJQJy+b?= =?us-ascii?Q?xuYliCsBWw740sQ8h3Ryii1O1Fflh100JYUgxyhqKjDWvFagQ9Vq1iqudMNZ?= =?us-ascii?Q?HqjsJSQOLNJrrduE9SR9/PJi6S+0NSrl8BtaPopUg986KRMGkrJzs8aYfj/V?= =?us-ascii?Q?TwQYycf347U2Z97AWH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IS1NFMnH7D2LQjD90K6AWuoOwGmwWVkWFxGsIYvmgBOu1pJ++I30OLEc63PEIkkzFwbmyypk12zXd1MKxg3s+hFtzG+TJ1OH4scFnWwLjNJOw6+9u5fys3WwCwVQ2YhBvTD62pFSAWhyMVLI8NLITz41u X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:52:59.1838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70221fe1-2c78-413d-6358-08d554221b17 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1506 Subject: [dpdk-dev] [PATCH v2 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: Fri, 05 Jan 2018 09:53:03 -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