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 A22D7A0532 for ; Tue, 21 Jan 2020 05:53:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A1C11BFC0; Tue, 21 Jan 2020 05:53:06 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 879E91BFE3 for ; Tue, 21 Jan 2020 05:53:04 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id 4so789432pgd.6 for ; Mon, 20 Jan 2020 20:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=N8JzFadF1SXOFeu2bz2bycO4qd5/FRFYAYYKBh9FS70=; b=JqA6q6ylY7LRif6gsAnftOc2+zBRia9Bm0dce59RSDZECLCicAJ69Q6+XERNQCT20Y 5YsVQKQ6G/evexmPn7Qz0gMMf28AtG3txrhvVSkXURhGzVcD0E0w6+f76mbjd6JX0gk/ zuOABD3u0BlZrhkt4Itzp1NKIanYcOYHXPJ/RGZtU79TQYb3/lWrbBa7Z02UjYuHFVcv Zf+/6ZW5lTumModlRTsP3suBJ3JkMd+7GfENu4N8oE1FpgAbexTq/IN/j0ZQzd9LmZLS uARjpc/taBqlU5zNOUlJ4gTsnCvhfqzZQOTyM7GwaUUmvhW6hLwB2sh3WVs3Z3H95Hb4 ryQQ== 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:in-reply-to :references; bh=N8JzFadF1SXOFeu2bz2bycO4qd5/FRFYAYYKBh9FS70=; b=i6VmeeEk9pvk1TVc5148M7v23bSgVRRFTRSnoc++gkFf6YM1farfPmw/UazDKQ2Uvy LTXVSi3IKi40pQ7LEusDqXbTVfzuf9NM58ym0OoG/Q6+O/z5EDVOlDb8DwcIZEzpOOcS 0CbCi7UCeV6V3qo5Z2bFvmbu0iHB6EOatR+qMjAx7KUKtWqvqnQ7jm/2+wG0hLgKLPvN lK6Mx/3nVnGY1g70CmNXDvacjS5cohjpa3SopOH0W3JapI8rIeLTYivhEji/TrEHYe3P VX973TthoLYmn7l6Sbse2Y6v/Jb1NFEy7M5AWVPvatsuVqbE4W3ZW1OoTkWo/h3mbhtG kcgQ== X-Gm-Message-State: APjAAAUBGlpv24KZmF6ApCizdu9nKuyHKg458HG3F8ijpo3XVn67hfPN uMKM2DyVVEf8NpAgOIC3VE0b7Kis X-Google-Smtp-Source: APXvYqzp92S+ZI+L/yu6W4NCbqiuV3VuvhYYdJdUXDowgHYdH2wKZjJ+FDMz+xhhWZml3upxdfk8AQ== X-Received: by 2002:a63:597:: with SMTP id 145mr3314160pgf.384.1579582383600; Mon, 20 Jan 2020 20:53:03 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c8c2:de00:394a:f092:61ac:c869]) by smtp.gmail.com with ESMTPSA id y5sm31331060pfn.185.2020.01.20.20.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 20:53:03 -0800 (PST) From: Yasufumi Ogawa To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Tue, 21 Jan 2020 13:52:52 +0900 Message-Id: <20200121045253.1071-4-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200121045253.1071-1-yasufum.o@gmail.com> References: <20200121045253.1071-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 3/4] shared: add memif in status message 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" Add memif PMD in the result of status command and its log message. Signed-off-by: Yasufumi Ogawa --- src/shared/common.c | 9 +++++++++ src/shared/common.h | 2 ++ src/shared/port_manager.c | 1 + 3 files changed, 12 insertions(+) diff --git a/src/shared/common.c b/src/shared/common.c index 85e2f06..5fdb29f 100644 --- a/src/shared/common.c +++ b/src/shared/common.c @@ -119,6 +119,15 @@ int parse_dev_name(char *dev_name, int *port_type, int *port_id) *port_id = (int)strtol(pid_str, NULL, 10); *port_type = TAP; + } else if (strncmp(dev_name, VDEV_NET_MEMIF, + strlen(VDEV_NET_MEMIF)) == 0) { + dev_str_len = strlen(VDEV_NET_MEMIF); + pid_len = dev_name_len - dev_str_len; + strncpy(pid_str, dev_name + strlen(VDEV_NET_MEMIF), + pid_len); + *port_id = (int)strtol(pid_str, NULL, 10); + *port_type = MEMIF; + } else if (strncmp(dev_name, VDEV_ETH_NULL, strlen(VDEV_ETH_NULL)) == 0) { dev_str_len = strlen(VDEV_ETH_NULL); diff --git a/src/shared/common.h b/src/shared/common.h index ef8372a..adabb79 100644 --- a/src/shared/common.h +++ b/src/shared/common.h @@ -39,6 +39,7 @@ #define VDEV_NET_PCAP "net_pcap" #define VDEV_ETH_TAP "eth_tap" #define VDEV_NET_TAP "net_tap" +#define VDEV_NET_MEMIF "net_memif" #define VDEV_ETH_NULL "eth_null" @@ -82,6 +83,7 @@ enum port_type { PCAP, NULLPMD, TAP, + MEMIF, UNDEF, }; diff --git a/src/shared/port_manager.c b/src/shared/port_manager.c index 98d89c2..534af99 100644 --- a/src/shared/port_manager.c +++ b/src/shared/port_manager.c @@ -11,6 +11,7 @@ struct porttype_map portmap[] = { { .port_name = "pcap", .port_type = PCAP, }, { .port_name = "nullpmd", .port_type = NULLPMD, }, { .port_name = "tap", .port_type = TAP, }, + { .port_name = "memif", .port_type = MEMIF, }, { .port_name = NULL, .port_type = UNDEF, }, }; -- 2.17.1