[ovs-dev] [PATCHv2] datapath: Return vport configuration when queried.

Jesse Gross jesse at nicira.com
Thu Dec 23 09:41:51 UTC 2010


On Wed, Dec 22, 2010 at 8:32 PM, Justin Pettit <jpettit at nicira.com> wrote:
> @@ -95,7 +95,7 @@ static int set_config(struct vport *vport, const void *config)
>        if (!strcmp(patch_vport->name, peer_name))
>                return -EINVAL;
>
> -       strcpy(patch_vport->peer_name, peer_name);
> +       strcpy(patch_vport->devconf->peer_name, peer_name);

You can't do in-place updates of RCU protected data.  You'll have to
allocate a new copy, make the change, and use assign_config_rcu(),
similar to patch_set_mtu().

> @@ -150,10 +154,12 @@ static int patch_modify(struct vport *vport, struct odp_port *port)
>        int err = set_config(vport, port->config);
>        if (!err) {
>                struct patch_vport *patch_vport = patch_vport_priv(vport);
> -
> +               const char *peer_name = patch_vport->devconf->peer_name;

In the places where you've added accesses to devconf, you need to use
rtnl_dereference(), since all of these places hold RTNL lock.




More information about the dev mailing list