diff mbox

[net-next,v4,1/2] vxlan: introduce vxlan_rdst_append

Message ID 1372004543-24675-2-git-send-email-mike.rapoport@ravellosystems.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Mike Rapoport June 23, 2013, 4:22 p.m. UTC
to allow remotes list management for both FDB entries and default
destinations

Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
---
 drivers/net/vxlan.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Cong Wang June 24, 2013, 6:02 a.m. UTC | #1
On Sun, 23 Jun 2013 at 16:22 GMT, Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
> to allow remotes list management for both FDB entries and default
> destinations
>
> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
> ---
>  drivers/net/vxlan.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 212a256..e5fb6568 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -386,14 +386,13 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
>  	return f;
>  }
>  
> -/* Add/update destinations for multicast */
> -static int vxlan_fdb_append(struct vxlan_fdb *f,
> +static int vxlan_rdst_append(struct list_head *remotes,
>  			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)


I think you need to align the above line.


>  {
>  	struct vxlan_rdst *rd;
>  
>  	/* protected by vxlan->hash_lock */
> -	list_for_each_entry(rd, &f->remotes, list) {
> +	list_for_each_entry(rd, remotes, list) {

This patch is based on Stephen's patches which are not yet merged into
net-next, right? If so, I think you have to wait. My IPv6 patches are
pending because of his patches too.


>  		if (rd->remote_ip == ip &&
>  		    rd->remote_port == port &&
>  		    rd->remote_vni == vni &&
> @@ -409,11 +408,18 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
>  	rd->remote_vni = vni;
>  	rd->remote_ifindex = ifindex;
>  
> -	list_add_tail_rcu(&rd->list, &f->remotes);
> +	list_add_tail_rcu(&rd->list, remotes);
>  
>  	return 1;
>  }
>  
> +/* Add/update destinations for multicast */
> +static int vxlan_fdb_append(struct vxlan_fdb *f,
> +			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)

You need to align this line too.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Rapoport June 24, 2013, 6:54 a.m. UTC | #2
On Mon, Jun 24, 2013 at 9:02 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Sun, 23 Jun 2013 at 16:22 GMT, Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
>> to allow remotes list management for both FDB entries and default
>> destinations
>>
>> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
>> ---
>>  drivers/net/vxlan.c | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>> index 212a256..e5fb6568 100644
>> --- a/drivers/net/vxlan.c
>> +++ b/drivers/net/vxlan.c
>> @@ -386,14 +386,13 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
>>       return f;
>>  }
>>
>> -/* Add/update destinations for multicast */
>> -static int vxlan_fdb_append(struct vxlan_fdb *f,
>> +static int vxlan_rdst_append(struct list_head *remotes,
>>                           __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
>
>
> I think you need to align the above line.

I just kept the original indentation

>>
>> +/* Add/update destinations for multicast */
>> +static int vxlan_fdb_append(struct vxlan_fdb *f,
>> +                         __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
>
> You need to align this line too.

And here as well.

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



--
Sincerely yours,
Mike.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Rapoport June 24, 2013, 7:21 a.m. UTC | #3
On Mon, Jun 24, 2013 at 9:02 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Sun, 23 Jun 2013 at 16:22 GMT, Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
>>  {
>>       struct vxlan_rdst *rd;
>>
>>       /* protected by vxlan->hash_lock */
>> -     list_for_each_entry(rd, &f->remotes, list) {
>> +     list_for_each_entry(rd, remotes, list) {
>
> This patch is based on Stephen's patches which are not yet merged into
> net-next, right? If so, I think you have to wait. My IPv6 patches are
> pending because of his patches too.

I know that my patches (as well as OVS pacthes) are getting in the way
of your IPv6 work. I've patiently waited at the beginning of the cycle
for you to merge the IPv6 patches. Afterwards I've waited for Stephen
and David to reach an agreement about the list implementation. So I
think I can send the patches for review without waiting, even although
vxlan-net has not been merged into the net-next yet.

--
Sincerely yours,
Mike.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 24, 2013, 8:28 a.m. UTC | #4
From: Mike Rapoport <mike.rapoport@ravellosystems.com>
Date: Mon, 24 Jun 2013 09:54:51 +0300

> On Mon, Jun 24, 2013 at 9:02 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Sun, 23 Jun 2013 at 16:22 GMT, Mike Rapoport <mike.rapoport@ravellosystems.com> wrote:
>>> to allow remotes list management for both FDB entries and default
>>> destinations
>>>
>>> Signed-off-by: Mike Rapoport <mike.rapoport@ravellosystems.com>
>>> ---
>>>  drivers/net/vxlan.c | 14 ++++++++++----
>>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>>> index 212a256..e5fb6568 100644
>>> --- a/drivers/net/vxlan.c
>>> +++ b/drivers/net/vxlan.c
>>> @@ -386,14 +386,13 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
>>>       return f;
>>>  }
>>>
>>> -/* Add/update destinations for multicast */
>>> -static int vxlan_fdb_append(struct vxlan_fdb *f,
>>> +static int vxlan_rdst_append(struct list_head *remotes,
>>>                           __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
>>
>>
>> I think you need to align the above line.
> 
> I just kept the original indentation

When you change the arguments to a function, you are absolutely obligated
to fix the indentation of any surrounding lines.

In the networking code, functions are to be styled such that the arguments
appearing on the second and subsequent lines are aligned perfectly to the
first column after the openning parenthesis of the first line.

Therefore, if you change where that openning parenthesis is, you must
reindent the subsequent lines.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 212a256..e5fb6568 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -386,14 +386,13 @@  static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
 	return f;
 }
 
-/* Add/update destinations for multicast */
-static int vxlan_fdb_append(struct vxlan_fdb *f,
+static int vxlan_rdst_append(struct list_head *remotes,
 			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
 {
 	struct vxlan_rdst *rd;
 
 	/* protected by vxlan->hash_lock */
-	list_for_each_entry(rd, &f->remotes, list) {
+	list_for_each_entry(rd, remotes, list) {
 		if (rd->remote_ip == ip &&
 		    rd->remote_port == port &&
 		    rd->remote_vni == vni &&
@@ -409,11 +408,18 @@  static int vxlan_fdb_append(struct vxlan_fdb *f,
 	rd->remote_vni = vni;
 	rd->remote_ifindex = ifindex;
 
-	list_add_tail_rcu(&rd->list, &f->remotes);
+	list_add_tail_rcu(&rd->list, remotes);
 
 	return 1;
 }
 
+/* Add/update destinations for multicast */
+static int vxlan_fdb_append(struct vxlan_fdb *f,
+			    __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
+{
+	return vxlan_rdst_append(&f->remotes, ip, port, vni, ifindex);
+}
+
 /* Add new entry to forwarding table -- assumes lock held */
 static int vxlan_fdb_create(struct vxlan_dev *vxlan,
 			    const u8 *mac, __be32 ip,