From patchwork Fri May 30 22:43:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 4274451 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 49C719F336 for ; Fri, 30 May 2014 22:44:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D0AC203A1 for ; Fri, 30 May 2014 22:44:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4416F20395 for ; Fri, 30 May 2014 22:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718AbaE3WoB (ORCPT ); Fri, 30 May 2014 18:44:01 -0400 Received: from na3sys010aog104.obsmtp.com ([74.125.245.76]:48591 "HELO na3sys010aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932289AbaE3WoA (ORCPT ); Fri, 30 May 2014 18:44:00 -0400 Received: from mail-qg0-f44.google.com ([209.85.192.44]) (using TLSv1) by na3sys010aob104.postini.com ([74.125.244.12]) with SMTP ID DSNKU4kJr8uXr7bXisyHZtYimnXpi9Qg7e6Z@postini.com; Fri, 30 May 2014 15:44:00 PDT Received: by mail-qg0-f44.google.com with SMTP id i50so7314656qgf.31 for ; Fri, 30 May 2014 15:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VeJNqTifTRSmmvpJ7Rapi3/gz6tmkCH2qseElUmSeJw=; b=P+dlcSpYUjf9s5n98nwFCz6+VCb+JJt7sNSQd8KsLdz7TVEcQb0wb40CAivFt5ve8P G/9/fVUZxXsQJCb9I8jZ/eUp4WDq499j5Lhq9c//QoAjTfmI+70gHtXaWEo3wRIN46Dl 0le71vQPENNGPFEdo0b/zYysb5utZGpGth5F8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=VeJNqTifTRSmmvpJ7Rapi3/gz6tmkCH2qseElUmSeJw=; b=QjGDeWD9lPYSW36UJgdS5bDXMnZuRpIcxEzlg972GWSUl5s0yX6RfXbmgSR6tWd5FO j4V/7ubd3GoNrNFyan9AxeapFqmLedAsS4bAviWKTdbPpb2r7z8SECb7fUMQcxsl/4rY zX3eoqyswGD1s2o9b3YN0JbszZQPchkHdIRsTadJxqAqq+ZgipxDD/GvFBOul/0oO0p0 qE6ieQw1Rrq20tfRUS7tZ3i9SL12w2ldDsSFAHqURuMVGWLvS+8s4KiiFiNyKZ1YEXsb x3KJY+D5ib8lBPLsMT78DF2hShSHUzfqC/gVk3/brxzuYnTg62rS7YEigocDEAeTVPDC 2LwA== X-Gm-Message-State: ALoCoQmHy010aEvzQB+3+vRoI2PWnf4QgW2LP5dYZYz0dTRvWAAU0N4ZebhrKcjOmENImk3GvFD1gvUT/dOBGB66xPtp+xEpCv2pFfNt62fueOYKvvU4eVH1u37NiWhvpAvtlIeKeX5vjPw0uE+Djq0pcSCGDTjBDg== X-Received: by 10.224.112.74 with SMTP id v10mr25719050qap.28.1401489839375; Fri, 30 May 2014 15:43:59 -0700 (PDT) X-Received: by 10.224.112.74 with SMTP id v10mr25719041qap.28.1401489839297; Fri, 30 May 2014 15:43:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.87.73 with HTTP; Fri, 30 May 2014 15:43:39 -0700 (PDT) In-Reply-To: <53882b5a.UAE9BgmHCPuDMdrw%fengguang.wu@intel.com> References: <53882b5a.UAE9BgmHCPuDMdrw%fengguang.wu@intel.com> From: Roland Dreier Date: Fri, 30 May 2014 15:43:39 -0700 Message-ID: Subject: Re: [infiniband:for-next 41/47] drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2875:3: warning: case value '7' not in enumerated type 'enum qp_transition' To: kbuild test robot Cc: Jack Morgenstein , Or Gerlitz , kbuild-all@01.org, "linux-rdma@vger.kernel.org" Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, May 29, 2014 at 11:55 PM, kbuild test robot wrote: > tree: git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-next > head: 73b878af35148015273fb09b4a4af80c770ff763 > commit: 99ec41d0a48cb6d14af25765f9449762f9d101f6 [41/47] mlx4: Add infrastructure for selecting VFs to enable QP0 via MLX proxy QPs > config: x86_64-rhel (attached as .config) > > All warnings: > > drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters': >>> drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2875:3: warning: case value '7' not in enumerated type 'enum qp_transition' [-Wswitch] > case MLX4_QP_ST_MLX: > ^ > > vim +2875 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c > > 2859 num_gids = mlx4_get_slave_num_gids(dev, slave, port); > 2860 else > 2861 num_gids = 1; > 2862 if (qp_ctx->pri_path.mgid_index >= num_gids) > 2863 return -EINVAL; > 2864 } > 2865 if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { > 2866 port = (qp_ctx->alt_path.sched_queue >> 6 & 1) + 1; > 2867 if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) > 2868 num_gids = mlx4_get_slave_num_gids(dev, slave, port); > 2869 else > 2870 num_gids = 1; > 2871 if (qp_ctx->alt_path.mgid_index >= num_gids) > 2872 return -EINVAL; > 2873 } > 2874 break; >> 2875 case MLX4_QP_ST_MLX: > 2876 qpn = vhcr->in_modifier & 0x7fffff; > 2877 port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; > 2878 if (transition == QP_TRANS_INIT2RTR && > 2879 slave != mlx4_master_func_num(dev) && > 2880 mlx4_is_qp_reserved(dev, qpn) && > 2881 !mlx4_vf_smi_enabled(dev, slave, port)) { > 2882 /* only enabled VFs may create MLX proxy QPs */ > 2883 mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", Looks like this is actually a bug... assuming you guys agree the patch is correct, I'll add the following: commit 165cb465f73c (HEAD, mlx4) Author: Roland Dreier Date: Fri May 30 15:38:58 2014 mlx4_core: Move handling of MLX4_QP_ST_MLX to proper switch statement The handling of MLX4_QP_ST_MLX in verify_qp_parameters() was accidentally put inside the inner switch statement (that handles which transition of RC/UC/XRC QPs is happening). Fix this by moving the case to the outer switch statement. The compiler pointed this out with: drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters': >> drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2875:3: warning: case value '7' not in enumerated type 'enum qp_transition' [-Wswitch] case MLX4_QP_ST_MLX: Reported-by: kbuild test robot Fixes: 99ec41d0a48c ("mlx4: Add infrastructure for selecting VFs to enable QP0 via MLX proxy QPs") Signed-off-by: Roland Dreier break; } Acked-by: Jack Morgenstein --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index ad98162a8d79..10db83ee0e58 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -2872,25 +2872,25 @@ static int verify_qp_parameters(struct mlx4_dev *dev, return -EINVAL; } break; - case MLX4_QP_ST_MLX: - qpn = vhcr->in_modifier & 0x7fffff; - port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; - if (transition == QP_TRANS_INIT2RTR && - slave != mlx4_master_func_num(dev) && - mlx4_is_qp_reserved(dev, qpn) && - !mlx4_vf_smi_enabled(dev, slave, port)) { - /* only enabled VFs may create MLX proxy QPs */ - mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", - __func__, slave, port); - return -EPERM; - } - break; - default: break; } + break; + case MLX4_QP_ST_MLX: + qpn = vhcr->in_modifier & 0x7fffff; + port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; + if (transition == QP_TRANS_INIT2RTR && + slave != mlx4_master_func_num(dev) && + mlx4_is_qp_reserved(dev, qpn) && + !mlx4_vf_smi_enabled(dev, slave, port)) { + /* only enabled VFs may create MLX proxy QPs */ + mlx4_err(dev, "%s: unprivileged slave %d attempting to create an MLX proxy special QP on port %d\n", + __func__, slave, port); + return -EPERM; + } break; + default: