Re: [PATCH for-next v4 09/13] RDMA/rxe: Replaced keyed rxe objects by indexed objects

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

 



On 11/19/21 11:41, Jason Gunthorpe wrote:
> On Wed, Nov 03, 2021 at 12:02:38AM -0500, Bob Pearson wrote:
>> +	if (mgid->raw[10] == 0xff && mgid->raw[11] == 0xff) {
>> +		if ((mgid->raw[12] & 0xf0) != 0xe0)
>> +			pr_info("mgid is not an ipv4 mc address\n");
>> +
>> +		/* mgid is a mapped IPV4 multicast address
>> +		 * use the 32 bits as an index which will be
>> +		 * unique
>> +		 */
>> +		index = be32_to_cpu(val32[3]);
>> +	} else {
>> +		if (mgid->raw[0] != 0xff)
>> +			pr_info("mgid is not an ipv6 mc address\n");
>> +
>> +		/* mgid is an IPV6 multicast address which won't
>> +		 * fit into the index so construct the index
>> +		 * from the four 32 bit words in mgid.
>> +		 * If there is a collision treat it like
>> +		 * no memory and return NULL
>> +		 */
>> +		index = be32_to_cpu(val32[0] ^ val32[1]);
>> +		index = (index << 32) | be32_to_cpu(val32[2] ^ val32[3]);
> 
> I'm not sure failing is such a good thing, can it chain them on a
> linked list or something?
> 
> Jason
> 

I had developed a version of the proposed patch which did what you suggest and felt that
it wasn't an improvement over the current code. Just too complicated. This patch is only
marginally cleaner than what is already there. I am leaning towards just leaving the
current red-black tree based code in place for mgids which don't fit nicely into xarrays
which however are quite a bit better for 32 bit indices (qpns, qkeys, rkeys, etc.)
Multicast is not an important use case for RoCE since plain IP is a better solution.
Unless you think otherwise we should just drop this patch.

Bob



[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