From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D9B9FA0559 for ; Mon, 16 Mar 2020 17:09:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F72F1C10C; Mon, 16 Mar 2020 17:09:46 +0100 (CET) Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by dpdk.org (Postfix) with ESMTP id 581441C0C9 for ; Mon, 16 Mar 2020 17:09:42 +0100 (CET) Received: by mail-pj1-f65.google.com with SMTP id mq3so8964955pjb.0 for ; Mon, 16 Mar 2020 09:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XYfNI96F6gHQpFsgkLxPWY5bFlXABCzGNODbwuRb38w=; b=hU5gf3L4BIp0wz6BI2CtKd92J7gb9oiqOW/Hol43PqqHFkDUkxRAP3mFIYdIbNJbXl rraT3b7CzjEU81l6bjmHoB4Vb1Eb3tcG6rfXjCToUo62sBPaFHJFqXb/4RDFdVR6sJlK cR4A0mcfEvZZj4NO5uS8MIDwar/bqwT2BI38acGFEyqVGm2OjMCtfNKsJhHGz4KQMrLt rsNTcr+n+Fjpi7bxGHKOBwVuLuuXQhnFiJkytG2qWSRNrP6h8EuW/s212oA/CXiT5B// pBm0gaKghe+GQR2ju79bSiEprlPWVwqhEPuZKPg1eVcrDs5cFHG8LxOM4JTdEHUJFSVW wjSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XYfNI96F6gHQpFsgkLxPWY5bFlXABCzGNODbwuRb38w=; b=oPvfudIe0h6k38LNHDQAcCLZdqK9Yn5ZgnozCLc8ZjURqGC6u8vywP14TT0fTGElKH KKhxkjwQNxqAI5zWULGTa/7cCXCnXWiM413XOs7WYPSD6Lrhf9eQAQGYcLjzNmxEo4HT 3KaiXaDIzLEiHB7xYj6twqtReTQX12sJX9WW/i4LPu3Wpdn14E9+xH3Jc7rsDOQOk2LI itFIMeE/8GGbzKF9aaG3jCkUFZe5SbNBt9Ejz2RNcsKp3xCdpoPJLWXERbe1Oik1guAl Ejze2zpb/FIBB5lmrpnNl5f03/6pefQyw2Yj5zo5GW2MzfQYY8w5TLzriHIqvaK1iYTK c76Q== X-Gm-Message-State: ANhLgQ1cP2Mmey28sYruNIeIz7rALBq+prLjP62iJvNUJb7lxrGkZW6w VxLpChOqADP0G/Z5LgJDt6u+TBR5A8I= X-Google-Smtp-Source: ADFU+vtCz05rstY91lz4960JYgQprLZpIWqXXjksLw5awHKz5WuGheAQr31L9C3eWL4A3fcOoZExpQ== X-Received: by 2002:a17:902:169:: with SMTP id 96mr15511053plb.140.1584374981098; Mon, 16 Mar 2020 09:09:41 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w17sm361952pfi.59.2020.03.16.09.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:40 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com, stable@dpdk.org Date: Mon, 16 Mar 2020 09:09:23 -0700 Message-Id: <20200316160923.5335-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316160923.5335-1-stephen@networkplumber.org> References: <20200312172047.19973-1-stephen@networkplumber.org> <20200316160923.5335-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2 6/6] examples/tep_termination: block attempts to use owned ports X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" If a ethdev port is in use for a sub device, then it should not be allowed in the portmask of application. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/tep_termination/Makefile | 2 ++ examples/tep_termination/main.c | 2 +- examples/tep_termination/meson.build | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile index 645112498d33..f55331fb24c2 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -26,6 +26,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -Wno-deprecated-declarations build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build @@ -61,6 +62,7 @@ endif CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -Wno-deprecated-declarations +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index ab956ad7ce96..96c2d934cd09 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -507,7 +507,7 @@ check_ports_num(unsigned max_nb_ports) } for (portid = 0; portid < nb_ports; portid++) { - if (!rte_eth_dev_is_valid_port(ports[portid])) { + if (rte_eth_dev_is_owned(portid) != 0) { RTE_LOG(INFO, VHOST_PORT, "\nSpecified port ID(%u) is not valid\n", ports[portid]); diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build index f65d689802a3..ddadf1c2aede 100644 --- a/examples/tep_termination/meson.build +++ b/examples/tep_termination/meson.build @@ -9,6 +9,7 @@ if not is_linux build = false endif +allow_experimental_apis = true deps += ['hash', 'vhost'] cflags += '-Wno-deprecated-declarations' sources = files( -- 2.20.1