Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1936612ima; Thu, 25 Oct 2018 07:16:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5et1ghyJKLHwCKOeXasV7j80R+RoFpNMO3KfdlT7eTmSd7tdblgG2iByv0aU8GCi0N8q1MT X-Received: by 2002:a63:1c1b:: with SMTP id c27-v6mr1651979pgc.351.1540476985491; Thu, 25 Oct 2018 07:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540476985; cv=none; d=google.com; s=arc-20160816; b=cN2T4ZxO6FKrMWJ+929ylk+FSh33ihjKblRm/clWCIHcFTANnVY7EzuyV9tWnZKCiH YXDOgdDIFJiaFAZPUJClfQRvGNWuFTIjuxYIL059fCrHzvv+VS7hC1pY4eOAzs1HqIFk 9b3XyfEZpvkFbnZzo8A53c5pCk+ueGWMPZLktVpuQ2Z5JhKTj5jgU6jR4jXPj4LAwcuq xmhHTBqRDTqbXfvn7tnzVjmY/shXEkBLqhpgDNdL8DRTyM693n6/FSUIqvgaMn8GUyf+ kThKmaZVmJ0RyrfLh8g2G0TN+Hzm8Xls4VAKrfFlQmnKb4RKehLRl9SH4godMg39/b90 hPWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=UnvSL9CTxlwbNbtTInsQOMpVn3IH5rzGgXoyme86EGY=; b=z1ojjPU/TkrDm2XASOR+dZXrRkKcTTM+NJTIPPRw3YcPL9m653HEMSR9Ui36ndYxnM T7n80RQqUdqB/hFicOfO6/eIT+ryxRXvMtm/zCJ3CTECYVfgDYNqj5KIhFCiQ80Nu5Cs dtRLJ4m2QWMCuk+Q6Zzpg1I80JW3IYyJSZdVAwHj6aIM66vJIayFIbritDIGHrckM5nb +Rm0+jasgLJmttdBSAM/T+zRK3h0G79E9Fa1sIrmSwFiXFk7JOzl/0U8oep8G8G1/j/A +JW60nzp+S/gy3/ulnZDBeDq1988tV1xaGtwbr0YjBiJHQNUNRyz/c8QbLi5DVc2o01Y 3AqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pRXij10U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si8401843pfb.258.2018.10.25.07.15.21; Thu, 25 Oct 2018 07:16:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pRXij10U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728515AbeJYWpf (ORCPT + 99 others); Thu, 25 Oct 2018 18:45:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:53738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728367AbeJYWon (ORCPT ); Thu, 25 Oct 2018 18:44:43 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 586EF2083E; Thu, 25 Oct 2018 14:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476708; bh=3eeziPS8YGoEMsVZtZ4UZIFWtx4imf9YIg+S2rOY9OA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pRXij10UHxM63g4ckRP/bTKnUOSNVskIaIRr9q+jgLzEJHx27j8IMFKpcfySknJLJ xVnX+SFfSdvdlM4pey5Hv6hqhCaGoaVA3nhaJTuDQWNoLsF8UnHesjOfhzMT+PIwlH ix1bGqlI+Oik++1L0Ku+/WfivhWPMKpYvXZYGogM= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Brian King , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 38/46] scsi: ibmvfc: Avoid unnecessary port relogin Date: Thu, 25 Oct 2018 10:10:45 -0400 Message-Id: <20181025141053.213330-38-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian King [ Upstream commit 09dd15e0d9547ca424de4043bcd429bab6f285c8 ] Following an RSCN, ibmvfc will issue an ADISC to determine if the underlying target has changed, comparing the SCSI ID, WWPN, and WWNN to determine how to handle the rport in discovery. However, the comparison of the WWPN and WWNN was performing a memcmp between a big endian field against a CPU endian field, which resulted in the wrong answer on LE systems. This was observed as unexpected errors getting logged at boot time as targets were getting relogins when not needed. Signed-off-by: Brian King Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ibmvscsi/ibmvfc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index b491af31a5f8..a06b24a61622 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -3580,11 +3580,9 @@ static void ibmvfc_tgt_implicit_logout(struct ibmvfc_target *tgt) static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad, struct ibmvfc_target *tgt) { - if (memcmp(&mad->fc_iu.response[2], &tgt->ids.port_name, - sizeof(tgt->ids.port_name))) + if (wwn_to_u64((u8 *)&mad->fc_iu.response[2]) != tgt->ids.port_name) return 1; - if (memcmp(&mad->fc_iu.response[4], &tgt->ids.node_name, - sizeof(tgt->ids.node_name))) + if (wwn_to_u64((u8 *)&mad->fc_iu.response[4]) != tgt->ids.node_name) return 1; if (be32_to_cpu(mad->fc_iu.response[6]) != tgt->scsi_id) return 1; -- 2.17.1