Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
From: Zhouhua Liu <liuzhouhua@huawei.com>
To: "kbusch@kernel.org" <kbusch@kernel.org>,
	<Chaitanya.Kulkarni@wdc.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: wangzan <wangzan@huawei.com>,
	Kangwenhong <kangwenhong@huawei.com>,
	"Wangchong \(Michael\)" <Michael.wangchong@huawei.com>
Subject: [PATCH V2] nvme-cli: Add huawei vendor id as filter in command "nvme huawei list"
Date: Fri, 22 May 2020 11:40:40 +0800
Message-ID: <3a4b9e11-c653-2d81-98e4-09be9b0ab584@huawei.com> (raw)


This patch V2 is to add huawei vendor id as filter in command "nvme huawei list".
And comparing with the last patch, I have remove the symbol \ to comply with coding style.


Signed-off-by: Zhouhua Liu <liuzhouhua@huawei.com>
---
 plugins/huawei/huawei-nvme.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/huawei/huawei-nvme.c b/plugins/huawei/huawei-nvme.c index c935f47..b4aef1e 100644
--- a/plugins/huawei/huawei-nvme.c
+++ b/plugins/huawei/huawei-nvme.c
@@ -41,6 +41,7 @@
 #define CREATE_CMD
 #include "huawei-nvme.h"

+#define HW_SSD_PCI_VENDOR_ID 0x19E5
 #define ARRAY_NAME_LEN 80
 #define NS_NAME_LEN    40

@@ -80,16 +81,15 @@ static int huawei_get_nvme_info(int fd, struct huawei_list_item *item, const cha
                return err;

        /*identify huawei device*/
-       if (strstr(item->ctrl.mn, "Huawei") == NULL) {
+       if ((strstr(item->ctrl.mn, "Huawei") == NULL) &&
+               (le16_to_cpu(item->ctrl.vid) != HW_SSD_PCI_VENDOR_ID)) {
                item->huawei_device = false;
                return 0;
        }
-       else
-               item->huawei_device = true;

+       item->huawei_device = true;
        item->nsid = nvme_get_nsid(fd);
-       err = nvme_identify_ns(fd, item->nsid,
-                                                       0, &item->ns);
+       err = nvme_identify_ns(fd, item->nsid, 0, &item->ns);
        if (err)
                return err;

--
2.22.0



_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  3:40 Zhouhua Liu [this message]
2020-05-26 19:44 ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a4b9e11-c653-2d81-98e4-09be9b0ab584@huawei.com \
    --to=liuzhouhua@huawei.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=Michael.wangchong@huawei.com \
    --cc=kangwenhong@huawei.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=wangzan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git