From: Tom Gundersen <teg@jklm.no>
To: netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, Tom Gundersen <teg@jklm.no>,
Jay Vosburgh <j.vosburgh@gmail.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>
Subject: [PATCH net-next v9 5/9] net: bond - make bond_create take name_assign_type
Date: Thu, 17 Jul 2014 10:06:06 +0200 [thread overview]
Message-ID: <1405584370-30054-6-git-send-email-teg@jklm.no> (raw)
In-Reply-To: <1405584370-30054-1-git-send-email-teg@jklm.no>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
---
drivers/net/bonding/bond_main.c | 7 ++++---
drivers/net/bonding/bond_sysfs.c | 2 +-
drivers/net/bonding/bonding.h | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d643807..1769745 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4421,7 +4421,7 @@ unsigned int bond_get_num_tx_queues(void)
* Caller must NOT hold rtnl_lock; we need to release it here before we
* set up our sysfs entries.
*/
-int bond_create(struct net *net, const char *name)
+int bond_create(struct net *net, const char *name, unsigned char name_assign_type)
{
struct net_device *bond_dev;
int res;
@@ -4429,7 +4429,8 @@ int bond_create(struct net *net, const char *name)
rtnl_lock();
bond_dev = alloc_netdev_mq(sizeof(struct bonding),
- name ? name : "bond%d", NET_NAME_UNKNOWN,
+ name ? name : "bond%d",
+ name ? name_assign_type : NET_NAME_ENUM,
bond_setup, tx_queues);
if (!bond_dev) {
pr_err("%s: eek! can't alloc netdev!\n", name);
@@ -4509,7 +4510,7 @@ static int __init bonding_init(void)
bond_create_debugfs();
for (i = 0; i < max_bonds; i++) {
- res = bond_create(&init_net, NULL);
+ res = bond_create(&init_net, NULL, NET_NAME_UNKNOWN);
if (res)
goto err;
}
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 98db8ed..7ac498c 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -111,7 +111,7 @@ static ssize_t bonding_store_bonds(struct class *cls,
if (command[0] == '+') {
pr_info("%s is being created...\n", ifname);
- rv = bond_create(bn->net, ifname);
+ rv = bond_create(bn->net, ifname, NET_NAME_USER);
if (rv) {
if (rv == -EEXIST)
pr_info("%s already exists\n", ifname);
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index b2e548e..95b5e70 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -496,7 +496,7 @@ struct bond_net {
int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
void bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
-int bond_create(struct net *net, const char *name);
+int bond_create(struct net *net, const char *name, unsigned char name_assign_type);
int bond_create_sysfs(struct bond_net *net);
void bond_destroy_sysfs(struct bond_net *net);
void bond_prepare_sysfs_group(struct bonding *bond);
--
1.9.3
next prev parent reply other threads:[~2014-07-17 8:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 8:06 [PATCH net-next v9 0/9] net: set the correct name_assign_type for more devices Tom Gundersen
2014-07-17 8:06 ` [PATCH net-next v9 1/9] net: set name assign type for names assigned using a static string Tom Gundersen
2014-07-17 8:06 ` [PATCH net-next v9 2/9] net: nl80211 - make rdev_add_virtual_intf take name_assign_type Tom Gundersen
2014-07-17 9:04 ` Johannes Berg
2014-07-17 9:16 ` Tom Gundersen
2014-07-17 9:23 ` Johannes Berg
2014-07-17 8:06 ` [PATCH net-next v9 3/9] net: nl802154 - make add_iface take name assign type Tom Gundersen
2014-07-17 23:19 ` David Miller
2014-07-18 8:18 ` [Linux-zigbee-devel] " Alexander Aring
2014-07-18 8:29 ` David Laight
2014-07-18 8:41 ` Tom Gundersen
2014-07-17 8:06 ` [PATCH net-next v9 4/9] net: set name_assign_type when setting names via ioctls Tom Gundersen
2014-07-17 23:20 ` David Miller
2014-07-18 8:59 ` Tom Gundersen
2014-07-17 8:06 ` Tom Gundersen [this message]
2014-07-17 8:06 ` [PATCH net-next v9 6/9] net: isdn - set name assign type Tom Gundersen
2014-07-17 8:06 ` [PATCH net-next v9 7/9] net: vlan " Tom Gundersen
2014-07-17 8:06 ` [PATCH net-next v9 8/9] net: openvswitch " Tom Gundersen
2014-07-17 18:22 ` Pravin Shelar
2014-07-17 8:06 ` [PATCH net-next v9 9/9] net: ppp " Tom Gundersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405584370-30054-6-git-send-email-teg@jklm.no \
--to=teg@jklm.no \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=j.vosburgh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®