From patchwork Tue Mar 27 15:07:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Lomovtsev X-Patchwork-Id: 10310445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABED560212 for ; Tue, 27 Mar 2018 15:12:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AFF429027 for ; Tue, 27 Mar 2018 15:12:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 998B5296A9; Tue, 27 Mar 2018 15:12:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 813D52A09C for ; Tue, 27 Mar 2018 15:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5WFZGxUARSL9mSgqeIiXqmndky5yq5Jv5JnhMiyq94Y=; b=GCMHug05+Vf5a+ uBDVddiT8VcIDt+U8ePBSeRPBb4OJbTM2r/sViNbhHmEM6xHdODV5tdNp3DmC4O8jJPuTC21Mewy/ RAslT0CpWrQDS/eo8+VgCp1d0PeGSBhHw1WoC9rWI1VYi8/mrUJWA90sSMI6hBQRhAtPHFYErWNTp 2ysX1XvnO0ETyqyFZKtvPacGCjOTnz7nudx4kE0sflgytmeT0if2WpXvuyPc+ndEthBKusb/64cKn q/Fp9dhsXmIAU/MbQChkiWWZnGnp5Fedu6/99wgPHF+SKVtDq9vytYwu11Yhk2FBTtZqLpRgPdd9q fdUAFxi5Qs0uyJfNi8fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0qFe-0005Oz-SQ; Tue, 27 Mar 2018 15:11:06 +0000 Received: from mail-sn1nam02on0045.outbound.protection.outlook.com ([104.47.36.45] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0qCu-0001pP-Nh for linux-arm-kernel@lists.infradead.org; Tue, 27 Mar 2018 15:08:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hT27zMpaPwJFvaNwY0360HpmkZfT7kTc99WCJkAHui0=; b=lqp8u0DwT9VowjsxBkfYUqdAqE/xZwRJdkSpsz5ynX6+ebGJ8lPgRtt16r8Mu2DTyp1Ja0UXw1yX5SxCnTauvBDWEkK7gY+knD4BtekMZxyVHgwQ3dUTqbIFvfSMY+jlRwpqwFCUvpD5/FbQNkhFrAIL8C0GSie9tU1ZUEBeFyY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Received: from localhost.localdomain.com (50.233.148.156) by CY4PR07MB2998.namprd07.prod.outlook.com (2603:10b6:903:d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Tue, 27 Mar 2018 15:07:52 +0000 From: Vadim Lomovtsev To: sgoutham@cavium.com, sunil.kovvuri@gmail.com, robert.richter@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] net: thunderx: add workqueue control structures for handle ndo_set_rx_mode request Date: Tue, 27 Mar 2018 08:07:35 -0700 Message-Id: <20180327150736.10718-7-Vadim.Lomovtsev@caviumnetworks.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180327150736.10718-1-Vadim.Lomovtsev@caviumnetworks.com> References: <20180327150736.10718-1-Vadim.Lomovtsev@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: DM5PR20CA0003.namprd20.prod.outlook.com (2603:10b6:3:93::13) To CY4PR07MB2998.namprd07.prod.outlook.com (2603:10b6:903:d0::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0e9e9aa-8d7c-4fdf-7aa8-08d593f48389 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB2998; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2998; 3:uDOpFYeVO0GCXXycxuYOc9NiBjbMzoU1U/S+oFMLzETHlyy9LRg1ScXWVbMD62071ZD79tOFCqKHaPrbJykt/GO7HqtA1bh/l0UnQxIDYO8EMAJ8I9sMjUKJNJTHPAVF5bWXzmIZK7xyL00whqDb9t3CgWevopfAvIeu2xknQ2hZ5UZchuCQY2m/l6bnq/jtS/EjZPyyAx95adOGi1Mzc01H32ScvmIzneNN6E65FT+TQVRr3ZqGqIlLok+sO1Bs; 25:DyDDoz7v1gpE7FJzqKpK+RIlLKkJJn4ynZqtwobi8JgJXfmsi5+aVF/lAwNVdJYnApjZFIc94NrKz3sqhZJMnj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1O48t4YEckEzavpNr12q27eD/nA3CgzAhZ9MNRDPbFzwZsy2yAndbG8dXyN7Mgf1ZNMYRngFVoiisExWqSccfG+x3jH5QzjYMQCkNLi+inKugWkC5M=; 4:TIAwF0DEw2Q5Jad+LZkgDwQy2rzZbgSwgqrl195GgkkHO0WHx55gQGxknu743V7UiguNzQs2vmviDCSybMZYhcj3oK2ISUl7bU9Ee7L410g89KPpJmCvD2qnRFPnGMW2X8ecJlsrYah3bd4tVaXKRiSBiQYBC6yjA+uLTxhBkx5YOpjcBlI+82mznLa2U0iWQe/ZfCQtO7xauTJ3VUQ3fQ5yN4UmGMNmHxh9e0kTHcyVbYDnR3zfxyf+IJIOQ9nIUPFBQVMH9FladEqHO45R3g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR07MB2998; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB2998; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(39860400002)(396003)(39380400002)(376002)(189003)(199004)(446003)(2616005)(6116002)(478600001)(1076002)(107886003)(3846002)(6666003)(956004)(97736004)(39060400002)(50466002)(7736002)(53936002)(16526019)(66066001)(47776003)(26005)(486005)(486005)(6486002)(6512007)(316002)(305945005)(11346002)(105586002)(42882007)(6506007)(386003)(68736007)(59450400001)(69596002)(106356001)(72206003)(25786009)(2906002)(52116002)(53416004)(76176011)(81166006)(8676002)(36756003)(476003)(2870700001)(50226002)(4326008)(5660300001)(81156014)(23676004)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB2998; H:localhost.localdomain.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjA3TUIyOTk4OzIzOkc0QVVKMk9LaFhGS2ZTclFGWkpjaWU0MUoz?= =?utf-8?B?enZVUGkxSkE3OTFHcUtaRURVdlpZbkFtRnZHZE10TzF5Vk8wWkk3WTFRb1M3?= =?utf-8?B?QjdjOFh1SXBHMGpnSnV5d01FdkhmbDl3eCtzZWxMMTJOMzVtZndzK3hzTG10?= =?utf-8?B?T25ETEtwc2F6M2xXM2tVZ3Axa1o0cWFKN0traXcvbXJwcDFMU0lWcmRzaFVX?= =?utf-8?B?WWZjQ1hrTHhhTm51RFVmaXREeUE3VGNlOEFxeEl2Y0huYWNuRUhGc1BWYUFj?= =?utf-8?B?cDlZbVdDT25ZblV3ZzRsVXRMRllXbmlUNUNvQXBKRlF4YWx2YWpGTEV4U1c0?= =?utf-8?B?N1grRm5UTDN5dVpaVnVRczZ4ZWh3UTlUMEtET3dyck11K2xwNWQrdWM0WDNO?= =?utf-8?B?b2lROFhlWGwvTkJYdHhIc01WL000Wi9GWjEwbzBVQkVXTXpNWWNyc08ycG04?= =?utf-8?B?UVRVSElCWkViQ2w5RldxV0lid0pubFVMZDFGbklJQW9DUElWRkpnZ1o4T3o0?= =?utf-8?B?MW8vUExMcUF5NDNoWHluc2VMWkJUU1Z1RGNyTG9uN0lONnMzSVUwZ2N6eXhy?= =?utf-8?B?U0VvWmdrU0hUYjJ1a3Z3bHVpQ00wNy9adFkxSzlJTXpwUXpOR0JqTHVvTDdW?= =?utf-8?B?dFdhdFIvakVPaHlMcmd3cGo0RW9OeWFkNE5mWHNaUG1UWnF3VWoxNjVwRjlH?= =?utf-8?B?MU5NYXR6MTNVQmtVTDJNUTJ5QlVCZjhHbXBMdmpnanN1eXErSlRSM1dTM1NE?= =?utf-8?B?NS9lZTBKNn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0BpZrdQkbFHbkVMJV/+HFmpLhq2AhtvxtYodwwIq44+mAkTU98Xw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB2998; 7:e5U6kR4Xfy5BNAyCo7cqLapJ8bqK2f3oPCcu4HtRuhXibHPyafVZ9ZGeT1VaBpQisg3g94IX6J8V1JNkQImKCb6PKAfGSd8xkoESUdFzcL2D+5/7+bPKIjH76UDpI36plc4rbtU3GFVHkQG4sywFe8frWvPOgaoxsIcQmWUcZK+TKRmlyE6vOkPyUqwrGVljxLYaPJCGQFEKszQDipGS1JP/wkkdI2oqr0RwDwtmXYSNJE8DYeI4KfdsNHV5Bgbf X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 15:07:52.4671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0e9e9aa-8d7c-4fdf-7aa8-08d593f48389 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2998 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180327_080816_790689_F68D78C7 X-CRM114-Status: UNSURE ( 6.32 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dnelson@redhat.com, Vadim Lomovtsev Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vadim Lomovtsev The kernel calls ndo_set_rx_mode() callback from atomic context which causes messaging timeouts between VF and PF (as they’re implemented via MSIx). So in order to handle ndo_set_rx_mode() we need to get rid of it. This commit implements necessary workqueue related structures to let VF queue kernel request processing in non-atomic context later. Signed-off-by: Vadim Lomovtsev --- drivers/net/ethernet/cavium/thunder/nic.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h index 069289b4f968..5fc46c5a4f36 100644 --- a/drivers/net/ethernet/cavium/thunder/nic.h +++ b/drivers/net/ethernet/cavium/thunder/nic.h @@ -265,6 +265,22 @@ struct nicvf_drv_stats { struct cavium_ptp; +struct xcast_addr { + struct list_head list; + u64 addr; +}; + +struct xcast_addr_list { + struct list_head list; + int count; +}; + +struct nicvf_work { + struct delayed_work work; + u8 mode; + struct xcast_addr_list *mc; +}; + struct nicvf { struct nicvf *pnicvf; struct net_device *netdev; @@ -313,6 +329,7 @@ struct nicvf { struct nicvf_pfc pfc; struct tasklet_struct qs_err_task; struct work_struct reset_task; + struct nicvf_work rx_mode_work; /* PTP timestamp */ struct cavium_ptp *ptp_clock;