}\r
\r
\r
+static ib_api_status_t\r
+__check_av_port(\r
+ IN const al_ci_ca_t* const p_ci_ca,\r
+ IN const ib_av_attr_t* const p_av_attr )\r
+{\r
+ ib_api_status_t status = IB_SUCCESS;\r
+\r
+ if (p_av_attr->port_num == 0 || p_av_attr->port_num > p_ci_ca->num_ports)\r
+ {\r
+ AL_PRINT(TRACE_LEVEL_WARNING ,AL_DBG_AV,\r
+ ("invalid port number specified (%d)\n", p_av_attr->port_num) );\r
+ status = IB_INVALID_PORT;\r
+ }\r
+ return status;\r
+}\r
+\r
\r
ib_api_status_t\r
create_av(\r
return IB_INVALID_PD_HANDLE;\r
}\r
\r
+ status = __check_av_port(h_pd->obj.p_ci_ca, p_av_attr);\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PORT\n") );\r
+ return status;\r
+ }\r
+ \r
/* Get an AV tracking structure. */\r
h_av = alloc_av();\r
if( !h_av )\r
return IB_INVALID_PARAMETER;\r
}\r
\r
+ status = __check_av_port(h_av->obj.p_ci_ca, p_av_mod);\r
+ if( status != IB_SUCCESS )\r
+ {\r
+ AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PORT\n") );\r
+ return status;\r
+ }\r
+\r
status = verbs_modify_av(h_av, p_av_mod);\r
\r
/* Record av for special qp access */\r
uint16_t i;\r
\r
ci_ca_lock_attr( p_ci_ca );\r
-\r
- // sanity check\r
- if (port_num == 0 || port_num > p_ci_ca->p_user_attr->num_ports)\r
- {\r
- AL_PRINT(TRACE_LEVEL_WARNING ,AL_DBG_AV,\r
- ("UAL_GET_GID_INDEX: invalid port number specified (%d)\n", port_num) );\r
- status = IB_INVALID_PORT;\r
- goto out;\r
- }\r
-\r
- p_port_attr = &p_ci_ca->p_user_attr->p_port_attr[port_num];\r
+ p_port_attr = &p_ci_ca->p_pnp_attr->p_port_attr[port_num-1];\r
for( i = 0; i < p_port_attr->num_gids; i++ )\r
{\r
if( !cl_memcmp(p_gid, &p_port_attr->p_gid_table[i], sizeof(ib_gid_t)) )\r
break;\r
}\r
}\r
-\r
-out:\r
ci_ca_unlock_attr( p_ci_ca );\r
\r
return status;\r