From patchwork Thu Dec 29 17:42:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Petrilin X-Patchwork-Id: 133588 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8F2A6B6FA7 for ; Fri, 30 Dec 2011 04:49:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763Ab1L2RtD (ORCPT ); Thu, 29 Dec 2011 12:49:03 -0500 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]:53839 "HELO eu1sys200aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752748Ab1L2RtB (ORCPT ); Thu, 29 Dec 2011 12:49:01 -0500 Received: from MTLCAS01.mtl.com ([194.90.237.34]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTvyoCjV6waLHYSfPGV+nOihR9DimAuqS@postini.com; Thu, 29 Dec 2011 17:49:01 UTC Received: from [10.4.12.219] (10.4.12.219) by MTLCAS01.mtl.com (10.0.8.70) with Microsoft SMTP Server id 14.1.289.1; Thu, 29 Dec 2011 19:46:33 +0200 Message-ID: <4EFCA68F.9060904@mellanox.co.il> Date: Thu, 29 Dec 2011 19:42:39 +0200 From: Yevgeny Petrilin User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: CC: , Subject: [PATCH net-next 2/2] mlx4_core: limiting VF port options X-Originating-IP: [10.4.12.219] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org At the moment VFs can only operate in Eth mode. In addition we don't want the VF to attempt link sensing, so we block this option as well. Signed-off-by: Yevgeny Petrilin --- drivers/net/ethernet/mellanox/mlx4/fw.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index e0639eb..8bcc66f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -657,6 +657,8 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, u8 port_type; int err; +#define MLX4_VF_PORT_ETH_ONLY_MASK 0xE6 + err = mlx4_cmd_box(dev, 0, outbox->dma, vhcr->in_modifier, 0, MLX4_CMD_QUERY_PORT, MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE); @@ -671,8 +673,8 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, MLX4_GET(port_type, outbox->buf, QUERY_PORT_SUPPORTED_TYPE_OFFSET); - /* disable ib */ - port_type &= 0xFE; + /* Allow only Eth port, no link sensing allowed */ + port_type &= MLX4_VF_PORT_ETH_ONLY_MASK; /* check eth is enabled for this port */ if (!(port_type & 2))