diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 0506770341af..57c83f05fead 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1856,7 +1856,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) /* Set up our datapath device. */ parms.name = nla_data(a[OVS_DP_ATTR_NAME]); parms.type = OVS_VPORT_TYPE_INTERNAL; - parms.options = NULL; parms.dp = dp; parms.port_no = OVSP_LOCAL; parms.upcall_portids = a[OVS_DP_ATTR_UPCALL_PID]; @@ -2172,10 +2171,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, if (ovs_vport_get_upcall_portids(vport, skb)) goto nla_put_failure; - err = ovs_vport_get_options(vport, skb); - if (err == -EMSGSIZE) - goto error; - genlmsg_end(skb, ovs_header); return 0; @@ -2183,7 +2178,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, rcu_read_unlock(); nla_put_failure: err = -EMSGSIZE; -error: genlmsg_cancel(skb, ovs_header); return err; } @@ -2210,10 +2204,6 @@ static size_t ovs_vport_cmd_msg_size(void) /* OVS_VPORT_ATTR_UPCALL_PID */ msgsize += nla_total_size(nr_cpu_ids * sizeof(u32)); - /* There are no vports supporting OVS_VPORT_ATTR_OPTIONS, so it is - * not included in the message size calculation. - */ - return msgsize; } @@ -2365,7 +2355,6 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) } parms.name = nla_data(a[OVS_VPORT_ATTR_NAME]); - parms.options = a[OVS_VPORT_ATTR_OPTIONS]; parms.dp = dp; parms.port_no = port_no; parms.upcall_portids = a[OVS_VPORT_ATTR_UPCALL_PID]; @@ -2427,12 +2416,11 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) } if (a[OVS_VPORT_ATTR_OPTIONS]) { - err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]); - if (err) - goto exit_unlock_free; + /* There are no vport types that support legacy options. */ + err = -EOPNOTSUPP; + goto exit_unlock_free; } - if (a[OVS_VPORT_ATTR_UPCALL_PID]) { struct nlattr *ids = a[OVS_VPORT_ATTR_UPCALL_PID]; @@ -2606,7 +2594,7 @@ static const struct nla_policy vport_policy[OVS_VPORT_ATTR_MAX + 1] = { [OVS_VPORT_ATTR_PORT_NO] = { .type = NLA_U32 }, [OVS_VPORT_ATTR_TYPE] = { .type = NLA_U32 }, [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NLA_UNSPEC }, - [OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED }, + [OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED }, /* Unused. */ [OVS_VPORT_ATTR_IFINDEX] = NLA_POLICY_MIN(NLA_S32, 0), [OVS_VPORT_ATTR_NETNSID] = { .type = NLA_S32 }, [OVS_VPORT_ATTR_UPCALL_STATS] = { .type = NLA_NESTED }, diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 12741485c939..ada316a61726 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -239,22 +239,6 @@ struct vport *ovs_vport_add(const struct vport_parms *parms) return ERR_PTR(-EAGAIN); } -/** - * ovs_vport_set_options - modify existing vport device (for kernel callers) - * - * @vport: vport to modify. - * @options: New configuration. - * - * Modifies an existing device with the specified configuration (which is - * dependent on device type). ovs_mutex must be held. - */ -int ovs_vport_set_options(struct vport *vport, struct nlattr *options) -{ - if (!vport->ops->set_options) - return -EOPNOTSUPP; - return vport->ops->set_options(vport, options); -} - /** * ovs_vport_del - delete existing vport device * @@ -348,44 +332,6 @@ int ovs_vport_get_upcall_stats(struct vport *vport, struct sk_buff *skb) return 0; } -/** - * ovs_vport_get_options - retrieve device options - * - * @vport: vport from which to retrieve the options. - * @skb: sk_buff where options should be appended. - * - * Retrieves the configuration of the given device, appending an - * %OVS_VPORT_ATTR_OPTIONS attribute that in turn contains nested - * vport-specific attributes to @skb. - * - * Returns 0 if successful, -EMSGSIZE if @skb has insufficient room, or another - * negative error code if a real error occurred. If an error occurs, @skb is - * left unmodified. - * - * Must be called with ovs_mutex or rcu_read_lock. - */ -int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb) -{ - struct nlattr *nla; - int err; - - if (!vport->ops->get_options) - return 0; - - nla = nla_nest_start_noflag(skb, OVS_VPORT_ATTR_OPTIONS); - if (!nla) - return -EMSGSIZE; - - err = vport->ops->get_options(vport, skb); - if (err) { - nla_nest_cancel(skb, nla); - return err; - } - - nla_nest_end(skb, nla); - return 0; -} - /** * ovs_vport_set_upcall_portids - set upcall portids of @vport. * diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index 9f67b9dd49f9..636788b59907 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -34,9 +34,6 @@ void ovs_vport_get_stats(struct vport *, struct ovs_vport_stats *); int ovs_vport_get_upcall_stats(struct vport *vport, struct sk_buff *skb); -int ovs_vport_set_options(struct vport *, struct nlattr *options); -int ovs_vport_get_options(const struct vport *, struct sk_buff *); - int ovs_vport_set_upcall_portids(struct vport *, const struct nlattr *pids); int ovs_vport_get_upcall_portids(const struct vport *, struct sk_buff *); u32 ovs_vport_find_upcall_portid(const struct vport *, struct sk_buff *); @@ -92,8 +89,6 @@ struct vport { * * @name: New vport's name. * @type: New vport's type. - * @options: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL if - * none was supplied. * @desired_ifindex: New vport's ifindex. * @dp: New vport's datapath. * @port_no: New vport's port number. @@ -104,7 +99,6 @@ struct vport_parms { const char *name; enum ovs_vport_type type; int desired_ifindex; - struct nlattr *options; /* For ovs_vport_alloc(). */ struct datapath *dp; @@ -120,11 +114,6 @@ struct vport_parms { * a new vport allocated with ovs_vport_alloc(), otherwise an ERR_PTR() value. * @destroy: Destroys a vport. Must call vport_free() on the vport but not * before an RCU grace period has elapsed. - * @set_options: Modify the configuration of an existing vport. May be %NULL - * if modification is not supported. - * @get_options: Appends vport-specific attributes for the configuration of an - * existing vport to a &struct sk_buff. May be %NULL for a vport that does not - * have any configuration. * @send: Send a packet on the device. * zero for dropped packets or negative for error. * @owner: Module that implements this vport type. @@ -137,9 +126,6 @@ struct vport_ops { struct vport *(*create)(const struct vport_parms *); void (*destroy)(struct vport *); - int (*set_options)(struct vport *, struct nlattr *); - int (*get_options)(const struct vport *, struct sk_buff *); - int (*send)(struct sk_buff *skb); struct module *owner; struct list_head list;