From patchwork Wed Jul 16 22:43:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Gundersen X-Patchwork-Id: 370896 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 59A24140093 for ; Thu, 17 Jul 2014 08:44:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754646AbaGPWoc (ORCPT ); Wed, 16 Jul 2014 18:44:32 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:45812 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754582AbaGPWo3 (ORCPT ); Wed, 16 Jul 2014 18:44:29 -0400 Received: by mail-lb0-f182.google.com with SMTP id z11so1107715lbi.41 for ; Wed, 16 Jul 2014 15:44:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6Kf3SehMgFaa9B/zROSWqW4aF3SI232LKCT+EvuwBJ8=; b=Nn3c9coX+ls0BFhNHHh6SWKwvnlhczFqI/O5qG8sngMRfRm3IdaNCH8yDpliu/OceX yDPzwkXJZsg7r0tPSp9y46YqaGrRGmgHaCMOxNpXK7KIzfzNwSxTApSe/zXej7fWCTGq UzioHRI1ZOax7+c20zpKbhOcae4KNkyNnAfBeHTGzEbUbYo/Pcpd3+1aJ30wZW6tECkw kDL2k+vZBzhpmf2WoG+MbtX2kZtD4vTotvGqk+sp1BaKHd5IYlAy9B8yPSmadLFoMMJD knzNP9FkkSDQZk2xEWLABzou20vynmTMUqr9M7quDka+8mQe0DH79UqeP6wlZh1eG69O AGLA== X-Gm-Message-State: ALoCoQkQiBJtPCOraCAJVeSPImISFS72qt01qzmlczbhDrwrzLGTkOiAM3W4IeYL8KaKz0rU0YoC X-Received: by 10.112.138.36 with SMTP id qn4mr10727589lbb.74.1405550668709; Wed, 16 Jul 2014 15:44:28 -0700 (PDT) Received: from tomegun-x240.localdomain (cm-84.208.72.173.getinternet.no. [84.208.72.173]) by mx.google.com with ESMTPSA id jf10sm14720lac.26.2014.07.16.15.44.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jul 2014 15:44:27 -0700 (PDT) From: Tom Gundersen To: netdev@vger.kernel.org Cc: David Miller , linux-kernel@vger.kernel.org, Tom Gundersen , Pravin Shelar , dev@openvswitch.org Subject: [PATCH v8] net: openvswitch - set name assign type Date: Thu, 17 Jul 2014 00:43:10 +0200 Message-Id: <1405550594-11786-3-git-send-email-teg@jklm.no> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1405550594-11786-1-git-send-email-teg@jklm.no> References: <1405550594-11786-1-git-send-email-teg@jklm.no> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Tom Gundersen Cc: Pravin Shelar Cc: dev@openvswitch.org --- This patch goes on top of net-next. net/openvswitch/datapath.c | 1 + net/openvswitch/vport-internal_dev.c | 2 +- net/openvswitch/vport.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index fe95b6c..c1400c0 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1370,6 +1370,7 @@ 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.name_assign_type = NET_NAME_USER; parms.type = OVS_VPORT_TYPE_INTERNAL; parms.options = NULL; parms.dp = dp; diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index bd65855..df185a7 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c @@ -165,7 +165,7 @@ static struct vport *internal_dev_create(const struct vport_parms *parms) netdev_vport = netdev_vport_priv(vport); netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev), - parms->name, NET_NAME_UNKNOWN, + parms->name, parms->name_assign_type, do_setup); if (!netdev_vport->dev) { err = -ENOMEM; diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index 8d721e6..a9d7480 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -97,6 +97,7 @@ struct vport { * struct vport_parms - parameters for creating a new vport * * @name: New vport's name. + * @name_assign_type: New vport's name's origin. * @type: New vport's type. * @options: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL if * none was supplied. @@ -105,6 +106,7 @@ struct vport { */ struct vport_parms { const char *name; + unsigned char name_assign_type; enum ovs_vport_type type; struct nlattr *options;