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 25D28A034E; Thu, 17 Feb 2022 17:11:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C34041161; Thu, 17 Feb 2022 17:10:57 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 8304140DDD for ; Thu, 17 Feb 2022 17:06:42 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id k60-20020a17090a4cc200b001b932781f3eso6576227pjh.0 for ; Thu, 17 Feb 2022 08:06:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneconvergence.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u0fv533wF2B+YqedxSjqeabC24fFHSNjsRbhFAGcrp8=; b=Q3MMe8pT2L+p982gh3V28gdXLUf3am8cjC65OP8x/kaBXSWjJdIPGo2yI+PVQYZyF6 77c6BfjzcmmpEWnKrN/RDZDxElRWCQyVQb26BTFam/b0jUd/T8P3WwrlbgSqvsanBS4c 9mEPLBTSvIB1+Uo2HFFwJB04EJLhl/QkHxxoE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u0fv533wF2B+YqedxSjqeabC24fFHSNjsRbhFAGcrp8=; b=jOkG9xaDuLEbZ650p3kE43dRceJ3N2O4sulcDqhGekg5YKfLDVvQCSqtK++Wv/NiWo rjt2MSBrbAXyRsiD0bH/Betqx+ZYDcWjRg71lxYxF0paR09U5hdZsZtruWHYFA2ePMXB /7G4gHEKrI2x6TaSySgj2aPxwH+R3SVPc77Jf5lYr9y1YX7zM5mnIAWHAxiYtvyB8KRU +7h9++3AMcDNB96hoyySd02/9pk6R6I1IvF5RgZmcxkyes/GWnEZnOWF5I2rNN+cR0le ejCyx3p+S10Eg2Zf2n9UhgzmvsDAGcm15hq9Fz6lCGOO4Osv5gNGy5FnmSdFEhrusDq7 RRjw== X-Gm-Message-State: AOAM533w4UYyDqPfcighBe4xcBVwwO1C16l9BNrSNvTzofkM2Ic77B8h 1jMAurpN70f98ZdBmLsyxmqwGw== X-Google-Smtp-Source: ABdhPJxow1WVvPSJmtXGuVfc5us4HHFQwLZsvWmNodPAoGjLfQ10N+KGsJfrm5gXQLVy1aoKQqEKKg== X-Received: by 2002:a17:902:e94e:b0:14d:85a1:c846 with SMTP id b14-20020a170902e94e00b0014d85a1c846mr3500099pll.120.1645114001731; Thu, 17 Feb 2022 08:06:41 -0800 (PST) Received: from srikanth-ThinkPad-T450.. ([49.37.144.122]) by smtp.gmail.com with ESMTPSA id z14sm47807pfh.173.2022.02.17.08.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:06:41 -0800 (PST) From: Srikanth Kaka To: sthemmin@microsoft.com, longli@microsoft.com Cc: dev@dpdk.org, vag.singh@oneconvergence.com, avelu@juniper.net, Srikanth Kaka Subject: [PATCH v3 05/15] net/netvsc: make event monitor OS dependent Date: Thu, 17 Feb 2022 21:36:03 +0530 Message-Id: <20220217160613.70161-6-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220217160613.70161-1-srikanth.k@oneconvergence.com> References: <20210927134231.11177-1-srikanth.k@oneconvergence.com> <20220217160613.70161-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 17 Feb 2022 17:10:51 +0100 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 Event monitoring is not yet supported on FreeBSD, hence moving it to the OS specific files Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/net/netvsc/freebsd/hn_os.c | 16 ++++++++++++++++ drivers/net/netvsc/hn_ethdev.c | 7 +++---- drivers/net/netvsc/hn_os.h | 6 ++++++ drivers/net/netvsc/linux/hn_os.c | 21 +++++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 drivers/net/netvsc/freebsd/hn_os.c create mode 100644 drivers/net/netvsc/hn_os.h create mode 100644 drivers/net/netvsc/linux/hn_os.c diff --git a/drivers/net/netvsc/freebsd/hn_os.c b/drivers/net/netvsc/freebsd/hn_os.c new file mode 100644 index 0000000000..4c6a79872d --- /dev/null +++ b/drivers/net/netvsc/freebsd/hn_os.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2021 Microsoft Corporation + */ + +#include + +#include + +#include "hn_logs.h" +#include "hn_os.h" + +int eth_hn_os_dev_event(void) +{ + PMD_DRV_LOG(DEBUG, "rte_dev_event_monitor_start not supported on FreeBSD"); + return 0; +} diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 8a950403ac..8b1e07b775 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -39,6 +39,7 @@ #include "hn_rndis.h" #include "hn_nvs.h" #include "ndis.h" +#include "hn_os.h" #define HN_TX_OFFLOAD_CAPS (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | \ RTE_ETH_TX_OFFLOAD_TCP_CKSUM | \ @@ -1240,11 +1241,9 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused, PMD_INIT_FUNC_TRACE(); - ret = rte_dev_event_monitor_start(); - if (ret) { - PMD_DRV_LOG(ERR, "Failed to start device event monitoring"); + ret = eth_hn_os_dev_event(); + if (ret) return ret; - } eth_dev = eth_dev_vmbus_allocate(dev, sizeof(struct hn_data)); if (!eth_dev) diff --git a/drivers/net/netvsc/hn_os.h b/drivers/net/netvsc/hn_os.h new file mode 100644 index 0000000000..618c53cdcd --- /dev/null +++ b/drivers/net/netvsc/hn_os.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2009-2021 Microsoft Corp. + * All rights reserved. + */ + +int eth_hn_os_dev_event(void); diff --git a/drivers/net/netvsc/linux/hn_os.c b/drivers/net/netvsc/linux/hn_os.c new file mode 100644 index 0000000000..1ea12ce928 --- /dev/null +++ b/drivers/net/netvsc/linux/hn_os.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2021 Microsoft Corporation + */ + +#include + +#include + +#include "hn_logs.h" +#include "hn_os.h" + +int eth_hn_os_dev_event(void) +{ + int ret; + + ret = rte_dev_event_monitor_start(); + if (ret) + PMD_DRV_LOG(ERR, "Failed to start device event monitoring"); + + return ret; +} -- 2.30.2