From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0083.outbound.protection.outlook.com [104.47.32.83]) by dpdk.org (Postfix) with ESMTP id 496AE1CFC4 for ; Fri, 6 Apr 2018 14:37:25 +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=TEcLepa0sbuJUwUPfDU3oaql3y5Q8CfsgpqAvv0TKQWLZQBiq+HPaofFxDr70m/Ro20xpr+L+C73ZhBX351To5iN99galSxYcPcUzQb7pPYGT0l/YkjUGH3kBHa64zcuuSnyy8NNVmt8PeZHvjsNRD015mqSl7pO4lpDgTLvIL8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 12:37:22 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 6 Apr 2018 08:36:40 -0400 Message-Id: <1523018211-65765-7-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> References: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> <1523018211-65765-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: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: af55879d-3c98-4f53-2a0f-08d59bbb25d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:XZky6pIbCWOyvRWrHYmE7FYvFEXaWGUMG1Am4MnwpOAX+JRQpci5I72nrbqO9wvVyKJlo5Ms5r6w9Tr2JT3tFUBjjvF/LShcArYxDN2R84/59aYEdcf8jS4VXmxNyk4JLx1Go9kgOsT/PvqmZl+OBjlei0zwnj0QDsB9IaavQRTQgj1WvYQ0RahI67pRNgrB6U8IRe0c3UdkTS0XgxE+B3yceuAS4S04GoiVyyhczfZLziHUY5jZpYUNnf3lHT+X; 25:7ZLk00jOvbnKRWptBtyQ1HI5dvM2zIKJ3O6mmtOAaDZdoRTO4JZ5uklF3NmClMCqpQkIR5VliZu9k3SselDKE7cWD6RCobsa2TKWtQGhIGiBeKHklGIE0TzD+bvqEK12KEFkyaRd/wDwJc7MVYWX+L6POlXsUK0uoZcCy9GChnM7dG07BQl2Q3oM0URqbLFJQspVHeC5DQ7ILQR2zSwGrA7v7s8MsNkbW0pnwLWjOAMXYwOpnGn2C9u36PltcWChgBJcbn1kZBug82LIsB0HmVidkElm3/ALWCs82UR/cpJePBPRXFGwppP/UwvW5ejD76wRgy5Kfyhhgy+KoPruLA==; 31:K/S31WyyziHO/gwMWoda5rS4rgSFDs9mHHIyfCIFxsE52rC3YswsY+2KeLvdc0ox/0PQt5vTXjXShD21B36dIFns7EzIFkxY4HY9euJzknjFJOzd7RMH78zYtcEIH7Tycyh5K+6xhdJPPAftNaoVISqNtI6fXz7XabiurmnTddslL5Gr7fUOAryZ1K69qd7vFYDmI2oa6zEW3PV1YUWcVR+fkUJ2o1M5Oja669A5QVo= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:j+BGt/oaInqdan8+r/Cjfx05whIqgf0dJ/L1pA/vRKZMjZpN22jYM+R+ipGVUFUZStK0E4tS4rk5JxJfet1HkKtzNj9hZlGzOLveShZHnCrv89w64rdjF/zr5aceQm8fGASaXVbBxn4t9eXLmH/3wOX9QQMbv9PHKOXr3VMnq9oSVlkyz0n/KTUS827igWCh/ygPcmmVp57gwtyhdA0UIg5lSfWgil0DnGscAXinM4kBm6WJ366W8A1xw1+DYrBHLpLbrLwg+e0dM6MMdqn33QKJbo/+GTOp+9peXhdwyOk4P4oKDP6wMuKJDeoAwlwgBEJZJto30Zs9eXp+ZKUKukiftqdqOKhWLzLw/lXhHUkqseNDTx+BX9R2WuAp0ZRVA156HMqhxdQxJqFxb0LZReE/RaVud72T0digZSubY/ke5XgylEJh4nV+NjTYFATM0Evf3fuR+uZ9CdffBFL1jCTeIEM/6XMQEWInW6k6msgzEPhGob/rTl6zhlmSV+il; 4:8DHN0DNjytXotz3IonwNtVq9XKB08apf60o/tuAcNaODjdLwPzfEiuH+p6/iEhhb+e7rlhn21fE3+P2cof3+rJ86Uip8doQj8kCIJJwODmw5QcVjXWyuL49wZ+aGJwkE8pjM5y0yD18sbd6hvnB8q8WT8e/qU0g8UX9Fk8LyxuJwIGXKq3GeUtoLAwbZqyMuWl7JQIU6s7RLu6+1t9BSPhrLbpi1km5EAAuav8WnfFULGlyKV0ZN0aE0yoYKSAw58ByzTRLRfV/TmuEwqYoJocfZvoSUyMB8Sb0tUvIoH4CD/M11FPz68tbQKcAD/Prj 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)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(366004)(376002)(199004)(189003)(48376002)(72206003)(7696005)(105586002)(478600001)(6116002)(50466002)(3846002)(446003)(486006)(53936002)(11346002)(68736007)(2906002)(2616005)(51416003)(386003)(16526019)(186003)(26005)(76176011)(956004)(50226002)(16586007)(476003)(316002)(97736004)(305945005)(2351001)(2361001)(25786009)(7736002)(36756003)(59450400001)(5660300001)(52116002)(8676002)(6916009)(6666003)(47776003)(4326008)(6486002)(86362001)(53416004)(8936002)(66066001)(81166006)(81156014)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; 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; CY4PR12MB1509; 23:QaRb2VwWwUnpEbtWciOKQbzmXvXv+jn9tlM4k++R6?= =?us-ascii?Q?/3cabt5oQrScPeV1WFLKwnm8EnoEIvDzF8+36aF8sofqPXd47v15602SFWnX?= =?us-ascii?Q?1cGcAR8gTKfHH5i+a4e867DzHBMjaMWuc9ILZfR5J9jHLh4E8lyX9p1XPeZi?= =?us-ascii?Q?r5tEOl40xomc32IDsRlZjsCgjS8Raj4oVuhxXI62Jh/+rqpi/C6WAaXt3r8v?= =?us-ascii?Q?nQdPY/dkXLCJlETRtJk+JVM/3xlfF0rYBzwXxN7/OSW2YMVYz5RgVH1+5O/F?= =?us-ascii?Q?t4yCCmMTBmQ9T8TLKb7KzrrVPL+1imlptOhs8vawvv/6pvRXzvqiupYk0elv?= =?us-asc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H8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 7:7fIMIWqg3jL40XnOdXuy/gHTWh8QYw1N/quqQHkochfOUXOkoIloiw97hiVT8BTK0N1Krto1blRedcWX/BoxnN4x6f23dHY5zAKF4AC7YGalf/+VOxYD6WJi3XzbVDzyr0xGZqbNmzO7snhQOr4ppdmhH9JILz3RE9WBU81dlE4MW6I1JmHnmu18A4vjAGALhK5uD3aXuxUm1/qdlDC2o4PlnDr+akOMnJZViCem7Ief9tj1viOo7ILVQ6+Rk0CG; 20:yKbD7ov4pda5xeEo6qsEAHNFmp8Z5Rz1+VxtZ8kmV3fpvjRrL8569dm5cq4GiqDLbKjn5vVQklH7TvAYjda7wfUg5vmOCTLLvauOzT/f00IWr2l56CjDSteK5rJCNWeTxx09ye46/eq00UNpSztcjHBCwKkY2B22THXkI3XI9hnYLOBG+pwcGWYGPlZ5uMcLSLeiLFM5HBDb99SJUjojLS1FZzyN1BTgOzYwuIlNTZ27iXEDwsaCVBlUM2TQkcvd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 12:37:22.9284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af55879d-3c98-4f53-2a0f-08d59bbb25d9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v5 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, 06 Apr 2018 12:37:25 -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