From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AAC7A0C43; Thu, 30 Sep 2021 19:39:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0C55410F0; Thu, 30 Sep 2021 19:39:46 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2082.outbound.protection.outlook.com [40.107.100.82]) by mails.dpdk.org (Postfix) with ESMTP id F40AD4067E; Thu, 30 Sep 2021 19:28:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T6iR/OMd4rqDFL38WPfZDNqu+n04s5thY2yisPVV+g3dtR+Xv8lvZB+RhBAhxLzO0LobFE7tWRfpSrfIzuRPMYPNK1zpoWcEmTIF47IGbCQaiq5FVOynUdM2kzaUHwUG2fmmXK4k1n+ShPx3iwOSClCX2lsjJECy+NnlRs7pprmAC3+mE1ufBwZLGrmPoPg2uNyp6aAyVmypgYMk7jD8yXJy5IE0wEOXWRTQjPtI8cIYTEQniavqJL1+kdJRvzs3NrBpybELVsULmG9p+2LVl1YXseGTPfDhfwIWLyIU/AQ7bGKyXsgm3EcyPv6six38b1WeU0iaWu/FiyM6k5ELOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JTFX3lSI9yoy35hHZ/ittCrShuad8icPBzu/iw1sVtk=; b=DS/pmBMzdMlO7rkKjL3HOg+GVAPZcfhxG5yi1XqAzt0pXD3RKrJL8DUkMoS3WYgZjfkiD3A9F2LIj5sEtxudN8AEwSRF9ITz1yG4pffCNPwSf20/yInT0whmbAjrTJ4pExRVmnLcatJRKFeuWIzWJutaq99iHA1Ei8h6roX+Qw8b+ja6SaqIw5WrBkYnZfiXJEdIGtVe8wqViMF8UAQ6UwowR7gMVdxGloqbdAOeRYoGz87llsHjN+uUe8TCO2fHxGdhZvG8DyO/CiA71OblxBT2D/+NkWG1Ld4SgFJTIVJqCFcDU4aEYZ3EYO+ruz7Cw06KcTBAjuwB+9C+29kVDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JTFX3lSI9yoy35hHZ/ittCrShuad8icPBzu/iw1sVtk=; b=ZPd5Uahr9Eo90Mvh5f5SLey8CLUuayypHPkePioU1Jwj9uBOH5rTdAT8q6OgvZ7b48zB4Dwu+s/ccsU4zuZU0GRbpwFH5FRoh1UDW019BP1hO1NlBRdx4GJeR6S8KKuNyyTUq6FVDsLnV+8JHVE2BA55Q320oNEdo9H13aOiTpwMfw96FDgqNMB2a9SucR+K9bv6ttIOaF/Q/5enORPAsssZGEucmHH82jTxf8VS+qXKpK6QrZygWLRqlHmy/L/zbVYyJqjGKr9Dj2loVsDHqaOh9cbpeMSR5niXiS7iqb5zh7kcpgEnE5po15ITItpk9I1T/qxj+s8Th8pbYh6Aog== Received: from BN9PR03CA0872.namprd03.prod.outlook.com (2603:10b6:408:13c::7) by MWHPR1201MB0256.namprd12.prod.outlook.com (2603:10b6:301:53::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.20; Thu, 30 Sep 2021 17:28:47 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13c:cafe::c4) by BN9PR03CA0872.outlook.office365.com (2603:10b6:408:13c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 17:28:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 17:28:46 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 30 Sep 2021 17:28:44 +0000 From: To: CC: Matan Azrad , Thomas Monjalon , Michael Baum , Date: Thu, 30 Sep 2021 20:28:05 +0300 Message-ID: <20210930172822.1949969-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210930172822.1949969-1-michaelba@nvidia.com> References: <20210930172822.1949969-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9d76a4d-83a1-43b8-f7d8-08d98437c287 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0256: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0FHjYCkQ8xzG0QMTaHqRBVFluycoa/g5fJaqOHjr2iGH8x5gTX9kf9xkOCv/Y2Itu0/4xO8xp/gXneDRdQAyiQP6o/plKpD0K1/ADVn9h47dpCCQ5kz8UYh6FeEAxksTr0EspflP/blQte0heO7Em+Mk+fGRWuZkk3guATiJ/nnYxtjMV8hSnsA3PAsrmhV9YfU4OS13OGk4OWopyRRhzUL1urANA2lCKupAG/kroV1gJPcTBtreEoCEdsYJ9PTM7dQltu+WXgF7EgDqdWM0dr3n5gvpl9OPD2V7XBMgS2MdcJ3eIMe0PAqmWMUrn6QsUXARerAk9EoMOsfWUpX+7OOcfYY1OXE4AW8wFEhrs6HKL+c6JzKpeDTrjlOk/fKyQbG591z2MIwLuXn/jqdRLZWJ3sbHQGbxWmaUUM16YHnKXJnrxMdKDxV/ZXEgi0ltM81H+SZ8hBNcBZDh46ujPSDVwYWRtDw+1j3Z+deGCCgsz36W+OKxXSYoiEGfzTXUbTHXqqBmjqEA3Y9YlCsgom2RrHbvmhpu9dVIWxt/aC809DM1wOVuUox3G2UCxygLDPuB7jOTXEb+F5Xqmjr/iZezTlO9CRbintJibFQfV+rAbgMGZOh95sm7ik7b3MvfWGyD6jeO5H5vXWjiTshFi+js4EqefGj7djH+LOsBB67Es+cgFiJEEsNyx0QBCsa6dHUsmW562zGWtaPjgxhuoA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(82310400003)(26005)(426003)(16526019)(7696005)(356005)(5660300002)(55016002)(336012)(6666004)(508600001)(70586007)(83380400001)(2616005)(8936002)(36756003)(6916009)(36860700001)(54906003)(70206006)(47076005)(316002)(6286002)(86362001)(1076003)(7636003)(8676002)(2906002)(2876002)(4326008)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 17:28:46.9705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9d76a4d-83a1-43b8-f7d8-08d98437c287 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0256 X-Mailman-Approved-At: Thu, 30 Sep 2021 19:39:43 +0200 Subject: [dpdk-dev] [PATCH 01/18] net/mlx5/windows: fix miss callback register for mem event X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Michael Baum In device initialization, the driver registers to free hugepages events. When husepage is released, this callback frees all its related MRs. In Windows initialization, this callback is not registered what may cause to use invalid memory. This patch adds memory event callback registration in Windows initialization. Fixes: 980826dc6f0f ("net/mlx5: probe on Windows") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/windows/mlx5_os.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 149253d174..459414d5c2 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -122,8 +122,21 @@ mlx5_init_shared_data(void) static int mlx5_init_once(void) { + struct mlx5_shared_data *sd; + if (mlx5_init_shared_data()) return -rte_errno; + sd = mlx5_shared_data; + rte_spinlock_lock(&sd->lock); + MLX5_ASSERT(sd); + if (!sd->init_done) { + LIST_INIT(&sd->mem_event_cb_list); + rte_rwlock_init(&sd->mem_event_rwlock); + rte_mem_event_callback_register("MLX5_MEM_EVENT_CB", + mlx5_mr_mem_event_cb, NULL); + sd->init_done = true; + } + rte_spinlock_unlock(&sd->lock); return 0; } -- 2.25.1