All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
@ 2017-06-03 13:47 Zhang Shengju
  2017-06-04  5:58 ` Pravin Shelar
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang Shengju @ 2017-06-03 13:47 UTC (permalink / raw)
  To: pshelar, netdev, davem

Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
declaration of vport type alias, and replace magic numbers with
symbolic constants.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 net/openvswitch/vport-geneve.c | 2 +-
 net/openvswitch/vport-gre.c    | 2 +-
 net/openvswitch/vport-vxlan.c  | 2 +-
 net/openvswitch/vport.h        | 3 +++
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c
index 5aaf3ba..1c068d6 100644
--- a/net/openvswitch/vport-geneve.c
+++ b/net/openvswitch/vport-geneve.c
@@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
 
 MODULE_DESCRIPTION("OVS: Geneve switching port");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("vport-type-5");
+MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
index 0e72d95..48a5852 100644
--- a/net/openvswitch/vport-gre.c
+++ b/net/openvswitch/vport-gre.c
@@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
 
 MODULE_DESCRIPTION("OVS: GRE switching port");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("vport-type-3");
+MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index 869acb3..b6257bb 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -179,4 +179,4 @@ static void __exit ovs_vxlan_tnl_exit(void)
 
 MODULE_DESCRIPTION("OVS: VXLAN switching port");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("vport-type-4");
+MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_VXLAN);
diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h
index cda66c2..1d1584f 100644
--- a/net/openvswitch/vport.h
+++ b/net/openvswitch/vport.h
@@ -199,4 +199,7 @@ static inline const char *ovs_vport_name(struct vport *vport)
 void ovs_vport_ops_unregister(struct vport_ops *ops);
 void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto);
 
+#define MODULE_ALIAS_VPORT_TYPE(type) \
+	MODULE_ALIAS("vport-type-" __stringify(type))
+
 #endif /* vport.h */
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-03 13:47 [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias Zhang Shengju
@ 2017-06-04  5:58 ` Pravin Shelar
  2017-06-04  8:12   ` 张胜举
  2017-06-04 20:12   ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Pravin Shelar @ 2017-06-04  5:58 UTC (permalink / raw)
  To: Zhang Shengju
  Cc: Pravin Shelar, Linux Kernel Network Developers, David S. Miller

On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
<zhangshengju@cmss.chinamobile.com> wrote:
> Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
> declaration of vport type alias, and replace magic numbers with
> symbolic constants.
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
>  net/openvswitch/vport-geneve.c | 2 +-
>  net/openvswitch/vport-gre.c    | 2 +-
>  net/openvswitch/vport-vxlan.c  | 2 +-
>  net/openvswitch/vport.h        | 3 +++
>  4 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c
> index 5aaf3ba..1c068d6 100644
> --- a/net/openvswitch/vport-geneve.c
> +++ b/net/openvswitch/vport-geneve.c
> @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
>
>  MODULE_DESCRIPTION("OVS: Geneve switching port");
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("vport-type-5");
> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
> diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
> index 0e72d95..48a5852 100644
> --- a/net/openvswitch/vport-gre.c
> +++ b/net/openvswitch/vport-gre.c
> @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
>
>  MODULE_DESCRIPTION("OVS: GRE switching port");
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("vport-type-3");
> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);

This is user visible change. For example this is changing the gre
module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
This could break userspace application.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-04  5:58 ` Pravin Shelar
@ 2017-06-04  8:12   ` 张胜举
  2017-06-05  2:29     ` Pravin Shelar
  2017-06-04 20:12   ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: 张胜举 @ 2017-06-04  8:12 UTC (permalink / raw)
  To: 'Pravin Shelar'
  Cc: 'Pravin Shelar',
	'Linux Kernel Network Developers',
	'David S. Miller'

> -----Original Message-----
> From: Pravin Shelar [mailto:pshelar@ovn.org]
> Sent: Sunday, June 04, 2017 1:58 PM
> To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Cc: Pravin Shelar <pshelar@nicira.com>; Linux Kernel Network Developers
> <netdev@vger.kernel.org>; David S. Miller <davem@davemloft.net>
> Subject: Re: [net-next] openvswitch: add macro
> MODULE_ALIAS_VPORT_TYPE for vport type alias
> 
> On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
> <zhangshengju@cmss.chinamobile.com> wrote:
> > Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
> > declaration of vport type alias, and replace magic numbers with
> > symbolic constants.
> >
> > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> > ---
> >  net/openvswitch/vport-geneve.c | 2 +-
> >  net/openvswitch/vport-gre.c    | 2 +-
> >  net/openvswitch/vport-vxlan.c  | 2 +-
> >  net/openvswitch/vport.h        | 3 +++
> >  4 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/net/openvswitch/vport-geneve.c
> > b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
> > --- a/net/openvswitch/vport-geneve.c
> > +++ b/net/openvswitch/vport-geneve.c
> > @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
> >
> >  MODULE_DESCRIPTION("OVS: Geneve switching port");
> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
> > diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
> > index 0e72d95..48a5852 100644
> > --- a/net/openvswitch/vport-gre.c
> > +++ b/net/openvswitch/vport-gre.c
> > @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
> >
> >  MODULE_DESCRIPTION("OVS: GRE switching port");
> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
> 
> This is user visible change. For example this is changing the gre
> module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
> This could break userspace application.
Hi Shelar,
Actually this change does not change module alias name. I use '__stringify' to 
address this.  Below is my build result:
```
[zhangshengju@promote net-next]$ modinfo net/openvswitch/vport-gre.ko 
filename:       /gitlab/net-next/net/openvswitch/vport-gre.ko
alias:          vport-type-3
...
```

BRs,
Zhang Shengju

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-04  5:58 ` Pravin Shelar
  2017-06-04  8:12   ` 张胜举
@ 2017-06-04 20:12   ` David Miller
  2017-06-05  1:10     ` 张胜举
  1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2017-06-04 20:12 UTC (permalink / raw)
  To: pshelar; +Cc: zhangshengju, pshelar, netdev

From: Pravin Shelar <pshelar@ovn.org>
Date: Sat, 3 Jun 2017 22:58:22 -0700

> On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
> <zhangshengju@cmss.chinamobile.com> wrote:
>> Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
>> declaration of vport type alias, and replace magic numbers with
>> symbolic constants.
>>
>> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>> ---
>>  net/openvswitch/vport-geneve.c | 2 +-
>>  net/openvswitch/vport-gre.c    | 2 +-
>>  net/openvswitch/vport-vxlan.c  | 2 +-
>>  net/openvswitch/vport.h        | 3 +++
>>  4 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c
>> index 5aaf3ba..1c068d6 100644
>> --- a/net/openvswitch/vport-geneve.c
>> +++ b/net/openvswitch/vport-geneve.c
>> @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
>>
>>  MODULE_DESCRIPTION("OVS: Geneve switching port");
>>  MODULE_LICENSE("GPL");
>> -MODULE_ALIAS("vport-type-5");
>> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
>> diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
>> index 0e72d95..48a5852 100644
>> --- a/net/openvswitch/vport-gre.c
>> +++ b/net/openvswitch/vport-gre.c
>> @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
>>
>>  MODULE_DESCRIPTION("OVS: GRE switching port");
>>  MODULE_LICENSE("GPL");
>> -MODULE_ALIAS("vport-type-3");
>> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
> 
> This is user visible change. For example this is changing the gre
> module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
> This could break userspace application.

Agreed, you really can't do this.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-04 20:12   ` David Miller
@ 2017-06-05  1:10     ` 张胜举
  2017-06-05  1:25       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: 张胜举 @ 2017-06-05  1:10 UTC (permalink / raw)
  To: 'David Miller', pshelar; +Cc: pshelar, netdev

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Monday, June 05, 2017 4:13 AM
> To: pshelar@ovn.org
> Cc: zhangshengju@cmss.chinamobile.com; pshelar@nicira.com;
> netdev@vger.kernel.org
> Subject: Re: [net-next] openvswitch: add macro
> MODULE_ALIAS_VPORT_TYPE for vport type alias
> 
> From: Pravin Shelar <pshelar@ovn.org>
> Date: Sat, 3 Jun 2017 22:58:22 -0700
> 
> > On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
> > <zhangshengju@cmss.chinamobile.com> wrote:
> >> Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
> >> declaration of vport type alias, and replace magic numbers with
> >> symbolic constants.
> >>
> >> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> >> ---
> >>  net/openvswitch/vport-geneve.c | 2 +-
> >>  net/openvswitch/vport-gre.c    | 2 +-
> >>  net/openvswitch/vport-vxlan.c  | 2 +-
> >>  net/openvswitch/vport.h        | 3 +++
> >>  4 files changed, 6 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/net/openvswitch/vport-geneve.c
> >> b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
> >> --- a/net/openvswitch/vport-geneve.c
> >> +++ b/net/openvswitch/vport-geneve.c
> >> @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
> >>
> >>  MODULE_DESCRIPTION("OVS: Geneve switching port");
> >> MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
> >> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
> >> diff --git a/net/openvswitch/vport-gre.c
> >> b/net/openvswitch/vport-gre.c index 0e72d95..48a5852 100644
> >> --- a/net/openvswitch/vport-gre.c
> >> +++ b/net/openvswitch/vport-gre.c
> >> @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
> >>
> >>  MODULE_DESCRIPTION("OVS: GRE switching port");
> >> MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
> >> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
> >
> > This is user visible change. For example this is changing the gre
> > module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
> > This could break userspace application.
> 
> Agreed, you really can't do this.

Hi David,
Actually this change does not change module alias name. I use '__stringify'
to 
address this.  Please refer my previous reply.

BRs,
Zhang Shengju

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-05  1:10     ` 张胜举
@ 2017-06-05  1:25       ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-06-05  1:25 UTC (permalink / raw)
  To: zhangshengju; +Cc: pshelar, pshelar, netdev

From: 张胜举 <zhangshengju@cmss.chinamobile.com>
Date: Mon, 5 Jun 2017 09:10:22 +0800

>> -----Original Message-----
>> From: David Miller [mailto:davem@davemloft.net]
>> Sent: Monday, June 05, 2017 4:13 AM
>> To: pshelar@ovn.org
>> Cc: zhangshengju@cmss.chinamobile.com; pshelar@nicira.com;
>> netdev@vger.kernel.org
>> Subject: Re: [net-next] openvswitch: add macro
>> MODULE_ALIAS_VPORT_TYPE for vport type alias
>> 
>> From: Pravin Shelar <pshelar@ovn.org>
>> Date: Sat, 3 Jun 2017 22:58:22 -0700
>> 
>> > On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
>> > <zhangshengju@cmss.chinamobile.com> wrote:
>> >> Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
>> >> declaration of vport type alias, and replace magic numbers with
>> >> symbolic constants.
>> >>
>> >> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>> >> ---
>> >>  net/openvswitch/vport-geneve.c | 2 +-
>> >>  net/openvswitch/vport-gre.c    | 2 +-
>> >>  net/openvswitch/vport-vxlan.c  | 2 +-
>> >>  net/openvswitch/vport.h        | 3 +++
>> >>  4 files changed, 6 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/net/openvswitch/vport-geneve.c
>> >> b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
>> >> --- a/net/openvswitch/vport-geneve.c
>> >> +++ b/net/openvswitch/vport-geneve.c
>> >> @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
>> >>
>> >>  MODULE_DESCRIPTION("OVS: Geneve switching port");
>> >> MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
>> >> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
>> >> diff --git a/net/openvswitch/vport-gre.c
>> >> b/net/openvswitch/vport-gre.c index 0e72d95..48a5852 100644
>> >> --- a/net/openvswitch/vport-gre.c
>> >> +++ b/net/openvswitch/vport-gre.c
>> >> @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
>> >>
>> >>  MODULE_DESCRIPTION("OVS: GRE switching port");
>> >> MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
>> >> +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
>> >
>> > This is user visible change. For example this is changing the gre
>> > module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
>> > This could break userspace application.
>> 
>> Agreed, you really can't do this.
> 
> Hi David,
> Actually this change does not change module alias name. I use '__stringify'
> to 
> address this.  Please refer my previous reply.

Yep, I saw that, I waive my objection :-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-04  8:12   ` 张胜举
@ 2017-06-05  2:29     ` Pravin Shelar
  2017-06-05  9:59       ` 张胜举
  0 siblings, 1 reply; 8+ messages in thread
From: Pravin Shelar @ 2017-06-05  2:29 UTC (permalink / raw)
  To: 张胜举
  Cc: Pravin Shelar, Linux Kernel Network Developers, David S. Miller

On Sun, Jun 4, 2017 at 1:12 AM, 张胜举 <zhangshengju@cmss.chinamobile.com> wrote:
>> -----Original Message-----
>> From: Pravin Shelar [mailto:pshelar@ovn.org]
>> Sent: Sunday, June 04, 2017 1:58 PM
>> To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>> Cc: Pravin Shelar <pshelar@nicira.com>; Linux Kernel Network Developers
>> <netdev@vger.kernel.org>; David S. Miller <davem@davemloft.net>
>> Subject: Re: [net-next] openvswitch: add macro
>> MODULE_ALIAS_VPORT_TYPE for vport type alias
>>
>> On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
>> <zhangshengju@cmss.chinamobile.com> wrote:
>> > Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify the
>> > declaration of vport type alias, and replace magic numbers with
>> > symbolic constants.
>> >
>> > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>> > ---
>> >  net/openvswitch/vport-geneve.c | 2 +-
>> >  net/openvswitch/vport-gre.c    | 2 +-
>> >  net/openvswitch/vport-vxlan.c  | 2 +-
>> >  net/openvswitch/vport.h        | 3 +++
>> >  4 files changed, 6 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/net/openvswitch/vport-geneve.c
>> > b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
>> > --- a/net/openvswitch/vport-geneve.c
>> > +++ b/net/openvswitch/vport-geneve.c
>> > @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
>> >
>> >  MODULE_DESCRIPTION("OVS: Geneve switching port");
>> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
>> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
>> > diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
>> > index 0e72d95..48a5852 100644
>> > --- a/net/openvswitch/vport-gre.c
>> > +++ b/net/openvswitch/vport-gre.c
>> > @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
>> >
>> >  MODULE_DESCRIPTION("OVS: GRE switching port");
>> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
>> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
>>
>> This is user visible change. For example this is changing the gre
>> module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
>> This could break userspace application.
> Hi Shelar,
> Actually this change does not change module alias name. I use '__stringify' to
> address this.  Below is my build result:
> ```
> [zhangshengju@promote net-next]$ modinfo net/openvswitch/vport-gre.ko
> filename:       /gitlab/net-next/net/openvswitch/vport-gre.ko
> alias:          vport-type-3
> ...
> ```

Yes, I expected this. But when I tried modinfo with your patch, I did
not see it. here is modinfo output from my setup.
---8<---
root@ubuntu:/home/pravin/linux/net-next# modinfo net/openvswitch/vport-gre.ko
filename:       /home/pravin/linux/net-next/./net/openvswitch/vport-gre.ko
alias:          vport-type-OVS_VPORT_TYPE_GRE
license:        GPL
description:    OVS: GRE switching port
srcversion:     AD3B4449820F294E0B5681C
depends:        openvswitch
intree:         Y
vermagic:       4.12.0-rc2+ SMP mod_unload modversions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias
  2017-06-05  2:29     ` Pravin Shelar
@ 2017-06-05  9:59       ` 张胜举
  0 siblings, 0 replies; 8+ messages in thread
From: 张胜举 @ 2017-06-05  9:59 UTC (permalink / raw)
  To: 'Pravin Shelar'
  Cc: 'Pravin Shelar',
	'Linux Kernel Network Developers',
	'David S. Miller'

> -----Original Message-----
> From: Pravin Shelar [mailto:pshelar@ovn.org]
> Sent: Monday, June 05, 2017 10:30 AM
> To: 张胜举 <zhangshengju@cmss.chinamobile.com>
> Cc: Pravin Shelar <pshelar@nicira.com>; Linux Kernel Network Developers
> <netdev@vger.kernel.org>; David S. Miller <davem@davemloft.net>
> Subject: Re: [net-next] openvswitch: add macro
> MODULE_ALIAS_VPORT_TYPE for vport type alias
> 
> On Sun, Jun 4, 2017 at 1:12 AM, 张胜举
> <zhangshengju@cmss.chinamobile.com> wrote:
> >> -----Original Message-----
> >> From: Pravin Shelar [mailto:pshelar@ovn.org]
> >> Sent: Sunday, June 04, 2017 1:58 PM
> >> To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> >> Cc: Pravin Shelar <pshelar@nicira.com>; Linux Kernel Network
> >> Developers <netdev@vger.kernel.org>; David S. Miller
> >> <davem@davemloft.net>
> >> Subject: Re: [net-next] openvswitch: add macro
> >> MODULE_ALIAS_VPORT_TYPE for vport type alias
> >>
> >> On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
> >> <zhangshengju@cmss.chinamobile.com> wrote:
> >> > Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify
> the
> >> > declaration of vport type alias, and replace magic numbers with
> >> > symbolic constants.
> >> >
> >> > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> >> > ---
> >> >  net/openvswitch/vport-geneve.c | 2 +-
> >> >  net/openvswitch/vport-gre.c    | 2 +-
> >> >  net/openvswitch/vport-vxlan.c  | 2 +-
> >> >  net/openvswitch/vport.h        | 3 +++
> >> >  4 files changed, 6 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/net/openvswitch/vport-geneve.c
> >> > b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
> >> > --- a/net/openvswitch/vport-geneve.c
> >> > +++ b/net/openvswitch/vport-geneve.c
> >> > @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
> >> >
> >> >  MODULE_DESCRIPTION("OVS: Geneve switching port");
> >> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
> >> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
> >> > diff --git a/net/openvswitch/vport-gre.c
> >> > b/net/openvswitch/vport-gre.c index 0e72d95..48a5852 100644
> >> > --- a/net/openvswitch/vport-gre.c
> >> > +++ b/net/openvswitch/vport-gre.c
> >> > @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
> >> >
> >> >  MODULE_DESCRIPTION("OVS: GRE switching port");
> >> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
> >> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
> >>
> >> This is user visible change. For example this is changing the gre
> >> module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
> >> This could break userspace application.
> > Hi Shelar,
> > Actually this change does not change module alias name. I use
> > '__stringify' to address this.  Below is my build result:
> > ```
> > [zhangshengju@promote net-next]$ modinfo net/openvswitch/vport-
> gre.ko
> > filename:       /gitlab/net-next/net/openvswitch/vport-gre.ko
> > alias:          vport-type-3
> > ...
> > ```
> 
> Yes, I expected this. But when I tried modinfo with your patch, I did not see it.
> here is modinfo output from my setup.
> ---8<---
> root@ubuntu:/home/pravin/linux/net-next# modinfo
> net/openvswitch/vport-gre.ko
> filename:       /home/pravin/linux/net-next/./net/openvswitch/vport-gre.ko
> alias:          vport-type-OVS_VPORT_TYPE_GRE
> license:        GPL
> description:    OVS: GRE switching port
> srcversion:     AD3B4449820F294E0B5681C
> depends:        openvswitch
> intree:         Y
> vermagic:       4.12.0-rc2+ SMP mod_unload modversions
Oh, I'm sorry. You are right, it seems ' OVS_VPORT_TYPE_GRE' doesn't expand. 
Maybe I can send another version to use magic number, such as:
MODULE_ALIAS_VPORT_TYPE(3);

Is this okay for you?

BRs,
Zhang Shengju.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-05  9:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-03 13:47 [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias Zhang Shengju
2017-06-04  5:58 ` Pravin Shelar
2017-06-04  8:12   ` 张胜举
2017-06-05  2:29     ` Pravin Shelar
2017-06-05  9:59       ` 张胜举
2017-06-04 20:12   ` David Miller
2017-06-05  1:10     ` 张胜举
2017-06-05  1:25       ` David Miller

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.