[SCSI] be2iscsi: Fix repeated issue of MAC ADDR get IOCTL
authorJayamohan Kallickal <jayamohank@gmail.com>
Sat, 28 Sep 2013 22:35:40 +0000 (15:35 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 25 Oct 2013 08:58:04 +0000 (09:58 +0100)
Storing MAC ADDR of each function in it's priv structure to
avoid issuing MAC_ADDR get IOCTL. Based on a flag set/unset
it's decided if MAC_ADDR is stored in priv structure or IOCTL
needs to be issued.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/be2iscsi/be_iscsi.c
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/be2iscsi/be_main.h

index ef36be003f67a49f0d37cf1ed1136c87894bd942..2496ea7dab780a2c74b091280a3b2e1d7abe5f41 100644 (file)
@@ -840,7 +840,7 @@ int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
        struct be_cmd_get_nic_conf_resp resp;
        int rc;
 
-       if (strlen(phba->mac_address))
+       if (phba->mac_addr_set)
                return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
 
        memset(&resp, 0, sizeof(resp));
@@ -848,6 +848,7 @@ int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
        if (rc)
                return rc;
 
+       phba->mac_addr_set = true;
        memcpy(phba->mac_address, resp.mac_address, ETH_ALEN);
        return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
 }
index 0abed0a954eb7afcb5debee1117355b502c3fc4c..5ba575f0051b9a98a6da47d51d202a110d7dea7a 100644 (file)
@@ -4948,6 +4948,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
        beiscsi_hba_attrs_init(phba);
 
        phba->fw_timeout = false;
+       phba->mac_addr_set = false;
 
 
        switch (pcidev->device) {
index 3e452578a8a973ef2d2b340f877f6807f3f5f319..5165515652bfb2014c9bebb19be28c6f079a912d 100644 (file)
@@ -348,6 +348,7 @@ struct beiscsi_hba {
        bool ue_detected;
        struct delayed_work beiscsi_hw_check_task;
 
+       bool mac_addr_set;
        u8 mac_address[ETH_ALEN];
        char fw_ver_str[BEISCSI_VER_STRLEN];
        char wq_name[20];