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 1746DA00BE; Tue, 19 Apr 2022 11:34:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4EBFF4280C; Tue, 19 Apr 2022 11:33:46 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 9C01140141 for ; Mon, 18 Apr 2022 06:29:52 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id q12so16713831pgj.13 for ; Sun, 17 Apr 2022 21:29:52 -0700 (PDT) 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=HNp+9krAUZCTlinhvwcmE1tsnrPILb+jRRSaMZ1qovo=; b=FrKCVK6pI3stkWVgXIf3IwBcWDy8KYyukf9ds5QqxcQhy3SfgRuykJkTL1mdaifJNe wkwT68DKLF7k6wkbVeoHW6YeYgLcAxo+EgVKoxkCB8KQ8VeUH8224I0EXXk1DWrhlyI7 dNl5DdvsNUhqRZd3++wCjtxMCAew01Kpg8gPE= 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=HNp+9krAUZCTlinhvwcmE1tsnrPILb+jRRSaMZ1qovo=; b=xOa8oEreZyp7G+yMsqhPrs+OHCB1MZCLOf2g8Ky+2M1qnJY/FWKh+zua+C93g2YBVs nQG4BYiX0MhRG6j5sup1WKatPkW0CuOTFdFNWo0vi3ng3gg/0Lfv7zjTL1Olxt7Q/BhK oDtuPA0WttaWWm7RK4GKBQexEbqiKE3N67/ANeBD9o13Zg3SPs8rCXZsHAzjbD3TcRbN 15MVr1hOmTG4uOlySEvYE2R90BpaBROHthbz0T5+8vsaeqHeeSqtufdpznGnOIIGSVnd DTiKe172dMuZK7vUhgKX/iffv8wm4d3eSWUyAPx9U7PPOsLnEb+wxEwh+BrpAJF6azm2 B3rA== X-Gm-Message-State: AOAM5324iZFlrMNlMpkIkINojnVe9r1FFTL8qtgNi2ggyiGYfwF4IhZa xLbN0rWLlesGVIACE0c7/P7iog== X-Google-Smtp-Source: ABdhPJzQgEG1NFvM/65fk2/LL/wQKNcjjjLRt0VrMM94qG1sDHelndcV5E6Tc8F+aRzIFd/lcwYADg== X-Received: by 2002:aa7:8893:0:b0:4fb:10e1:8976 with SMTP id z19-20020aa78893000000b004fb10e18976mr10213216pfe.36.1650256191876; Sun, 17 Apr 2022 21:29:51 -0700 (PDT) Received: from srikanth-ThinkPad-T450.. ([49.37.158.191]) by smtp.gmail.com with ESMTPSA id e14-20020aa78c4e000000b00506475da4cesm10377577pfd.49.2022.04.17.21.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Apr 2022 21:29:51 -0700 (PDT) From: Srikanth Kaka To: Stephen Hemminger , Long Li Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Subject: [PATCH v4 07/14] net/netvsc: make event monitor OS dependent Date: Mon, 18 Apr 2022 09:59:08 +0530 Message-Id: <20220418042915.5765-8-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220418042915.5765-1-srikanth.k@oneconvergence.com> References: <20220217160613.70161-16-srikanth.k@oneconvergence.com> <20220418042915.5765-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 19 Apr 2022 11:33:36 +0200 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 - Add meson support to OS environment 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/freebsd/meson.build | 6 ++++++ drivers/net/netvsc/hn_ethdev.c | 7 +++---- drivers/net/netvsc/hn_os.h | 6 ++++++ drivers/net/netvsc/linux/hn_os.c | 21 +++++++++++++++++++++ drivers/net/netvsc/linux/meson.build | 6 ++++++ drivers/net/netvsc/meson.build | 3 +++ 7 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 drivers/net/netvsc/freebsd/hn_os.c create mode 100644 drivers/net/netvsc/freebsd/meson.build create mode 100644 drivers/net/netvsc/hn_os.h create mode 100644 drivers/net/netvsc/linux/hn_os.c create mode 100644 drivers/net/netvsc/linux/meson.build 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/freebsd/meson.build b/drivers/net/netvsc/freebsd/meson.build new file mode 100644 index 0000000000..78f824f701 --- /dev/null +++ b/drivers/net/netvsc/freebsd/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Microsoft Corporation + +sources += files( + 'hn_os.c', +) 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; +} diff --git a/drivers/net/netvsc/linux/meson.build b/drivers/net/netvsc/linux/meson.build new file mode 100644 index 0000000000..78f824f701 --- /dev/null +++ b/drivers/net/netvsc/linux/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Microsoft Corporation + +sources += files( + 'hn_os.c', +) diff --git a/drivers/net/netvsc/meson.build b/drivers/net/netvsc/meson.build index bb6225d05a..c50414de07 100644 --- a/drivers/net/netvsc/meson.build +++ b/drivers/net/netvsc/meson.build @@ -8,6 +8,7 @@ if is_windows endif deps += 'bus_vmbus' +includes += include_directories(exec_env) sources = files( 'hn_ethdev.c', 'hn_nvs.c', @@ -15,3 +16,5 @@ sources = files( 'hn_rxtx.c', 'hn_vf.c', ) + +subdir(exec_env) -- 2.30.2