From patchwork Mon Aug 23 14:32:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chien Tung X-Patchwork-Id: 124181 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7NEUbk8031067 for ; Mon, 23 Aug 2010 14:32:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752818Ab0HWOcl (ORCPT ); Mon, 23 Aug 2010 10:32:41 -0400 Received: from mga02.intel.com ([134.134.136.20]:26919 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720Ab0HWOck (ORCPT ); Mon, 23 Aug 2010 10:32:40 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Aug 2010 07:32:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,257,1280732400"; d="scan'208";a="650349844" Received: from sbthomas-mobl1.amr.corp.intel.com (HELO ctung-MOBL.intel.com) ([10.254.57.64]) by orsmga001.jf.intel.com with SMTP; 23 Aug 2010 07:32:37 -0700 Received: by ctung-MOBL.intel.com (sSMTP sendmail emulation); Mon, 23 Aug 2010 09:32:36 -0500 Date: Mon, 23 Aug 2010 09:32:36 -0500 From: Chien Tung To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/nes: report correct port state if interface is down Message-ID: <20100823143236.GA6592@CTUNG-MOBL1> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 23 Aug 2010 14:32:42 +0000 (UTC) diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index b89972c..2374efb 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -584,7 +584,9 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr props->lmc = 0; props->sm_lid = 0; props->sm_sl = 0; - if (nesvnic->linkup) + if (netif_queue_stopped(netdev)) + props->state = IB_PORT_DOWN; + else if (nesvnic->linkup) props->state = IB_PORT_ACTIVE; else props->state = IB_PORT_DOWN;