[openib-general] [PATCH] opensm: osm_sa_path_record: mcast destination detection fix

2006-08-21 Thread Sasha Khapyorsky

Return error when mcast destination is not consistently indicated.

Signed-off-by: Sasha Khapyorsky [EMAIL PROTECTED]
---

 osm/opensm/osm_sa_path_record.c |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
index caa9f32..6b0fb28 100644
--- a/osm/opensm/osm_sa_path_record.c
+++ b/osm/opensm/osm_sa_path_record.c
@@ -1486,7 +1486,7 @@ __osm_pr_match_mgrp_attributes(
 
 /**
  **/
-static boolean_t
+static int
 __osm_pr_rcv_check_mcast_dest(
   IN osm_pr_rcv_t* const p_rcv,
   IN const osm_madw_t* const p_madw )
@@ -1494,7 +1494,7 @@ __osm_pr_rcv_check_mcast_dest(
   const ib_path_rec_t* p_pr;
   const ib_sa_mad_t*   p_sa_mad;
   ib_net64_t   comp_mask;
-  boolean_tis_multicast = FALSE;
+  unsigned is_multicast = 0;
 
   OSM_LOG_ENTER( p_rcv-p_log, __osm_pr_rcv_check_mcast_dest );
 
@@ -1514,11 +1514,13 @@ __osm_pr_rcv_check_mcast_dest(
   {
 if( cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_START_HO 
 cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_END_HO )
-  is_multicast = TRUE;
-else if( is_multicast )
+  is_multicast = 1;
+else if( is_multicast ) {
   osm_log( p_rcv-p_log, OSM_LOG_ERROR,
__osm_pr_rcv_check_mcast_dest: ERR 1F12: 
PathRecord request indicates MGID but not MLID\n );
+  return -1;
+}
   }
 
  Exit:
@@ -1693,6 +1695,7 @@ osm_pr_rcv_process(
   cl_qlist_t   pr_list;
   ib_net16_t   sa_status;
   osm_port_t*  requester_port;
+  int ret;
 
   OSM_LOG_ENTER( p_rcv-p_log, osm_pr_rcv_process );
 
@@ -1737,7 +1740,10 @@ osm_pr_rcv_process(
   cl_plock_acquire( p_rcv-p_lock );
 
   /* Handle multicast destinations separately */
-  if( __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ) )
+  if( (ret = __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ))  0)
+goto Exit;
+
+  if(ret  0)
 goto McastDest;
 
   osm_log( p_rcv-p_log, OSM_LOG_DEBUG,

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH] opensm: osm_sa_path_record: mcast destination detection fix

2006-08-21 Thread Hal Rosenstock
On Mon, 2006-08-21 at 13:22, Sasha Khapyorsky wrote:
 Return error when mcast destination is not consistently indicated.
 
 Signed-off-by: Sasha Khapyorsky [EMAIL PROTECTED]

Thanks. Applied (to both trunk and 1.1) with the following minor changes
below:

  osm/opensm/osm_sa_path_record.c |   16 +++-
  1 files changed, 11 insertions(+), 5 deletions(-)
 
 diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
 index caa9f32..6b0fb28 100644
 --- a/osm/opensm/osm_sa_path_record.c
 +++ b/osm/opensm/osm_sa_path_record.c
 @@ -1486,7 +1486,7 @@ __osm_pr_match_mgrp_attributes(
  
  /**
   **/
 -static boolean_t
 +static int
  __osm_pr_rcv_check_mcast_dest(
IN osm_pr_rcv_t* const p_rcv,
IN const osm_madw_t* const p_madw )
 @@ -1494,7 +1494,7 @@ __osm_pr_rcv_check_mcast_dest(
const ib_path_rec_t* p_pr;
const ib_sa_mad_t*   p_sa_mad;
ib_net64_t   comp_mask;
 -  boolean_tis_multicast = FALSE;
 +  unsigned is_multicast = 0;
  
OSM_LOG_ENTER( p_rcv-p_log, __osm_pr_rcv_check_mcast_dest );
  
 @@ -1514,11 +1514,13 @@ __osm_pr_rcv_check_mcast_dest(
{
  if( cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_START_HO 
  cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_END_HO )
 -  is_multicast = TRUE;
 -else if( is_multicast )
 +  is_multicast = 1;
 +else if( is_multicast ) {
osm_log( p_rcv-p_log, OSM_LOG_ERROR,
 __osm_pr_rcv_check_mcast_dest: ERR 1F12: 
 PathRecord request indicates MGID but not MLID\n );
 +  return -1;

I made this go through the exit so the routine end log message is put
into the log.

 +}
}
  
   Exit:
 @@ -1693,6 +1695,7 @@ osm_pr_rcv_process(
cl_qlist_t   pr_list;
ib_net16_t   sa_status;
osm_port_t*  requester_port;
 +  int ret;
  
OSM_LOG_ENTER( p_rcv-p_log, osm_pr_rcv_process );
  
 @@ -1737,7 +1740,10 @@ osm_pr_rcv_process(
cl_plock_acquire( p_rcv-p_lock );
  
/* Handle multicast destinations separately */
 -  if( __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ) )
 +  if( (ret = __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ))  0)

I added a send of SA status error for IB_MAD_STATUS_INVALID_FIELD here
as well as an unlock.

 +goto Exit;
 +
 +  if(ret  0)
  goto McastDest;
  
osm_log( p_rcv-p_log, OSM_LOG_DEBUG,

-- Hal


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH] opensm: osm_sa_path_record: mcast destination detection fix

2006-08-21 Thread Sasha Khapyorsky
On 13:45 Mon 21 Aug , Hal Rosenstock wrote:
 On Mon, 2006-08-21 at 13:22, Sasha Khapyorsky wrote:
  Return error when mcast destination is not consistently indicated.
  
  Signed-off-by: Sasha Khapyorsky [EMAIL PROTECTED]
 
 Thanks. Applied (to both trunk and 1.1) with the following minor changes
 below:
 
   osm/opensm/osm_sa_path_record.c |   16 +++-
   1 files changed, 11 insertions(+), 5 deletions(-)
  
  diff --git a/osm/opensm/osm_sa_path_record.c 
  b/osm/opensm/osm_sa_path_record.c
  index caa9f32..6b0fb28 100644
  --- a/osm/opensm/osm_sa_path_record.c
  +++ b/osm/opensm/osm_sa_path_record.c
  @@ -1486,7 +1486,7 @@ __osm_pr_match_mgrp_attributes(
   
   /**
**/
  -static boolean_t
  +static int
   __osm_pr_rcv_check_mcast_dest(
 IN osm_pr_rcv_t* const p_rcv,
 IN const osm_madw_t* const p_madw )
  @@ -1494,7 +1494,7 @@ __osm_pr_rcv_check_mcast_dest(
 const ib_path_rec_t* p_pr;
 const ib_sa_mad_t*   p_sa_mad;
 ib_net64_t   comp_mask;
  -  boolean_tis_multicast = FALSE;
  +  unsigned is_multicast = 0;
   
 OSM_LOG_ENTER( p_rcv-p_log, __osm_pr_rcv_check_mcast_dest );
   
  @@ -1514,11 +1514,13 @@ __osm_pr_rcv_check_mcast_dest(
 {
   if( cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_START_HO 
   cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_END_HO )
  -  is_multicast = TRUE;
  -else if( is_multicast )
  +  is_multicast = 1;
  +else if( is_multicast ) {
 osm_log( p_rcv-p_log, OSM_LOG_ERROR,
  __osm_pr_rcv_check_mcast_dest: ERR 1F12: 
  PathRecord request indicates MGID but not MLID\n );
  +  return -1;
 
 I made this go through the exit so the routine end log message is put
 into the log.

Right.

Now there is 'is_multicast = -1' - you may want to change is_multicast
type to int (now it is unsigned).

 
  +}
 }
   
Exit:
  @@ -1693,6 +1695,7 @@ osm_pr_rcv_process(
 cl_qlist_t   pr_list;
 ib_net16_t   sa_status;
 osm_port_t*  requester_port;
  +  int ret;
   
 OSM_LOG_ENTER( p_rcv-p_log, osm_pr_rcv_process );
   
  @@ -1737,7 +1740,10 @@ osm_pr_rcv_process(
 cl_plock_acquire( p_rcv-p_lock );
   
 /* Handle multicast destinations separately */
  -  if( __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ) )
  +  if( (ret = __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ))  0)
 
 I added a send of SA status error for IB_MAD_STATUS_INVALID_FIELD here
 as well as an unlock.

Sure.

Sasha

 
  +goto Exit;
  +
  +  if(ret  0)
   goto McastDest;
   
 osm_log( p_rcv-p_log, OSM_LOG_DEBUG,
 
 -- Hal
 

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH] opensm: osm_sa_path_record: mcast destination detection fix

2006-08-21 Thread Hal Rosenstock
On Mon, 2006-08-21 at 13:59, Sasha Khapyorsky wrote:
 On 13:45 Mon 21 Aug , Hal Rosenstock wrote:
  On Mon, 2006-08-21 at 13:22, Sasha Khapyorsky wrote:
   Return error when mcast destination is not consistently indicated.
   
   Signed-off-by: Sasha Khapyorsky [EMAIL PROTECTED]
  
  Thanks. Applied (to both trunk and 1.1) with the following minor changes
  below:
  
osm/opensm/osm_sa_path_record.c |   16 +++-
1 files changed, 11 insertions(+), 5 deletions(-)
   
   diff --git a/osm/opensm/osm_sa_path_record.c 
   b/osm/opensm/osm_sa_path_record.c
   index caa9f32..6b0fb28 100644
   --- a/osm/opensm/osm_sa_path_record.c
   +++ b/osm/opensm/osm_sa_path_record.c
   @@ -1486,7 +1486,7 @@ __osm_pr_match_mgrp_attributes(

/**
 **/
   -static boolean_t
   +static int
__osm_pr_rcv_check_mcast_dest(
  IN osm_pr_rcv_t* const p_rcv,
  IN const osm_madw_t* const p_madw )
   @@ -1494,7 +1494,7 @@ __osm_pr_rcv_check_mcast_dest(
  const ib_path_rec_t* p_pr;
  const ib_sa_mad_t*   p_sa_mad;
  ib_net64_t   comp_mask;
   -  boolean_tis_multicast = FALSE;
   +  unsigned is_multicast = 0;

  OSM_LOG_ENTER( p_rcv-p_log, __osm_pr_rcv_check_mcast_dest );

   @@ -1514,11 +1514,13 @@ __osm_pr_rcv_check_mcast_dest(
  {
if( cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_START_HO 
cl_ntoh16( p_pr-dlid ) = IB_LID_MCAST_END_HO )
   -  is_multicast = TRUE;
   -else if( is_multicast )
   +  is_multicast = 1;
   +else if( is_multicast ) {
  osm_log( p_rcv-p_log, OSM_LOG_ERROR,
   __osm_pr_rcv_check_mcast_dest: ERR 1F12: 
   PathRecord request indicates MGID but not MLID\n );
   +  return -1;
  
  I made this go through the exit so the routine end log message is put
  into the log.
 
 Right.
 
 Now there is 'is_multicast = -1' - you may want to change is_multicast
 type to int (now it is unsigned).

Thanks. Just did that (to both trunk and 1.1).

-- Hal

 
  
   +}
  }

 Exit:
   @@ -1693,6 +1695,7 @@ osm_pr_rcv_process(
  cl_qlist_t   pr_list;
  ib_net16_t   sa_status;
  osm_port_t*  requester_port;
   +  int ret;

  OSM_LOG_ENTER( p_rcv-p_log, osm_pr_rcv_process );

   @@ -1737,7 +1740,10 @@ osm_pr_rcv_process(
  cl_plock_acquire( p_rcv-p_lock );

  /* Handle multicast destinations separately */
   -  if( __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ) )
   +  if( (ret = __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ))  0)
  
  I added a send of SA status error for IB_MAD_STATUS_INVALID_FIELD here
  as well as an unlock.
 
 Sure.
 
 Sasha
 
  
   +goto Exit;
   +
   +  if(ret  0)
goto McastDest;

  osm_log( p_rcv-p_log, OSM_LOG_DEBUG,
  
  -- Hal
  


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general