From patchwork Wed Dec 1 19:10:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 372291 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB1JATcx024381 for ; Wed, 1 Dec 2010 19:10:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755908Ab0LATK2 (ORCPT ); Wed, 1 Dec 2010 14:10:28 -0500 Received: from sj-iport-5.cisco.com ([171.68.10.87]:60979 "EHLO sj-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755559Ab0LATK2 (ORCPT ); Wed, 1 Dec 2010 14:10:28 -0500 Authentication-Results: sj-iport-5.cisco.com; dkim=neutral (message not signed) header.i=none X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAJcs9kyrR7Hu/2dsb2JhbACjHnGpApsahUcEhF6GCA X-IronPort-AV: E=Sophos;i="4.59,284,1288569600"; d="scan'208";a="295832326" Received: from sj-core-5.cisco.com ([171.71.177.238]) by sj-iport-5.cisco.com with ESMTP; 01 Dec 2010 19:10:26 +0000 Received: from roland-alpha.cisco.com (roland-alpha.cisco.com [10.33.42.9]) by sj-core-5.cisco.com (8.13.8/8.14.3) with ESMTP id oB1JAQeL026446; Wed, 1 Dec 2010 19:10:26 GMT Received: by roland-alpha.cisco.com (Postfix, from userid 33217) id EC0E0E0946; Wed, 1 Dec 2010 11:10:22 -0800 (PST) From: Roland Dreier To: Eli Cohen Cc: RDMA list Subject: Re: [PATCH] mlx4: Fix vlan insertion order References: <20101117133943.GA10589@mtldesk30> X-Message-Flag: Warning: May contain useful information Date: Wed, 01 Dec 2010 11:10:22 -0800 In-Reply-To: <20101117133943.GA10589@mtldesk30> (Eli Cohen's message of "Wed, 17 Nov 2010 15:39:43 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Dec 2010 19:10:30 +0000 (UTC) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 9a7794a..2001f20 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1816,6 +1816,11 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? MLX4_WQE_CTRL_FENCE : 0) | size; + if (be16_to_cpu(vlan) < 0x1000) { + ctrl->ins_vlan = 1 << 6; + ctrl->vlan_tag = vlan; + } + /* * Make sure descriptor is fully written before * setting ownership bit (because HW can start @@ -1831,11 +1836,6 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ctrl->owner_opcode = mlx4_ib_opcode[wr->opcode] | (ind & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0) | blh; - if (be16_to_cpu(vlan) < 0x1000) { - ctrl->ins_vlan = 1 << 6; - ctrl->vlan_tag = vlan; - } - stamp = ind + qp->sq_spare_wqes; ind += DIV_ROUND_UP(size * 16, 1U << qp->sq.wqe_shift);