RE: [PATCH rdma-next 17/18] IB/core: Define 'ib' and 'eth' rdma_ah_attr types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > I can change the type check into a function if you feel its open
> coded.
> > One of the benefits of adding type to ah_attr is exactly the above
> code.
> > The caller doesnt have to call into the core (rdma_cap_eth_ah) to
> know what
> > 'protocol' its working with. That information is contained in the
> ah_attr itself.
> >
> I was referring to have helper function like rdma_cap_eth_ah, but for
> ah_attr_type
> as,
> is_ah_attr_eth(ah_attr).
> 
> I think it will be more useful, as there is more code in grh
> processing coming up, that needs to diverge based on ib vs roce.
> And there are few places we have that comparison anyway below. It just
> keep code neat.

FWIW, I don't see a benefit to converting a simple type check of an enum into a function.  The type allows its use in a switch statement, rather than needing to use if - else-if - else-if.

> While we are at it, I was thinking since iWarp doesn't use AH, we
> better name ah->type as ROCE, to avoid this confusion happening again?

I agree, though I'm still not sure v1 and v2 need all the same fields or use them in the same way.  Conceptually, a GRH in v2 doesn't make sense to me.  (I should go read the spec.)  But in any case v1/v2 separation could come as follow on changes.

- Sean

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux