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 BB8D8A0471 for ; Tue, 16 Jul 2019 09:30:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 63A9F2BAB; Tue, 16 Jul 2019 09:30:39 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 4892C2BAB for ; Tue, 16 Jul 2019 09:30:37 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id f17so4683512pfn.6 for ; Tue, 16 Jul 2019 00:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=vFdHP0gldJfxkBDNLAaxRJchj1K/ciNydUH3Z36Mp+I=; b=uSZ04o+Hy/y6WwNpCxU2mdiD5O2nIxeOZUt6agHC1x9/QhOqk6Rde6+ZtOGoksWtO3 Yshv0w2ztrltHvMcxrLl1HwxwSyt6QR6PDhYu+ZIvBx98LvoQCq1z3fHOMXTi50E0oLq qQVNtjZ+IFiJqk6UlvAg+FGzEDKZLmAtBT2QZWdOhYiZuhjIuQlOpSv/muX3eRBufWlM znxnYIZJpMGA+q3kJvmkL2UGgYpwjZKjZmfSp0g4zjf/38hJsGmosAqrVpa+bql6eDRQ wRFScV0O6LexGsho9Qw+VcXsovBy+6dv/oFdOjpa5UUp6xAK/ARovrFpTj909oUwEsja WR9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=vFdHP0gldJfxkBDNLAaxRJchj1K/ciNydUH3Z36Mp+I=; b=GfYAN7J0Nc7WUl65r+6fsxNNB5z/iWuva4BjiWUtzK2g8ZgeHYPv2QEuazC/yz633d fzSkl2AK64+OgWfL+HaFn9ivsKnyhDx1F+eYzmaFT5IHd0a7PpLHb1qxOtOIkvJ4IIVS AmY4/MbC5PnqqDrXcNfnircN1f5TG3ZNg/W5Tnz4oNdMLcSEL30anwsCBQOGeaC3e/c8 Pj6ohDmX0o5M59QZIhq+mvPlEvfDYa6axpAc07G6QZFdlqh7lpmJB4qwkOtb9XJNPLJb cl4CoVQDuqw43U/4lcGpk6dFX2b3BPc8IJ7NQAVyaqtTbx143kheJxc7zh5qnZHTnxDb Oghw== X-Gm-Message-State: APjAAAVHjBjIkUjkHqVWYQ2LkCOzM2XZE7XEJEua7XsLCK/StcrZHkLo Gu4yy1pJnqlE4IA//jJC/ycvOGMA X-Google-Smtp-Source: APXvYqzuUKKqeEU4FHDW1SkcrQxEDaZnWYVLpWIA4fyJF8Ni8nIhUhnWy6m8XlH8NbNZA5HMUzxPsw== X-Received: by 2002:a65:6102:: with SMTP id z2mr31478141pgu.391.1563262236292; Tue, 16 Jul 2019 00:30:36 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id b16sm31324175pfo.54.2019.07.16.00.30.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 00:30:35 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Tue, 16 Jul 2019 16:30:28 +0900 Message-Id: <20190716073028.18709-1-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [spp] [PATCH] spp_nfv: fix deleting vhost X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa This update is to add dev_detach_by_port_id() for deleting vhost PMD. Signed-off-by: Yasufumi Ogawa --- src/nfv/commands.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/nfv/commands.h b/src/nfv/commands.h index 11e434a..8f19f4e 100644 --- a/src/nfv/commands.h +++ b/src/nfv/commands.h @@ -31,13 +31,12 @@ do_del(char *res_uid) port_id = find_port_id(p_id, VHOST); if (port_id == PORT_RESET) return -1; + dev_detach_by_port_id(port_id); } else if (!strcmp(p_type, "ring")) { - RTE_LOG(DEBUG, SPP_NFV, "Del ring id %d\n", p_id); port_id = find_port_id(p_id, RING); if (port_id == PORT_RESET) return -1; - rte_eth_dev_stop(port_id); rte_eth_dev_close(port_id); @@ -45,14 +44,12 @@ do_del(char *res_uid) port_id = find_port_id(p_id, PCAP); if (port_id == PORT_RESET) return -1; - dev_detach_by_port_id(port_id); } else if (!strcmp(p_type, "nullpmd")) { port_id = find_port_id(p_id, NULLPMD); if (port_id == PORT_RESET) return -1; - dev_detach_by_port_id(port_id); } @@ -153,6 +150,9 @@ do_connection(int *connected, int *sock) static int parse_command(char *str) { + uint16_t dev_id; + char dev_name[RTE_DEV_NAME_MAX_LEN]; + char *token_list[MAX_PARAMETER] = {NULL}; int cli_id; int max_token = 0; @@ -185,6 +185,13 @@ parse_command(char *str) lcore_id_used, ports_fwd_array, port_map); + RTE_ETH_FOREACH_DEV(dev_id) { + rte_eth_dev_get_name_by_port(dev_id, dev_name); + if (strlen(dev_name) > 0) + RTE_LOG(DEBUG, SPP_NFV, "Eth devs: %d\t%s\n", + dev_id, dev_name); + } + } else if (!strcmp(token_list[0], "_get_client_id")) { memset(str, '\0', MSG_SIZE); sprintf(str, "{%s:%s,%s:%d,%s:%s}", -- 2.17.1