From patchwork Wed Apr 3 13:13:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Squyres X-Patchwork-Id: 2387331 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 67A55DFB79 for ; Wed, 3 Apr 2013 13:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759753Ab3DCNWk (ORCPT ); Wed, 3 Apr 2013 09:22:40 -0400 Received: from mtv-iport-3.cisco.com ([173.36.130.14]:21089 "EHLO mtv-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758808Ab3DCNWk (ORCPT ); Wed, 3 Apr 2013 09:22:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1737; q=dns/txt; s=iport; t=1364995360; x=1366204960; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=iM1y2kWGGeXBHDa6qOgd3v+Rbhs8rGmQI/kkqudVkp4=; b=aLSPS3obb99krGmhKSSP8GDvTmbUgqOXcDbcRGdhs86SrPmNv2+rU2sH BozT+gzaEjZI8+rqz80+QCWoUGiQu+E8ZaFbt5LBLVFcQnqg3odgxx+uZ cub/U64ts8gXC8nesqzxn9DvAiXyWz6mJJEJMQWd6byz4k8lUKBfRcpjf 8=; X-IronPort-AV: E=Sophos;i="4.87,401,1363132800"; d="scan'208";a="75156652" Received: from mtv-core-2.cisco.com ([171.68.58.7]) by mtv-iport-3.cisco.com with ESMTP; 03 Apr 2013 13:13:17 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by mtv-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id r33DDHZ8017452; Wed, 3 Apr 2013 13:13:17 GMT Received: by cisco.com (Postfix, from userid 182726) id 1AEF43FAA582; Wed, 3 Apr 2013 06:13:17 -0700 (PDT) From: Jeff Squyres To: linux-rdma@vger.kernel.org Cc: umalhi@cisco.com, Jeff Squyres Subject: [PATCH 2/2] Ad IB_MTU_1500|9000 enums. Date: Wed, 3 Apr 2013 06:13:16 -0700 Message-Id: <1364994796-10642-2-git-send-email-jsquyres@cisco.com> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1364994796-10642-1-git-send-email-jsquyres@cisco.com> References: <1364994796-10642-1-git-send-email-jsquyres@cisco.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Allow specification of common Ethernet MTUs. --- include/rdma/ib_addr.h | 6 +++++- include/rdma/ib_verbs.h | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 9996539..1f6fbbc 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h @@ -200,10 +200,14 @@ static inline enum ib_mtu iboe_get_mtu(int mtu) */ mtu = mtu - IB_GRH_BYTES - IB_BTH_BYTES - 28; - if (mtu >= ib_mtu_enum_to_int(IB_MTU_4096)) + if (mtu >= ib_mtu_enum_to_int(IB_MTU_9000)) + return IB_MTU_9000; + else if (mtu >= ib_mtu_enum_to_int(IB_MTU_4096)) return IB_MTU_4096; else if (mtu >= ib_mtu_enum_to_int(IB_MTU_2048)) return IB_MTU_2048; + else if (mtu >= ib_mtu_enum_to_int(IB_MTU_1500)) + return IB_MTU_1500; else if (mtu >= ib_mtu_enum_to_int(IB_MTU_1024)) return IB_MTU_1024; else if (mtu >= ib_mtu_enum_to_int(IB_MTU_512)) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 8a66758..4670f6f 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -174,8 +174,10 @@ enum ib_mtu { IB_MTU_256 = 1, IB_MTU_512 = 2, IB_MTU_1024 = 3, - IB_MTU_2048 = 4, - IB_MTU_4096 = 5 + IB_MTU_1500 = 4, + IB_MTU_2048 = 5, + IB_MTU_4096 = 6, + IB_MTU_9000 = 7 }; static inline int ib_mtu_enum_to_int(enum ib_mtu mtu) @@ -184,8 +186,10 @@ static inline int ib_mtu_enum_to_int(enum ib_mtu mtu) case IB_MTU_256: return 256; case IB_MTU_512: return 512; case IB_MTU_1024: return 1024; + case IB_MTU_1500: return 1500; case IB_MTU_2048: return 2048; case IB_MTU_4096: return 4096; + case IB_MTU_9000: return 9000; default: return -1; } }