From patchwork Sun Mar 23 20:18:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hefty, Sean" X-Patchwork-Id: 3880641 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 156AA9F334 for ; Sun, 23 Mar 2014 20:18:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57E8820265 for ; Sun, 23 Mar 2014 20:18:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A66020220 for ; Sun, 23 Mar 2014 20:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751176AbaCWUSp (ORCPT ); Sun, 23 Mar 2014 16:18:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:30878 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbaCWUSd (ORCPT ); Sun, 23 Mar 2014 16:18:33 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 23 Mar 2014 13:18:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,715,1389772800"; d="scan'208";a="505038293" Received: from cst-linux.jf.intel.com ([10.23.221.72]) by fmsmga002.fm.intel.com with ESMTP; 23 Mar 2014 13:18:32 -0700 From: sean.hefty@intel.com To: sean.hefty@intel.com, ira.weiny@intel.com, kaike.wan@intel.com, john.fleck@intel.com, linux-rdma@vger.kernel.org Subject: [PATCH 6/9] ibacm: Change base endpoint name Date: Sun, 23 Mar 2014 13:18:18 -0700 Message-Id: <1395605901-9080-7-git-send-email-sean.hefty@intel.com> X-Mailer: git-send-email 1.7.3 In-Reply-To: <1395605901-9080-1-git-send-email-sean.hefty@intel.com> References: <1395605901-9080-1-git-send-email-sean.hefty@intel.com> 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, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Sean Hefty Endpoints are given a string identifer (base name) that matches the first address assigned to the endpoint. Store the endpoint string identifier separately from the address name, and identify the endpoint using the device name, port, and pkey. The endpoint identifier is only used for logging purposes. Signed-off-by: Sean Hefty --- src/acm.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/acm.c b/src/acm.c index 16e929b..a8a1fb9 100644 --- a/src/acm.c +++ b/src/acm.c @@ -153,6 +153,7 @@ struct acm_ep { DLIST_ENTRY entry; union acm_ep_info addr[MAX_EP_ADDR]; char name[MAX_EP_ADDR][ACM_MAX_ADDRESS]; + char id_string[ACM_MAX_ADDRESS]; uint8_t addr_type[MAX_EP_ADDR]; void *dest_map[ACM_ADDRESS_RESERVED - 1]; struct acm_dest mc_dest[MAX_EP_MC]; @@ -1394,7 +1395,7 @@ static void acm_process_recv(struct acm_ep *ep, struct ibv_wc *wc) { struct acm_mad *mad; - acm_log(2, "base endpoint name %s\n", ep->name[0]); + acm_log(2, "base endpoint name %s\n", ep->id_string); mad = (struct acm_mad *) (uintptr_t) (wc->wr_id + sizeof(struct ibv_grh)); switch (mad->mgmt_class) { case IB_MGMT_CLASS_SA: @@ -3057,6 +3058,8 @@ acm_alloc_ep(struct acm_port *port, uint16_t pkey, uint16_t pkey_index) DListInit(&ep->active_queue); DListInit(&ep->wait_queue); lock_init(&ep->lock); + sprintf(ep->id_string, "%s-%d-0x%x", port->dev->verbs->device->name, + port->port_num, pkey); return ep; }