From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] opensm/osm_sa_path_record.c: MGID must be specified explicitly
Date: Tue, 22 Dec 2009 13:37:01 +0200 [thread overview]
Message-ID: <20091222113701.GC26940@me> (raw)
In-Reply-To: <20091220195710.GA18524@me>
IBA 1.2.1 states (Vol.1, 15.2.5.16, p.918) that DGID shell be explicitly
specified when path destination of SA PathRecord query is multicast
group. So ignore all other cases when choosing multicast PR destination.
Other related parameters (mlid) is checked in pr_match_mgrp_attributes()
anyway. As result consolidate many of effectively duplicate code.
Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
opensm/opensm/osm_sa_path_record.c | 88 +++++-------------------------------
1 files changed, 11 insertions(+), 77 deletions(-)
diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c
index fbeef03..082a41d 100644
--- a/opensm/opensm/osm_sa_path_record.c
+++ b/opensm/opensm/osm_sa_path_record.c
@@ -1401,34 +1401,6 @@ static void pr_rcv_process_pair(IN osm_sa_t * sa, IN const osm_madw_t * p_madw,
OSM_LOG_EXIT(sa->p_log);
}
-static osm_mgrp_t *pr_get_mgrp(IN osm_sa_t * sa, IN const osm_madw_t * p_madw)
-{
- ib_path_rec_t *p_pr;
- const ib_sa_mad_t *p_sa_mad;
- osm_mgrp_t *mgrp;
-
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);
- p_pr = ib_sa_mad_get_payload_ptr(p_sa_mad);
-
- if (!(p_sa_mad->comp_mask & IB_PR_COMPMASK_DGID)) {
- OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,
- "discard multicast target SA PR with wildcarded MGID");
- return NULL;
- }
-
- mgrp = osm_get_mgrp_by_mgid(sa->p_subn, &p_pr->dgid);
- if (!mgrp) {
- char gid_str[INET6_ADDRSTRLEN];
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F09: "
- "No MC group found for PathRecord destination GID %s\n",
- inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
- sizeof gid_str));
- return NULL;
- }
-
- return mgrp;
-}
-
static ib_api_status_t pr_match_mgrp_attributes(IN osm_sa_t * sa,
IN const osm_madw_t * p_madw,
IN const osm_mgrp_t * p_mgrp)
@@ -1510,47 +1482,11 @@ Exit:
return status;
}
-static int pr_rcv_check_mcast_dest(osm_sa_t * sa, IN const osm_madw_t * p_madw)
-{
- const ib_path_rec_t *p_pr;
- const ib_sa_mad_t *p_sa_mad;
- ib_net64_t comp_mask;
- int is_multicast = 0;
-
- OSM_LOG_ENTER(sa->p_log);
-
- p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);
- p_pr = (ib_path_rec_t *) ib_sa_mad_get_payload_ptr(p_sa_mad);
-
- comp_mask = p_sa_mad->comp_mask;
-
- if (comp_mask & IB_PR_COMPMASK_DGID) {
- is_multicast = ib_gid_is_multicast(&p_pr->dgid);
- if (!is_multicast)
- goto Exit;
- }
-
- if (comp_mask & IB_PR_COMPMASK_DLID) {
- if (cl_ntoh16(p_pr->dlid) >= IB_LID_MCAST_START_HO &&
- cl_ntoh16(p_pr->dlid) <= IB_LID_MCAST_END_HO)
- is_multicast = 1;
- else if (is_multicast) {
- OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F12: "
- "PathRecord request indicates MGID but not MLID\n");
- is_multicast = -1;
- }
- }
-
-Exit:
- OSM_LOG_EXIT(sa->p_log);
- return is_multicast;
-}
-
void osm_pr_rcv_process(IN void *context, IN void *data)
{
osm_sa_t *sa = context;
osm_madw_t *p_madw = data;
- const ib_path_rec_t *p_pr;
+ ib_path_rec_t *p_pr;
const ib_sa_mad_t *p_sa_mad;
const osm_port_t *p_src_port;
const osm_port_t *p_dest_port;
@@ -1558,7 +1494,6 @@ void osm_pr_rcv_process(IN void *context, IN void *data)
ib_gid_t dgid;
ib_net16_t sa_status;
osm_port_t *requester_port;
- int ret;
OSM_LOG_ENTER(sa->p_log);
@@ -1601,21 +1536,14 @@ void osm_pr_rcv_process(IN void *context, IN void *data)
cl_plock_acquire(sa->p_lock);
/* Handle multicast destinations separately */
- if ((ret = pr_rcv_check_mcast_dest(sa, p_madw)) < 0) {
- /* Multicast DGID with unicast DLID */
- cl_plock_release(sa->p_lock);
- osm_sa_send_error(sa, p_madw, IB_MAD_STATUS_INVALID_FIELD);
- goto Exit;
- }
-
- if (ret > 0)
+ if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_DGID) &&
+ ib_gid_is_multicast(&p_pr->dgid));
goto McastDest;
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Unicast destination requested\n");
sa_status = pr_rcv_get_end_points(sa, p_madw, &p_src_port, &p_dest_port,
&dgid);
-
if (sa_status == IB_SA_MAD_STATUS_SUCCESS) {
/*
What happens next depends on the type of endpoint information
@@ -1660,9 +1588,15 @@ McastDest:
uint8_t hop_limit;
/* First, get the MC info */
- p_mgrp = pr_get_mgrp(sa, p_madw);
- if (!p_mgrp)
+ p_mgrp = osm_get_mgrp_by_mgid(sa->p_subn, &p_pr->dgid);
+ if (!p_mgrp) {
+ char gid_str[INET6_ADDRSTRLEN];
+ OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F09: "
+ "No MC group found for PathRecord destination GID %s\n",
+ inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str,
+ sizeof gid_str));
goto Unlock;
+ }
/* Make sure the rest of the PathRecord matches the MC group attributes */
status = pr_match_mgrp_attributes(sa, p_madw, p_mgrp);
--
1.6.6.rc4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-22 11:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-15 0:43 SRP issues with OpenSM 3.3.3 Ira Weiny
[not found] ` <20091214164334.064102f0.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-12-15 15:16 ` Hal Rosenstock
[not found] ` <f0e08f230912150716y392cf1f1t4cd640b6663f7fea-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-15 17:09 ` Ira Weiny
[not found] ` <20091215090942.b33ddc1e.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-12-15 17:53 ` Hal Rosenstock
2009-12-15 17:12 ` Sasha Khapyorsky
2009-12-15 17:03 ` Sasha Khapyorsky
2009-12-15 17:14 ` Ira Weiny
2009-12-15 17:15 ` Jason Gunthorpe
[not found] ` <20091215171532.GA8288-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-12-15 17:18 ` Ira Weiny
[not found] ` <20091215091819.c217cf36.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-12-15 17:31 ` Jason Gunthorpe
[not found] ` <20091215173140.GB8288-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-12-15 17:48 ` Ira Weiny
2009-12-15 17:59 ` Hal Rosenstock
[not found] ` <f0e08f230912150959j536667bbg51b8381724681880-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-16 2:55 ` [RFC PATCH] Set HopLimit based on off subnet " Ira Weiny
[not found] ` <20091215185511.3ae458cc.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-12-16 13:29 ` Hal Rosenstock
[not found] ` <f0e08f230912160529h64424ba7id5c57dffb770380c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-18 2:18 ` Ira Weiny
[not found] ` <20091217181800.a1ee6b9b.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-12-18 15:20 ` Hal Rosenstock
2009-12-20 19:57 ` Sasha Khapyorsky
2009-12-22 11:37 ` Sasha Khapyorsky [this message]
2009-12-22 11:38 ` [PATCH] osm_sa_path_record.c: separate mutlicast processing code Sasha Khapyorsky
2009-12-22 11:57 ` [PATCH] osm_sa_path_record.c: use PR DGID by reference Sasha Khapyorsky
2010-01-04 19:11 ` [PATCH] opensm/osm_sa_path_record.c: MGID must be specified explicitly Hal Rosenstock
2009-12-15 17:56 ` SRP issues with OpenSM 3.3.3 Hal Rosenstock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091222113701.GC26940@me \
--to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=weiny2-i2BcT+NCU+M@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox