All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wendy Cheng <wcheng@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: [PATCH 2/3] NLM per-ip grace period - core
Date: Tue, 29 Jan 2008 12:10:32 -0500	[thread overview]
Message-ID: <479F5E08.5050807@redhat.com> (raw)
In-Reply-To: <514B944F-02FC-4164-BFDA-209361F4BD25@oracle.com>

Chuck Lever wrote:
> On Jan 28, 2008, at 9:56 PM, J. Bruce Fields wrote:
>> On Fri, Jan 25, 2008 at 12:17:30AM -0500, Wendy Cheng wrote:
>>
>>> The logic is implemented on top of linux nfsd procfs with core 
>>> functions
>>> residing in lockd kernel module. Entry function is 
>>> nlmsvc_resume_ip() where
>>> it stores the requested ip interface into a linked-list 
>>> nlm_failover_list.
>>> The list entry count is nlm_failover_cnt and access protection is 
>>> done by
>>> nlm_failover_mutex. Entry in nlm_failover_ip_list is a 
>>> "nlm_failover_struct",
>>> defined in: include/linux/lockd/lockd.h.
>>>
>>>
>>> +struct nlm_failover_struct {
>>> + struct list_head g_list; /* linked list */
>>> + unsigned long g_expire; /* grace period expire */
>>> + int g_size; /* g_key type: ipv4 or ipv6 */
>>> + union {
>>> + __be32 ipv4; /* ip v4 address */
>>> + __be32 ipv6[4]; /* ip v6 address */
>>> + } g_key;
>>> +#define g_ip g_key.ipv6
>>> +};
>>
>> Only the second member of that union is every used; could we just get
>> rid of the union?
>>
>> Also, is that the right choice of types? Maybe we should just use
>> struct in6_addr?
>
> I agree with Bruce -- just use in_addr, and leave out the unused IPv6 
> stuff for now.
>
> In some places, we just replace in_addr with in6_addr and simply map 
> IPv4 to IPv6 addresses, rather than setting up a union.
>
> If the address is used as a hash and never displayed, using a mapped 
> IPv4 address is sufficient, and keeps things simple.

ok, I have been yo-yoing about whether doing IPv6 support. This sounds 
like a good plan. Will do.

-- Wendy



WARNING: multiple messages have this Message-ID (diff)
From: Wendy Cheng <wcheng@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	cluster-devel@redhat.com, NFS list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 2/3] NLM per-ip grace period - core
Date: Tue, 29 Jan 2008 12:10:32 -0500	[thread overview]
Message-ID: <479F5E08.5050807@redhat.com> (raw)
In-Reply-To: <514B944F-02FC-4164-BFDA-209361F4BD25@oracle.com>

Chuck Lever wrote:
> On Jan 28, 2008, at 9:56 PM, J. Bruce Fields wrote:
>> On Fri, Jan 25, 2008 at 12:17:30AM -0500, Wendy Cheng wrote:
>>
>>> The logic is implemented on top of linux nfsd procfs with core 
>>> functions
>>> residing in lockd kernel module. Entry function is 
>>> nlmsvc_resume_ip() where
>>> it stores the requested ip interface into a linked-list 
>>> nlm_failover_list.
>>> The list entry count is nlm_failover_cnt and access protection is 
>>> done by
>>> nlm_failover_mutex. Entry in nlm_failover_ip_list is a 
>>> "nlm_failover_struct",
>>> defined in: include/linux/lockd/lockd.h.
>>>
>>>
>>> +struct nlm_failover_struct {
>>> + struct list_head g_list; /* linked list */
>>> + unsigned long g_expire; /* grace period expire */
>>> + int g_size; /* g_key type: ipv4 or ipv6 */
>>> + union {
>>> + __be32 ipv4; /* ip v4 address */
>>> + __be32 ipv6[4]; /* ip v6 address */
>>> + } g_key;
>>> +#define g_ip g_key.ipv6
>>> +};
>>
>> Only the second member of that union is every used; could we just get
>> rid of the union?
>>
>> Also, is that the right choice of types? Maybe we should just use
>> struct in6_addr?
>
> I agree with Bruce -- just use in_addr, and leave out the unused IPv6 
> stuff for now.
>
> In some places, we just replace in_addr with in6_addr and simply map 
> IPv4 to IPv6 addresses, rather than setting up a union.
>
> If the address is used as a hash and never displayed, using a mapped 
> IPv4 address is sufficient, and keeps things simple.

ok, I have been yo-yoing about whether doing IPv6 support. This sounds 
like a good plan. Will do.

-- Wendy

  reply	other threads:[~2008-01-29 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25  5:17 [Cluster-devel] [PATCH 2/3] NLM per-ip grace period - core Wendy Cheng
2008-01-25  5:17 ` Wendy Cheng
2008-01-29  2:56 ` [Cluster-devel] " J. Bruce Fields
2008-01-29  2:56   ` J. Bruce Fields
2008-01-29 16:33   ` Chuck Lever
2008-01-29 17:10     ` Wendy Cheng [this message]
2008-01-29 17:10       ` Wendy Cheng
2008-01-29 17:21     ` [Cluster-devel] " J. Bruce Fields
2008-01-29 17:21       ` J. Bruce Fields
2008-01-30  0:14 ` [Cluster-devel] " J. Bruce Fields
2008-01-30  0:14   ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=479F5E08.5050807@redhat.com \
    --to=wcheng@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.