From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0047.outbound.protection.outlook.com [104.47.36.47]) by dpdk.org (Postfix) with ESMTP id 741F81C955 for ; Thu, 5 Apr 2018 08:40:22 +0200 (CEST) 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=MydJttkiTcg6RwwZUjZkeS73bDeDjHjqR1HIcQIoQVw=; b=V0cPkigHA2clUntxhpM2XOuVQvfvIfOWSH85h8dTUEEUM9kXF1d3OVtnqLT1cbHcKzI9GU3dFGa/A+EocevUTWGoEsNpVjIIhmUTUdsdcX7h3j+CmvNucvI/lAoJgSXt+yVkotAi0/hqL2FMfemlUZ4+kfWpIPpZ5RNei9Yl4o4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Thu, 5 Apr 2018 06:40:20 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 5 Apr 2018 02:39:39 -0400 Message-Id: <1522910389-35530-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> <1522910389-35530-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: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::26) To BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6e50f3b-118a-4bf5-3bdb-08d59ac01ae4 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:jtqTBDO3ZKcHkVn0aumNjHBolTETsVixYxzryCRYsRlUm22tbN5VmrJw68HYGo3FH2Ny3uvYoVnZn7JvVbccgMRXA/VonivQkputYLq7UGEi4ISjVcrl2Aa4Exr+or/WJewoqQXDeoJfW1lwQ/rFooalrIGkZpbb9HqaiEHohdAEcjJIWvrAi2G2jlMYzn96kR1fWv+3QzbWzOfFboC/DBjYYEOX03u2Npy5NH4nwckTdwfD/dkZAyMKE4YWvg4D; 25:5sonj0sry0TnXCGdlvxDHFnPWkjoy6navqPPBnA+nqZlOuDUlRe5xrCDZ8x1T8ao7ErPcjx9QK5HrpPMnWLDtEezLDg781+a9JTe8+ltbWQheju5KVC4GC0GxNcp8LOfEXIrncK30CkcjYS9GS+QN6gpo5tqXu4/VW9MtEg2gAkav8mxS8a7211pKWu25C/PyBoIm1UZZ2E1woUCp4KYXbEInLwpmhXb7cKwGj78dSmKrER11Si5IcfoBnvc3ci3xdXt+lFmbsgOZGbkzFEDupvuiNjpFQbl0ZT0yytHUtmYFoKwVSNYP+fGfZ8OGycs4IkgV48aIEsQESL/0DdOLg==; 31:nScLTDP6QLdqIrOcy4nzRah44kju7py787yGOlSTHVDFEKDVx7bUfiZEppKcSCK86pltBogNhBKttN952w/LOkaYSgoKEFjGgf/ZFH32r1BJXyojIM1HGkM7WIaynn1uejRqVD/EOWeYra/aoQI9xWNqJxePbuMiQ9i2gbD51SANadxEm9Am13LGeSFZFJsTvOYez1dbr03F+SMvD7+iEUgxzGj8P8RYeFkNrPxikDc= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:PICSEImm184d+cfbdhIRhHMb0qBpTuYGwnyhA0ETyE2gvHG0hR8umF7PXZO8JtqJuogcrYVQ6ggD67MRF0YG1b7VfStImInhqikFjYZKrmuDDWzPWsdRu7o8Giy4P5vatBenaLPnghNV8TnTAr9WuwzXdtv2ycaibScKRkjQaLugYCBMMwvQF5JYXW8TLoJrkuWPeb8ZIQKvu2ygiGdW5LA/lst5i/FwS2Q3XW0FoWgv3HICH3vKCUPVj3EG/8NlSNmLjAIXwYlTQfIj+GymLUEoL/YZ7emYlIT8s7jWCBFkFWr0fkQb4oD1bAofzpfQ4QQWWN5CGFo1Nk2Jexlzzb8hWWy74V9W7F2clqaeCq8Aid2o5DDnU8fSdytPDHm8MTRpvviG2/kWa05/AZ8cxqE158jGtHCb9S9OHu/d/ws+nYONPWrqU2zSRxEWTNg8D1/X+8CqSY6uqPwFBUJlFO0JmdSPZHgBdkHjr4H2q3eh118uQt9swhdpWznQKrou; 4:3sxtjD5D4KPdFOLbMsR7OXLjgohROpNDLXFfiLRsyolIXv6z3nalGqEY1tkX2CyI38RcDxcEqP/tRRGfYXv+gc13lg/QAvOUBcp3vaVDKOXtBXAa9nv4cG92kumpqFLcF/Bkk37ADnVFMVA9OU4v468qtBXnogbLhivFKmoAS7erRQ9ODuv4w0dOYEDGA/D3dfQnYjFql3B7cGYx6zFFh2WwXDIMdKdQ7gkWhxXIzybhIvWimi7OyaNJm0Fh8Kk4fzbBzlchhjY8sb569yGVtfpT9+USlfm+Iv1eP7Yu8aUbPEhogZTracnMJaHZvUiA 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)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39860400002)(39380400002)(199004)(189003)(3846002)(476003)(2616005)(316002)(446003)(956004)(305945005)(7736002)(478600001)(16586007)(16526019)(6486002)(186003)(76176011)(5660300001)(59450400001)(97736004)(2906002)(6116002)(486006)(386003)(26005)(50466002)(11346002)(25786009)(8936002)(86362001)(50226002)(66066001)(47776003)(48376002)(2351001)(6666003)(2361001)(6916009)(4326008)(81166006)(36756003)(53416004)(51416003)(68736007)(7696005)(8676002)(106356001)(105586002)(52116002)(81156014)(53936002)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1505; H:wallaby-smavila.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1505; 23:LHhSVbg9MtDbKhzyT+1c7tFOXbw53VM3Pya2/zJ0x?= =?us-ascii?Q?MYmBFBqWCGANXlJ6MClMqfjtHkvVPmjcovPv401Y87A9e8A/Msu2ZeUWkL5x?= =?us-ascii?Q?ZJQKXnTcytf0y+3ICL31AzF+FxotH7obq7o2+A+OF94uYiOomW8NHbxUDvoI?= =?us-ascii?Q?i674T8B0VPDn/O/SpwtmnagWhj6iFYd7zVqwY+j6zALvpJSeoQKQB2xN/ZWr?= =?us-ascii?Q?qhRd2d4ZsGQvMH78OMgkmnpT0TG4HwmuxL3Uxu1IG2s5WQoY/Xjew6JGj5H9?= =?us-ascii?Q?LBmzvGHExVOS3Ov5Qq86T+9TWm+UG/hBMd7jZydXfpzJDDHmdXvoJyH80Nnl?=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ASTYuvi5gXvTszVxBXoU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 7:iUperu6l5dGTF10Ut0myyoj/tcSSaZYhuyS836Vhb1PCuMHgRZ0RJuBjVlHkj9md3tA3cTkdH9qn4h1sVvAE+xMdP8w/aW8XSRB1Fb6QuWSKVjWx5JgJ8y82crBYcP26kOLWiKLBuNOsdBztVcbtdjCw+nXnjHbvh6Rv5gy5Wejt+fX8sM4DgvuXXenQ0tkxkKSuLr+GOvRYAy72/H/kJ6NwvjvB5R3rpjkM89kXrfEMpy0HyDCOlJWsHhUPD9Cs; 20:cE9gQLokG0X679KAII1jW4hCdlw0mtqIKWySoU4LWwaMyYC/UftYyWS85cUtLlWRAvsTeNsVB4ytHDAaQmD+1TCfQvBLYmFupgw8FH7TVTF5DDUIo9vwHYybw7uTdq8Q8fWZYuRgGwFcgxHHyEgwodaEEgwImnCXFDNhQCzGQT8LCHfD3Lp5CNq3iZfGYNanzXa5XmWHtUhwaghzV0KOLIS7NLonExe+g5LdQ09kROXqAk1ZKV3ZgWl8gcbhVSSI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 06:40:20.9349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6e50f3b-118a-4bf5-3bdb-08d59ac01ae4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v4 07/17] 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, 05 Apr 2018 06:40:23 -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 d4cf279..7d2efa3 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -9,6 +9,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 @@ -46,6 +47,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; @@ -347,6 +372,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); @@ -357,15 +385,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