[ewg] RE: [ofa-general] OFED 1.3 Beta release is available

Tang, Changqing changquing.tang at hp.com
Mon Dec 17 07:35:12 PST 2007


I remembered someone else suggested to use:

struct ibv_context {
         struct ibv_device      *device;
         struct ibv_context_ops  ops;
         int                     cmd_fd;
         int                     async_fd;
         int                     num_comp_vectors;
         pthread_mutex_t         mutex;
         void                   *abi_compat;
         struct ibv_context_extra_ops  extra_ops;
};

Here we don't use pointer for extra_ops, and any future changes are added into 'extra_ops',
So why not this way ?


Thanks.
--CQ

> -----Original Message-----
> From: Jack Morgenstein [mailto:jackm at dev.mellanox.co.il]
> Sent: Sunday, December 16, 2007 11:01 AM
> To: general at lists.openfabrics.org
> Cc: Tang, Changqing; Roland Dreier;
> ewg at lists.openfabrics.org; general at lists.openfabrics.org
> Subject: Re: [ofa-general] OFED 1.3 Beta release is available
>
> On Wednesday 05 December 2007 17:45, Tang, Changqing wrote:
> > > I think the only alternative we have to preserve backwards
> > > compatibility is to leave struct ibv_context_ops alone and change
> > > the structure to:
> > >
> > > struct ibv_context {
> > >         struct ibv_device      *device;
> > >         struct ibv_context_ops  ops;
> > >         int                     cmd_fd;
> > >         int                     async_fd;
> > >         int                     num_comp_vectors;
> > >         pthread_mutex_t         mutex;
> > >         void                   *abi_compat;
> > >         struct ibv_xrc_op      *xrc_ops;
> > > };
> > >
> > > with xrc_ops added at the end.  It's my fault for not
> making the ops
> > > member a pointer I guess.
> > >
> > > Tziporet/Jack/whoever -- please fix up the libibverbs you
> ship for
> > > OFED 1.3 to resolve this.
> > >
> > > We can clean this up for libibverbs 1.2 when the ABI can change,
> > > if/when we have something worth breaking the ABI for.
> >
>
> We need to have all userspace libraries set their private
> context object to 0 at allocation time (the private context
> object includes the ibv_context structure, which must now be
> NULL-ed out).
>
> The other userspace driver libraries (e.g., libmthca) do not
> zero-out their internal userspace context structures (e.g.,
> mthca_context) which include the ibv_context structure as the
> first element.
> Up to now, we depended on the ibv_context assign to set
> unavailable verb implementations to NULL.
> (and every userspace driver assigned the ops structure, with
> unimplemented operations set to NULL by the compiler).
> This is no longer true.
>
> Thus, anyone installing OFED will have a compatible set of
> userspace drivers for XRC applications (drivers which do not
> implement XRC will return errors for XRC-verbs).
>
> Applications which were compiled with previous libraries will
> still work (since they do not use XRC).
>
> - Jack
>



More information about the ewg mailing list