* [PATCH net-next] openvswitch: make generic netlink group const
@ 2014-07-16 18:25 Stephen Hemminger
2014-07-17 0:02 ` Pravin Shelar
2014-07-17 6:41 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2014-07-16 18:25 UTC (permalink / raw)
To: Pravin Shelar, David Miller; +Cc: dev, netdev
Generic netlink tables can be const.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/openvswitch/datapath.c 2014-07-09 03:06:11.400291765 -0700
+++ b/net/openvswitch/datapath.c 2014-07-09 03:09:35.688297236 -0700
@@ -66,16 +66,16 @@ static struct genl_family dp_packet_genl
static struct genl_family dp_flow_genl_family;
static struct genl_family dp_datapath_genl_family;
-static struct genl_multicast_group ovs_dp_flow_multicast_group = {
- .name = OVS_FLOW_MCGROUP
+static const struct genl_multicast_group ovs_dp_flow_multicast_group = {
+ .name = OVS_FLOW_MCGROUP,
};
-static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
- .name = OVS_DATAPATH_MCGROUP
+static const struct genl_multicast_group ovs_dp_datapath_multicast_group = {
+ .name = OVS_DATAPATH_MCGROUP,
};
-struct genl_multicast_group ovs_dp_vport_multicast_group = {
- .name = OVS_VPORT_MCGROUP
+static const struct genl_multicast_group ovs_dp_vport_multicast_group = {
+ .name = OVS_VPORT_MCGROUP,
};
/* Check if need to build a reply message.
@@ -1190,7 +1190,7 @@ static const struct nla_policy flow_poli
[OVS_FLOW_ATTR_CLEAR] = { .type = NLA_FLAG },
};
-static struct genl_ops dp_flow_genl_ops[] = {
+static const struct genl_ops dp_flow_genl_ops[] = {
{ .cmd = OVS_FLOW_CMD_NEW,
.flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
.policy = flow_policy,
@@ -1578,7 +1578,7 @@ static const struct nla_policy datapath_
[OVS_DP_ATTR_USER_FEATURES] = { .type = NLA_U32 },
};
-static struct genl_ops dp_datapath_genl_ops[] = {
+static const struct genl_ops dp_datapath_genl_ops[] = {
{ .cmd = OVS_DP_CMD_NEW,
.flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
.policy = datapath_policy,
@@ -1945,7 +1945,7 @@ static const struct nla_policy vport_pol
[OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED },
};
-static struct genl_ops dp_vport_genl_ops[] = {
+static const struct genl_ops dp_vport_genl_ops[] = {
{ .cmd = OVS_VPORT_CMD_NEW,
.flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
.policy = vport_policy,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] openvswitch: make generic netlink group const
2014-07-16 18:25 [PATCH net-next] openvswitch: make generic netlink group const Stephen Hemminger
@ 2014-07-17 0:02 ` Pravin Shelar
2014-07-17 6:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Pravin Shelar @ 2014-07-17 0:02 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev, David Miller
On Wed, Jul 16, 2014 at 11:25 AM, Stephen Hemminger
<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org> wrote:
> Generic netlink tables can be const.
>
OVS external module can not use const due to compatibility code. But
there is no reason we can not do it for in-kernel module.
Thanks.
> Signed-off-by: Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
>
>
> --- a/net/openvswitch/datapath.c 2014-07-09 03:06:11.400291765 -0700
> +++ b/net/openvswitch/datapath.c 2014-07-09 03:09:35.688297236 -0700
> @@ -66,16 +66,16 @@ static struct genl_family dp_packet_genl
> static struct genl_family dp_flow_genl_family;
> static struct genl_family dp_datapath_genl_family;
>
> -static struct genl_multicast_group ovs_dp_flow_multicast_group = {
> - .name = OVS_FLOW_MCGROUP
> +static const struct genl_multicast_group ovs_dp_flow_multicast_group = {
> + .name = OVS_FLOW_MCGROUP,
> };
>
> -static struct genl_multicast_group ovs_dp_datapath_multicast_group = {
> - .name = OVS_DATAPATH_MCGROUP
> +static const struct genl_multicast_group ovs_dp_datapath_multicast_group = {
> + .name = OVS_DATAPATH_MCGROUP,
> };
>
> -struct genl_multicast_group ovs_dp_vport_multicast_group = {
> - .name = OVS_VPORT_MCGROUP
> +static const struct genl_multicast_group ovs_dp_vport_multicast_group = {
> + .name = OVS_VPORT_MCGROUP,
> };
>
> /* Check if need to build a reply message.
> @@ -1190,7 +1190,7 @@ static const struct nla_policy flow_poli
> [OVS_FLOW_ATTR_CLEAR] = { .type = NLA_FLAG },
> };
>
> -static struct genl_ops dp_flow_genl_ops[] = {
> +static const struct genl_ops dp_flow_genl_ops[] = {
> { .cmd = OVS_FLOW_CMD_NEW,
> .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
> .policy = flow_policy,
> @@ -1578,7 +1578,7 @@ static const struct nla_policy datapath_
> [OVS_DP_ATTR_USER_FEATURES] = { .type = NLA_U32 },
> };
>
> -static struct genl_ops dp_datapath_genl_ops[] = {
> +static const struct genl_ops dp_datapath_genl_ops[] = {
> { .cmd = OVS_DP_CMD_NEW,
> .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
> .policy = datapath_policy,
> @@ -1945,7 +1945,7 @@ static const struct nla_policy vport_pol
> [OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED },
> };
>
> -static struct genl_ops dp_vport_genl_ops[] = {
> +static const struct genl_ops dp_vport_genl_ops[] = {
> { .cmd = OVS_VPORT_CMD_NEW,
> .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */
> .policy = vport_policy,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] openvswitch: make generic netlink group const
2014-07-16 18:25 [PATCH net-next] openvswitch: make generic netlink group const Stephen Hemminger
2014-07-17 0:02 ` Pravin Shelar
@ 2014-07-17 6:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-07-17 6:41 UTC (permalink / raw)
To: stephen; +Cc: pshelar, dev, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 16 Jul 2014 11:25:52 -0700
> Generic netlink tables can be const.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied, thanks Stephen.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-17 6:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 18:25 [PATCH net-next] openvswitch: make generic netlink group const Stephen Hemminger
2014-07-17 0:02 ` Pravin Shelar
2014-07-17 6:41 ` 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.