Re: [PATCH 11/12] svcrdma: Add a message log string to indicate if FastReg is being used

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

 



On Thu, Oct 09, 2008 at 01:46:43PM -0500, Tom Tucker wrote:
> Coming up with a name for the command is probably
> harder than writing it.
>
> Here it is...

Neat-o, thanks.

Just for fun, I installed libibverbs from Fedora 9, modprobe'd
ib_uverbs, and tried running this, and got a "libibverbs: Warning:
couldn't open config directory '/etc/libibverbs.d'."  Is there a HOWTO
somewhere that I should know about?

--b.

>
> #include <stdlib.h>
> #include <stdio.h>
> #include <infiniband/verbs.h>
>
> #define FAST_REG (1<<21) /* This will be in infiniband/verbs.h in the future */
>
> static char *safety_string(struct ibv_device_attr *a, struct ibv_device *dev)
> {
>         if (a->device_cap_flags & FAST_REG
>             || dev->transport_type == IBV_TRANSPORT_IB)
>                 return "Safe. NFSRDMA exposes only RPC memory.\n";
>         else
>                 return "Unsafe. NFSRDMA exposes Server memory.\n";
> }
>
> int main(int argc, char *argv[])
> {
>         struct ibv_device **dev_list;
>         struct ibv_context *context;
>         struct ibv_device_attr attr;
>         int dev_count;
>         int i;
>
>         dev_list = ibv_get_device_list(&dev_count);
>         for (i = 0; dev_list && i < dev_count; i++) {
>                 printf("%-20s: ", ibv_get_device_name(dev_list[i]));
>                 context = ibv_open_device(dev_list[i]);
>                 if (!context) {
>                         printf("could not open device\n");
>                         continue;
>                 }
>                 if (!ibv_query_device(context, &attr))
>                         printf("%s\n", safety_string(&attr, dev_list[i]));
>                 else
>                         printf("could not query device\n");
>
>                 ibv_close_device(context);
>         }
>         if (dev_list)
>                 ibv_free_device_list(dev_list);
>
>         exit(0);
> }
>
>> The one drawback is that it wouldn't be able to tell whether the
>> currently running kernel actually supported fast registration.  Do you
>> think a guess based on kernel version would be good enough for that?
>>
>
> I do, yes.
>
>>> This code makes devices more secure than they used to be. So there is 
>>> no  negative security regression here. This patchset simply improves 
>>> the security for newer devices that support the new features.
>>
>> Yes, agreed.  Just to be clear, I *have* queued up all but these last
>> two patches (the printk and documentation patches) for 2.6.28.  
>>
>
> Ok, thanks.
>
>> --b.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux