[ofw] [PATCH] remove call to generate port, pass in port arg

Smith, Stan stan.smith at intel.com
Wed Nov 17 14:14:40 PST 2010


Alex Naslednikov wrote:
> I was sure I already responded, my apologizes.

Not a problem...busy times.

> I am ok to commit it.

Done in svn 2998

> But generally, I do not believe that passing p_port parameter on the
> stack will work faster than taking it from the parent struct by
> macro. In addition,  the function __endpt_parent still be in use
> while referencing or dereferencing endpoints

Agreed, not a major performance enhancement; although it does clean up
the code somewhat.

>
> Please, note that we can do the same for CM flow: remove
> ipoib_endpt_parent() function at all and add p_port parameter to
> endpt_cm_recv_mgr_filter (if you decided to use CM code that Alex
> worked on it)

Good idea, will make it so.
Upon further investigation in ipoib_port.cpp, I find code which will not compile if perf is turned on.
build_send_desc()
Line 5323
- cl_perf_stop( &p_port->p_adapter->perf, SendMgrFilter );
+ cl_perf_stop( &s_buf->p_port->p_adapter->perf, SendMgrFilter );

send_mgr_filter()
Line 3574
- cl_perf_stop( &p_port->p_adapter->perf, FilterIpV6 );
+ cl_perf_stop( &s_buf->p_port->p_adapter->perf, FilterIpV6 );

Line 3579
- cl_perf_stop( &p_port->p_adapter->perf, FilterIp );
+ cl_perf_stop( &s_buf->p_port->p_adapter->perf, FilterIp );

Line 3586
- cl_perf_stop( &p_port->p_adapter->perf, FilterArp );
+ cl_perf_stop( &s_buf->p_port->p_adapter->perf, FilterArp );

Line 3598
- cl_perf_stop( &p_port->p_adapter->perf, SendGen );
+ cl_perf_stop( &s_buf->p_port->p_adapter->perf, SendGen );

Thanks for suggesting I look into the port passing issue.

stan.

>
> -----Original Message-----
> From: Smith, Stan [mailto:stan.smith at intel.com]
> Sent: Tuesday, November 16, 2010 7:01 PM
> To: Alex Naslednikov
> Cc: ofw at lists.openfabrics.org
> Subject: FW: [PATCH] remove call to generate port, pass in port arg
>
>
> Alex,
>   Did you have any issues with this patch?
>
> thanks,
>
> stan.
>
>
> Smith, Stan wrote:
>> Hello,
>>   In the function ipoib_endpt_queue(), pass in the p_port arg instead
>> of calling a function to generate the p_port arg.
>>
>> signed-off-by: stan smith <stan.smith at intel.com>
>>
>
> --- A/ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.h        Wed Nov 10
> 17:06:11 2010 +++ B/ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.h
> Wed Nov 10 17:02:46 2010 @@ -223,7 +223,8 @@
>
>  NDIS_STATUS
>  ipoib_endpt_queue(
> -       IN              ipoib_endpt_t* const            p_endpt );
> +       IN              ipoib_port_t* const             p_port,
> +       IN              ipoib_endpt_t* const            p_endpt );
>
>  struct _ipoib_port *
>  ipoib_endpt_parent(
>
> --- A/ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.cpp      Wed Nov 10
> 17:06:48 2010 +++ B/ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.cpp
> Wed Nov 10 17:04:26 2010 @@ -367,10 +367,10 @@
>   */
>  NDIS_STATUS
>  ipoib_endpt_queue(
> +       IN                              ipoib_port_t* const
>         p_port, IN                              ipoib_endpt_t* const
>  p_endpt ) {
>         ib_api_status_t status;
> -       ipoib_port_t    *p_port;
>         ib_av_attr_t    av_attr;
>         net32_t         flow_lbl;
>
> @@ -400,8 +400,6 @@
>         }
>
>         /* This is the first packet for this endpoint. Create the AV.
> */
> -       p_port = __endpt_parent( p_endpt );
> -
>         cl_memclr( &av_attr, sizeof(ib_av_attr_t) );
>
>         av_attr.port_num = p_port->port_num;
>
> --- A/ipoib_NDIS6_CM/kernel/ipoib_port.cpp      Wed Nov 10 17:05:24
> 2010 +++ B/ipoib_NDIS6_CM/kernel/ipoib_port.cpp      Wed Nov 10
> 17:05:07 2010 @@ -6732,7 +6732,7 @@
>         cl_obj_unlock( &p_port->obj );
>
>         cl_perf_start( EndptQueue );
> -       status = ipoib_endpt_queue( *pp_endpt );
> +       status = ipoib_endpt_queue( p_port, *pp_endpt );
>         cl_perf_stop( &p_port->p_adapter->perf, EndptQueue );
>         if( status != NDIS_STATUS_SUCCESS )
>                 *pp_endpt = NULL;




More information about the ofw mailing list