* [PATCH net-next v4 09/13] bonding: use vlan_uses_dev() in __bond_release_one()
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
We always hold the rtnl_lock() in __bond_release_one(), so use
vlan_uses_dev() instead of bond_vlan_used().
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: no change
v2: no change
v3: no change
v4: no change
drivers/net/bonding/bond_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f38d590..55a48d3 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1954,7 +1954,7 @@ static int __bond_release_one(struct net_device *bond_dev,
bond_set_carrier(bond);
eth_hw_addr_random(bond_dev);
- if (bond_vlan_used(bond)) {
+ if (vlan_uses_dev(bond_dev)) {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
bond_dev->name, bond_dev->name);
pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
--
1.8.4
^ permalink raw reply related
* [PATCH net-next v4 08/13] bonding: convert bond_has_this_ip() to use upper devices
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
Currently, bond_has_this_ip() is aware only of vlan upper devices, and thus
will return false if the address is associated with the upper bridge or any
other device, and thus will break the arp logic.
Fix this by using the upper device list. For every upper device we verify
if the address associated with it is our address, and if yes - return true.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: use netdev_for_each_upper_dev()
v2: use netdev_for_each_upper_dev_rcu()
v3: no change
v4: no change
drivers/net/bonding/bond_main.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 28f4ad0..f38d590 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2392,24 +2392,25 @@ re_arm:
}
}
-static int bond_has_this_ip(struct bonding *bond, __be32 ip)
+static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
{
- struct vlan_entry *vlan;
- struct net_device *vlan_dev;
+ struct net_device *upper;
+ struct list_head *iter;
+ bool ret = false;
if (ip == bond_confirm_addr(bond->dev, 0, ip))
- return 1;
+ return true;
- list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
- rcu_read_lock();
- vlan_dev = __vlan_find_dev_deep(bond->dev, htons(ETH_P_8021Q),
- vlan->vlan_id);
- rcu_read_unlock();
- if (vlan_dev && ip == bond_confirm_addr(vlan_dev, 0, ip))
- return 1;
+ rcu_read_lock();
+ netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
+ if (ip == bond_confirm_addr(upper, 0, ip)) {
+ ret = true;
+ break;
+ }
}
+ rcu_read_unlock();
- return 0;
+ return ret;
}
/*
--
1.8.4
^ permalink raw reply related
* [PATCH net-next v4 10/13] bonding: split alb_send_learning_packets()
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
Create alb_send_lp_vid(), which will handle the skb/lp creation, vlan
tagging and sending, and use it in alb_send_learning_packets().
This way all the logic remains in alb_send_learning_packets(), which
becomes a lot more cleaner and easier to understand.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: no change
v2: no change
v3: no change
v4: no change
drivers/net/bonding/bond_alb.c | 59 +++++++++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 24 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 3a5db7b..3ca3c85 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -971,35 +971,53 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
/*********************** tlb/rlb shared functions *********************/
-static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
+static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
+ u16 vid)
{
- struct bonding *bond = bond_get_bond_by_slave(slave);
struct learning_pkt pkt;
+ struct sk_buff *skb;
int size = sizeof(struct learning_pkt);
- int i;
+ char *data;
memset(&pkt, 0, size);
memcpy(pkt.mac_dst, mac_addr, ETH_ALEN);
memcpy(pkt.mac_src, mac_addr, ETH_ALEN);
pkt.type = cpu_to_be16(ETH_P_LOOP);
- for (i = 0; i < MAX_LP_BURST; i++) {
- struct sk_buff *skb;
- char *data;
+ skb = dev_alloc_skb(size);
+ if (!skb)
+ return;
- skb = dev_alloc_skb(size);
+ data = skb_put(skb, size);
+ memcpy(data, &pkt, size);
+
+ skb_reset_mac_header(skb);
+ skb->network_header = skb->mac_header + ETH_HLEN;
+ skb->protocol = pkt.type;
+ skb->priority = TC_PRIO_CONTROL;
+ skb->dev = slave->dev;
+
+ if (vid) {
+ skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vid);
if (!skb) {
+ pr_err("%s: Error: failed to insert VLAN tag\n",
+ slave->bond->dev->name);
return;
}
+ }
- data = skb_put(skb, size);
- memcpy(data, &pkt, size);
+ dev_queue_xmit(skb);
+}
- skb_reset_mac_header(skb);
- skb->network_header = skb->mac_header + ETH_HLEN;
- skb->protocol = pkt.type;
- skb->priority = TC_PRIO_CONTROL;
- skb->dev = slave->dev;
+
+static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
+{
+ struct bonding *bond = bond_get_bond_by_slave(slave);
+ u16 vlan_id;
+ int i;
+
+ for (i = 0; i < MAX_LP_BURST; i++) {
+ vlan_id = 0;
if (bond_vlan_used(bond)) {
struct vlan_entry *vlan;
@@ -1008,20 +1026,13 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
bond->alb_info.current_alb_vlan);
bond->alb_info.current_alb_vlan = vlan;
- if (!vlan) {
- kfree_skb(skb);
+ if (!vlan)
continue;
- }
- skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vlan->vlan_id);
- if (!skb) {
- pr_err("%s: Error: failed to insert VLAN tag\n",
- bond->dev->name);
- continue;
- }
+ vlan_id = vlan->vlan_id;
}
- dev_queue_xmit(skb);
+ alb_send_lp_vid(slave, mac_addr, vlan_id);
}
}
--
1.8.4
^ permalink raw reply related
* [PATCH net-next v4 11/13] bonding: make alb_send_learning_packets() use upper dev list
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
Currently, if there are vlans on top of bond, alb_send_learning_packets()
will never send LPs from the bond itself (i.e. untagged), which might leave
untagged clients unupdated.
Also, the 'circular vlan' logic (i.e. update only MAX_LP_BURST vlans at a
time, and save the last vlan for the next update) is really suboptimal - in
case of lots of vlans it will take a lot of time to update every vlan. It
is also never called in any hot path and sends only a few small packets -
thus the optimization by itself is useless.
So remove the whole current_alb_vlan/MAX_LP_BURST logic from
alb_send_learning_packets(). Instead, we'll first send a packet untagged
and then traverse the upper dev list, sending a tagged packet for each vlan
found. Also, remove the MAX_LP_BURST define - we already don't need it.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: use netdev_for_each_upper_dev()
v2: use netdev_for_each_upper_dev_rcu()
v3: no change
v4: no change
drivers/net/bonding/bond_alb.c | 29 +++++++++++------------------
drivers/net/bonding/bond_alb.h | 1 -
2 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 3ca3c85..b6a68b4 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1013,27 +1013,20 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
{
struct bonding *bond = bond_get_bond_by_slave(slave);
- u16 vlan_id;
- int i;
-
- for (i = 0; i < MAX_LP_BURST; i++) {
- vlan_id = 0;
-
- if (bond_vlan_used(bond)) {
- struct vlan_entry *vlan;
+ struct net_device *upper;
+ struct list_head *iter;
- vlan = bond_next_vlan(bond,
- bond->alb_info.current_alb_vlan);
-
- bond->alb_info.current_alb_vlan = vlan;
- if (!vlan)
- continue;
-
- vlan_id = vlan->vlan_id;
- }
+ /* send untagged */
+ alb_send_lp_vid(slave, mac_addr, 0);
- alb_send_lp_vid(slave, mac_addr, vlan_id);
+ /* loop through vlans and send one packet for each */
+ rcu_read_lock();
+ netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
+ if (upper->priv_flags & IFF_802_1Q_VLAN)
+ alb_send_lp_vid(slave, mac_addr,
+ vlan_dev_vlan_id(upper));
}
+ rcu_read_unlock();
}
static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
index e7a5b8b..e139172 100644
--- a/drivers/net/bonding/bond_alb.h
+++ b/drivers/net/bonding/bond_alb.h
@@ -53,7 +53,6 @@ struct slave;
#define TLB_NULL_INDEX 0xffffffff
-#define MAX_LP_BURST 3
/* rlb defs */
#define RLB_HASH_TABLE_SIZE 256
--
1.8.4
^ permalink raw reply related
* [PATCH net-next v4 12/13] bonding: remove vlan_list/current_alb_vlan
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
Currently there are no real users of vlan_list/current_alb_vlan, only the
helpers which maintain them, so remove them.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: no change
v2: no change
v3: no change
v4: no change
drivers/net/bonding/bond_alb.c | 5 --
drivers/net/bonding/bond_alb.h | 1 -
drivers/net/bonding/bond_main.c | 133 +---------------------------------------
drivers/net/bonding/bonding.h | 6 --
4 files changed, 2 insertions(+), 143 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b6a68b4..0182352 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1763,11 +1763,6 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
{
- if (bond->alb_info.current_alb_vlan &&
- (bond->alb_info.current_alb_vlan->vlan_id == vlan_id)) {
- bond->alb_info.current_alb_vlan = NULL;
- }
-
if (bond->alb_info.rlb_enabled) {
rlb_clear_vlan(bond, vlan_id);
}
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
index e139172..e02c9c5 100644
--- a/drivers/net/bonding/bond_alb.h
+++ b/drivers/net/bonding/bond_alb.h
@@ -169,7 +169,6 @@ struct alb_bond_info {
* rx traffic should be
* rebalanced
*/
- struct vlan_entry *current_alb_vlan;
};
int bond_alb_initialize(struct bonding *bond, int rlb_enabled);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 55a48d3..b87ad76 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -283,116 +283,6 @@ const char *bond_mode_name(int mode)
/*---------------------------------- VLAN -----------------------------------*/
/**
- * bond_add_vlan - add a new vlan id on bond
- * @bond: bond that got the notification
- * @vlan_id: the vlan id to add
- *
- * Returns -ENOMEM if allocation failed.
- */
-static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id)
-{
- struct vlan_entry *vlan;
-
- pr_debug("bond: %s, vlan id %d\n",
- (bond ? bond->dev->name : "None"), vlan_id);
-
- vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL);
- if (!vlan)
- return -ENOMEM;
-
- INIT_LIST_HEAD(&vlan->vlan_list);
- vlan->vlan_id = vlan_id;
-
- write_lock_bh(&bond->lock);
-
- list_add_tail(&vlan->vlan_list, &bond->vlan_list);
-
- write_unlock_bh(&bond->lock);
-
- pr_debug("added VLAN ID %d on bond %s\n", vlan_id, bond->dev->name);
-
- return 0;
-}
-
-/**
- * bond_del_vlan - delete a vlan id from bond
- * @bond: bond that got the notification
- * @vlan_id: the vlan id to delete
- *
- * returns -ENODEV if @vlan_id was not found in @bond.
- */
-static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
-{
- struct vlan_entry *vlan;
- int res = -ENODEV;
-
- pr_debug("bond: %s, vlan id %d\n", bond->dev->name, vlan_id);
-
- block_netpoll_tx();
- write_lock_bh(&bond->lock);
-
- list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
- if (vlan->vlan_id == vlan_id) {
- list_del(&vlan->vlan_list);
-
- if (bond_is_lb(bond))
- bond_alb_clear_vlan(bond, vlan_id);
-
- pr_debug("removed VLAN ID %d from bond %s\n",
- vlan_id, bond->dev->name);
-
- kfree(vlan);
-
- res = 0;
- goto out;
- }
- }
-
- pr_debug("couldn't find VLAN ID %d in bond %s\n",
- vlan_id, bond->dev->name);
-
-out:
- write_unlock_bh(&bond->lock);
- unblock_netpoll_tx();
- return res;
-}
-
-/**
- * bond_next_vlan - safely skip to the next item in the vlans list.
- * @bond: the bond we're working on
- * @curr: item we're advancing from
- *
- * Returns %NULL if list is empty, bond->next_vlan if @curr is %NULL,
- * or @curr->next otherwise (even if it is @curr itself again).
- *
- * Caller must hold bond->lock
- */
-struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
-{
- struct vlan_entry *next, *last;
-
- if (list_empty(&bond->vlan_list))
- return NULL;
-
- if (!curr) {
- next = list_entry(bond->vlan_list.next,
- struct vlan_entry, vlan_list);
- } else {
- last = list_entry(bond->vlan_list.prev,
- struct vlan_entry, vlan_list);
- if (last == curr) {
- next = list_entry(bond->vlan_list.next,
- struct vlan_entry, vlan_list);
- } else {
- next = list_entry(curr->vlan_list.next,
- struct vlan_entry, vlan_list);
- }
- }
-
- return next;
-}
-
-/**
* bond_dev_queue_xmit - Prepare skb for xmit.
*
* @bond: bond device that got this skb for tx.
@@ -451,13 +341,6 @@ static int bond_vlan_rx_add_vid(struct net_device *bond_dev,
goto unwind;
}
- res = bond_add_vlan(bond, vid);
- if (res) {
- pr_err("%s: Error: Failed to add vlan id %d\n",
- bond_dev->name, vid);
- goto unwind;
- }
-
return 0;
unwind:
@@ -478,17 +361,12 @@ static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
- int res;
bond_for_each_slave(bond, slave)
vlan_vid_del(slave->dev, proto, vid);
- res = bond_del_vlan(bond, vid);
- if (res) {
- pr_err("%s: Error: Failed to remove vlan id %d\n",
- bond_dev->name, vid);
- return res;
- }
+ if (bond_is_lb(bond))
+ bond_alb_clear_vlan(bond, vid);
return 0;
}
@@ -4143,7 +4021,6 @@ static void bond_setup(struct net_device *bond_dev)
/* Initialize pointers */
bond->dev = bond_dev;
- INIT_LIST_HEAD(&bond->vlan_list);
/* Initialize the device entry points */
ether_setup(bond_dev);
@@ -4196,7 +4073,6 @@ static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *tmp_slave;
- struct vlan_entry *vlan, *tmp;
bond_netpoll_cleanup(bond_dev);
@@ -4208,11 +4084,6 @@ static void bond_uninit(struct net_device *bond_dev)
list_del(&bond->bond_list);
bond_debug_unregister(bond);
-
- list_for_each_entry_safe(vlan, tmp, &bond->vlan_list, vlan_list) {
- list_del(&vlan->vlan_list);
- kfree(vlan);
- }
}
/*------------------------- Module initialization ---------------------------*/
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 230197d..4abc925 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -185,11 +185,6 @@ struct bond_parm_tbl {
#define BOND_MAX_MODENAME_LEN 20
-struct vlan_entry {
- struct list_head vlan_list;
- unsigned short vlan_id;
-};
-
struct slave {
struct net_device *dev; /* first - useful for panic debug */
struct list_head list;
@@ -254,7 +249,6 @@ struct bonding {
struct ad_bond_info ad_info;
struct alb_bond_info alb_info;
struct bond_params params;
- struct list_head vlan_list;
struct workqueue_struct *wq;
struct delayed_work mii_work;
struct delayed_work arp_work;
--
1.8.4
^ permalink raw reply related
* Re: [PATCH net-next v3 0/13] bonding: remove vlan special handling
From: Veaceslav Falico @ 2013-08-28 21:24 UTC (permalink / raw)
To: netdev
Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Eric Dumazet,
Jiri Pirko, Alexander Duyck, Cong Wang
In-Reply-To: <1377705842-8276-1-git-send-email-vfalico@redhat.com>
On Wed, Aug 28, 2013 at 06:03:49PM +0200, Veaceslav Falico wrote:
>v1: Per Jiri's advice, remove the exported netdev_upper struct to keep it
> inside dev.c only, and instead implement a macro to iterate over the
> list and return only net_device *.
>v2: Jiri noted that we need to see every upper device, but not only the
> first level. Modify the netdev_upper logic to include a list of lower
> devices and for both upper/lower lists every device would see both its
> first-level devices and every other devices that is lower/upper of it.
> Also, convert some annoying spamming warnings to pr_debug in
> bond_arp_send_all.
>v3: move renaming part completely to patch 1 (did I forget to git add
> before commiting?) and address Jiri's input about comments/style of
> patch 2.
Self-NAK for this patchset, sent the new version with a bug corrected.
Thanks all for the review.
^ permalink raw reply
* [PATCH net-next v4 06/13] bonding: use netdev_upper list in bond_vlan_used
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
Convert bond_vlan_used() to traverse the upper device list to see if we
have any vlans above us. It's protected by rcu, and in case we are holding
rtnl_lock we should call vlan_uses_dev() instead - it's faster.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v1: use netdev_for_each_upper_dev()
v2: use netdev_for_each_upper_dev_rcu()
v3: no change
v4: no change
drivers/net/bonding/bonding.h | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 4bf52d5..230197d 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -267,9 +267,22 @@ struct bonding {
#endif /* CONFIG_DEBUG_FS */
};
+/* if we hold rtnl_lock() - call vlan_uses_dev() */
static inline bool bond_vlan_used(struct bonding *bond)
{
- return !list_empty(&bond->vlan_list);
+ struct net_device *upper;
+ struct list_head *iter;
+
+ rcu_read_lock();
+ netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
+ if (upper->priv_flags & IFF_802_1Q_VLAN) {
+ rcu_read_unlock();
+ return true;
+ }
+ }
+ rcu_read_unlock();
+
+ return false;
}
#define bond_slave_get_rcu(dev) \
--
1.8.4
^ permalink raw reply related
* [PATCH net-next v4 13/13] bonding: pr_debug instead of pr_warn in bond_arp_send_all
From: Veaceslav Falico @ 2013-08-28 21:25 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1377725116-31126-1-git-send-email-vfalico@redhat.com>
They're simply annoying and will spam dmesg constantly if we hit them, so
convert to pr_debug so that we still can access them in case of debugging.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v2: new patch
v3: no change
v4: no change
drivers/net/bonding/bond_main.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b87ad76..c50679f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2336,10 +2336,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
rt = ip_route_output(dev_net(bond->dev), targets[i], 0,
RTO_ONLINK, 0);
if (IS_ERR(rt)) {
- if (net_ratelimit()) {
- pr_warning("%s: no route to arp_ip_target %pI4\n",
- bond->dev->name, &targets[i]);
- }
+ pr_debug("%s: no route to arp_ip_target %pI4\n",
+ bond->dev->name, &targets[i]);
continue;
}
@@ -2386,10 +2384,10 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
rcu_read_unlock();
/* Not our device - skip */
- if (net_ratelimit())
- pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
- bond->dev->name, &targets[i],
- rt->dst.dev ? rt->dst.dev->name : "NULL");
+ pr_debug("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
+ bond->dev->name, &targets[i],
+ rt->dst.dev ? rt->dst.dev->name : "NULL");
+
ip_rt_put(rt);
continue;
--
1.8.4
^ permalink raw reply related
* Re: [PATCH] USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700 Device Driver Support
From: David Miller @ 2013-08-28 21:43 UTC (permalink / raw)
To: liujunliang_ljl
Cc: horms, joe, romieu, gregkh, netdev, linux-usb, linux-kernel,
sunhecheng
In-Reply-To: <1377343560-10524-1-git-send-email-liujunliang_ljl@163.com>
From: liujunliang_ljl@163.com
Date: Sat, 24 Aug 2013 19:26:00 +0800
> From: liujl <liujunliang_ljl@163.com>
Your proper name is not "liujl", please put something more reasonable
here and also in your Signoff.
Also, integrate Joe Perches's white space fixes into this patch as part
of your resubmission.
Thank you.
^ permalink raw reply
* Re: [PATCH] net: stmmac: fixed the pbl setting with DT
From: David Miller @ 2013-08-28 21:44 UTC (permalink / raw)
To: bh74.an; +Cc: netdev, peppe.cavallaro, kgene.kim
In-Reply-To: <004f01cea093$9980e100$cc82a300$%an@samsung.com>
From: Byungho An <bh74.an@samsung.com>
Date: Sat, 24 Aug 2013 15:31:43 +0900
> This patch fixed the pbl(programmable burst length) setting
> using DT. Even though the default pbl is 8, If there is no
> pbl property in device tree file, pbl is set 0 and it causes
> bandwidth degradation.
>
> Signed-off-by: Byungho An <bh74.an@samsung.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net] net: add cpu_relax to busy poll loop
From: David Miller @ 2013-08-28 21:46 UTC (permalink / raw)
To: eliezer.tamir; +Cc: linux-kernel, netdev, eliezer
In-Reply-To: <20130825072346.31655.84970.stgit@ladj378.jer.intel.com>
From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Date: Sun, 25 Aug 2013 10:23:46 +0300
> Add a cpu_relaxt to sk_busy_loop.
>
> Julie Cummings reported performance issues when hyperthreading is on.
> Arjan van de Ven observed that we should have a cpu_relax() in the
> busy poll loop.
>
> Reported-by: Julie Cummings <julie.a.cummings@intel.com>
> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH 1/2] tcp: syncookies: reduce cookie lifetime to 128 seconds
From: David Miller @ 2013-08-28 22:20 UTC (permalink / raw)
To: fw; +Cc: netdev, jbohac
In-Reply-To: <1377453242-4773-1-git-send-email-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Sun, 25 Aug 2013 19:54:01 +0200
> We currently accept cookies that were created less than 4 minutes ago
> (ie, cookies with counter delta 0-3). Combined with the 8 mss table
> values, this yields 32 possible values (out of 2**32) that will be valid.
>
> Reducing the lifetime to < 2 minutes halves the guessing chance while
> still providing a large enough period (possible cookies are
> only validated if last synqueue overflow was less than 3 seconds ago).
>
> While at it, get rid of jiffies value -- they overflow too quickly on
> 32 bit platforms.
>
> getnstimeofday is used to create a counter that increments every 64s.
>
> Reported-by: Jakob Lell <jakob@jakoblell.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Moving from jiffies as a time seed to getnstimeofday() obviously will
have some performance impact, can you talk a little bit about that?
> +#define MAX_SYNCOOKIE_AGE 2 /* 128 seconds */
I'm sure you understand how 2 translates into 128 seconds in this syncookie
code, but I sure don't and the next person who reads this patch or this
code after I apply it may not either.
Could you in some way expose the calculation? Thanks.
^ permalink raw reply
* Re: [PATCH 2/2] tcp: syncookies: reduce mss table to four values
From: David Miller @ 2013-08-28 22:22 UTC (permalink / raw)
To: fw; +Cc: netdev, jbohac
In-Reply-To: <1377453242-4773-2-git-send-email-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Sun, 25 Aug 2013 19:54:02 +0200
> Halve mss table size to make blind cookie guessing more difficult.
> This is sad since the tables were already small, but there
> is little alternative except perhaps adding more precise mss information
> in the tcp timestamp. Timestamps are unfortunately not ubiquitous.
>
> Guessing all possible cookie values still has 8-in 2**32 chance.
>
> Reported-by: Jakob Lell <jakob@jakoblell.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
It seems you've decided to retain different sets of entries in these
two tables.
It is not at all obvious to me if this was intentional, and if so
then why such a choice was made.
Please clarify this.
Thank you.
^ permalink raw reply
* Re: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
From: David Miller @ 2013-08-28 22:23 UTC (permalink / raw)
To: robmatic; +Cc: netdev, linux-usb, bjorn, oliver
In-Reply-To: <20130825182913.2865aa1a8cefe329ab9c7a85@gmail.com>
From: Rob Gardner <robmatic@gmail.com>
Date: Sun, 25 Aug 2013 18:29:13 -0600
> From 018343ce2e679d97283fb51da25c43aa876d087a Mon Sep 17 00:00:00 2001
> From: Rob Gardner <robmatic@gmail.com>
> Date: Sun, 25 Aug 2013 16:02:23 -0600
> Subject: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
>
> This patch adds another entry (HP hs2434 Mobile Broadband) to the list
> of exceptional devices that require a zero length packet in order to
> function properly. This list was added in commit 844e88f0. The hs2434
> is manufactured by Sierra Wireless, who also produces the MC7710,
> which the ZLP exception list was created for in the first place. So
> hopefully it is just this one producer's devices that will need this
> workaround.
>
> Tested on a DM1-4310NR HP notebook, which does not function without this
> change.
>
> Signed-off-by: Rob Gardner <robmatic@gmail.com>
Applied and queued up for -tablt, thanks.
On the topic of dealing with detection of this issue, how harmful is the
workaround on chips that don't need it? Will the driver not work in that
case?
^ permalink raw reply
* Re: [PATCH] net: xilinx: fix memleak
From: David Miller @ 2013-08-28 22:25 UTC (permalink / raw)
To: clbchenlibo.chen; +Cc: anirudh, John.Linn, netdev, linux-kernel, lizefan
In-Reply-To: <521ACBEF.7020301@huawei.com>
From: Libo Chen <clbchenlibo.chen@huawei.com>
Date: Mon, 26 Aug 2013 11:30:55 +0800
>
> decrease device_node refcount np1 in err case.
>
> Signed-off-by: Libo Chen <libo.chen@huawei.com>
Applied, thank you.
^ permalink raw reply
* Good day
From: Cham Tao Soon @ 2013-08-28 22:05 UTC (permalink / raw)
To: netdev
Good day,
This is a personal email directed to you for your consideration alone, I request that it remain and be treated as such only. I am Mr. Cham Tao Soon, Chairman Audit Committee of UOB Bank, Singapore. I have an interesting business proposal for you that will be of immense benefit to both of us. Although this may be hard for you to believe, we stand to gain €105,000,000.00 EUR between us in a matter of days. Please grant me the benefit of doubt and hear me out. I need you to signify your interest by replying to this email.
Most importantly, I will need you to promise to keep whatever you learn from me between us even if you decide not to go along with me. I will make more details available to you on receipt of a positive response from you.
Greetings
Mr. Cham Tao Soon.
^ permalink raw reply
* Re: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
From: Rob Gardner @ 2013-08-28 23:18 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-usb, bjorn, oliver
In-Reply-To: <20130828.182332.824853790331642993.davem@davemloft.net>
On Wed, 28 Aug 2013 18:23:32 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: Rob Gardner <robmatic@gmail.com>
> Date: Sun, 25 Aug 2013 18:29:13 -0600
>
> > From 018343ce2e679d97283fb51da25c43aa876d087a Mon Sep 17 00:00:00 2001
> > From: Rob Gardner <robmatic@gmail.com>
> > Date: Sun, 25 Aug 2013 16:02:23 -0600
> > Subject: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
> >
> > This patch adds another entry (HP hs2434 Mobile Broadband) to the list
> > of exceptional devices that require a zero length packet in order to
> > function properly. This list was added in commit 844e88f0. The hs2434
> > is manufactured by Sierra Wireless, who also produces the MC7710,
> > which the ZLP exception list was created for in the first place. So
> > hopefully it is just this one producer's devices that will need this
> > workaround.
> >
> > Tested on a DM1-4310NR HP notebook, which does not function without this
> > change.
> >
> > Signed-off-by: Rob Gardner <robmatic@gmail.com>
>
> Applied and queued up for -tablt, thanks.
>
> On the topic of dealing with detection of this issue, how harmful is the
> workaround on chips that don't need it? Will the driver not work in that
> case?
Bjørn says it could have a minor performance impact, but should not
cause any loss of functionality. I don't think there's any hard data on
what the performance cost might be but I know he would eventually like
to get rid of the exception list and live with the possible performance
impact if it means functionality for more devices.
--
Rob Gardner <robmatic@gmail.com>
^ permalink raw reply
* Re: [PATCH net-next 1/1] net: neighbour: Simplify ifdefs around neigh_app_ns()
From: Eric W. Biederman @ 2013-08-28 23:36 UTC (permalink / raw)
To: Tim Gardner
Cc: netdev, linux-kernel, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, Gao feng,
Joe Perches
In-Reply-To: <1377714286-51816-1-git-send-email-tim.gardner@canonical.com>
Tim Gardner <tim.gardner@canonical.com> writes:
> Drop a couple of ifdef/endif pairs by moving the ifdef
> surrounding neigh_app_ns() to the interior of neigh_app_ns().
Can we please just remove the CONFIG_ARPD option entirely.
There really is no savings to keeping this option configurable and the
option only removes a netlink notification.
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> Cc: James Morris <jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
> Cc: Gao feng <gaofeng@cn.fujitsu.com>
> Cc: Joe Perches <joe@perches.com>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>
> This is an admittedly trivial change. I stumbled on it while trying to figure
> out why Ubuntu doesn't have CONFIG_ARPD enabled.
>
> net/core/neighbour.c | 4 ++--
> net/ipv4/arp.c | 2 --
> net/ipv6/ndisc.c | 2 --
> 3 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 60533db..049dd9e 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -2759,13 +2759,13 @@ errout:
> rtnl_set_sk_err(net, RTNLGRP_NEIGH, err);
> }
>
> -#ifdef CONFIG_ARPD
> void neigh_app_ns(struct neighbour *n)
> {
> +#ifdef CONFIG_ARPD
> __neigh_notify(n, RTM_GETNEIGH, NLM_F_REQUEST);
> +#endif /* CONFIG_ARPD */
> }
> EXPORT_SYMBOL(neigh_app_ns);
> -#endif /* CONFIG_ARPD */
>
> #ifdef CONFIG_SYSCTL
> static int zero;
> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> index 4429b01..7808093 100644
> --- a/net/ipv4/arp.c
> +++ b/net/ipv4/arp.c
> @@ -368,9 +368,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
> } else {
> probes -= neigh->parms->app_probes;
> if (probes < 0) {
> -#ifdef CONFIG_ARPD
> neigh_app_ns(neigh);
> -#endif
> return;
> }
> }
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 04d31c2..d5693ad 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -663,9 +663,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
> }
> ndisc_send_ns(dev, neigh, target, target, saddr);
> } else if ((probes -= neigh->parms->app_probes) < 0) {
> -#ifdef CONFIG_ARPD
> neigh_app_ns(neigh);
> -#endif
> } else {
> addrconf_addr_solict_mult(target, &mcaddr);
> ndisc_send_ns(dev, NULL, target, &mcaddr, saddr);
^ permalink raw reply
* Re: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
From: David Miller @ 2013-08-29 0:01 UTC (permalink / raw)
To: robmatic-Re5JQEeQqe8AvxtiuMwx3w
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
bjorn-yOkvZcmFvRU, oliver-GvhC2dPhHPQdnm+yROfE0A
In-Reply-To: <20130828171812.7097dc8334046b464486d4a3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
From: Rob Gardner <robmatic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Wed, 28 Aug 2013 17:18:12 -0600
> Bjørn says it could have a minor performance impact, but should not
> cause any loss of functionality. I don't think there's any hard data on
> what the performance cost might be but I know he would eventually like
> to get rid of the exception list and live with the possible performance
> impact if it means functionality for more devices.
Therefore I would recommend turning the workaround on by default and
have a white list.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 2/2] sh_eth: Enable Rx descriptor word 0 shift for r8a7790
From: Simon Horman @ 2013-08-29 0:06 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: David S. Miller, netdev, linux-sh, Magnus Damm, Kouei Abe
In-Reply-To: <521E11CA.1020503@cogentembedded.com>
On Wed, Aug 28, 2013 at 07:05:46PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 08/28/2013 04:43 AM, Simon Horman wrote:
>
> >From: Kouei Abe <kouei.abe.cp@renesas.com>
>
> >This corrects an oversight when r8a7790 support was added to sh_eth.
>
> No wonder it was overseen -- it's undocumented as of version 0.60
> of the manual.
>
> >Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> > drivers/net/ethernet/renesas/sh_eth.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> >diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> >index f386a8f..095ca8e 100644
> >--- a/drivers/net/ethernet/renesas/sh_eth.c
> >+++ b/drivers/net/ethernet/renesas/sh_eth.c
> >@@ -416,6 +416,7 @@ static struct sh_eth_cpu_data r8a7790_data = {
> > .tpauser = 1,
> > .hw_swap = 1,
> > .rmiimode = 1,
> >+ .shift_rd0 = 1,
>
> I've seen the corresponding code in a Renesas BSP but wanted to
> double check before sending...
That is entirely reasonable.
I think that this email from Abe-san can count as a double-check.
^ permalink raw reply
* Re: [PATCH] bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones
From: David Miller @ 2013-08-29 0:08 UTC (permalink / raw)
To: linus.luessing
Cc: amwang, netdev, bridge, linux-kernel, linux, stephen, herbert
In-Reply-To: <1377511266-14530-1-git-send-email-linus.luessing@web.de>
From: Linus Lüssing <linus.luessing@web.de>
Date: Mon, 26 Aug 2013 12:01:06 +0200
> Currently we would still potentially suffer multicast packet loss if there
> is just either an IGMP or an MLD querier: For the former case, we would
> possibly drop IPv6 multicast packets, for the latter IPv4 ones. This is
> because we are currently assuming that if either an IGMP or MLD querier
> is present that the other one is present, too.
>
> This patch makes the behaviour and fix added in
> "bridge: disable snooping if there is no querier" (b00589af3b04)
> to also work if there is either just an IGMP or an MLD querier on the
> link: It refines the deactivation of the snooping to be protocol
> specific by using separate timers for the snooped IGMP and MLD queries
> as well as separate timers for our internal IGMP and MLD queriers.
>
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
I think the logic of the fix is fine, but theres a lot of duplication
here.
Why not make a:
struct bridge_mcast_timer {
struct timer_list timer;
u32 queries_sent;
u32 startup_queries_sent;
};
Then in the port structure you have:
struct bridge_mcast_timer ip4;
struct bridge_mcast_timer ip6;
And pass a reference to the right one into generic helper functions.
That sounds a lot better right?
Please make this improvement and resubmit, thanks.
^ permalink raw reply
* Re: [PATCH net,stable] net: usb: Add HP hs2434 device to ZLP exception table
From: Rob Gardner @ 2013-08-29 0:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-usb, bjorn, oliver
In-Reply-To: <20130828.200111.1548126886406334118.davem@davemloft.net>
On Wed, 28 Aug 2013 20:01:11 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: Rob Gardner <robmatic@gmail.com>
> Date: Wed, 28 Aug 2013 17:18:12 -0600
>
> > Bjørn says it could have a minor performance impact, but should not
> > cause any loss of functionality. I don't think there's any hard data on
> > what the performance cost might be but I know he would eventually like
> > to get rid of the exception list and live with the possible performance
> > impact if it means functionality for more devices.
>
> Therefore I would recommend turning the workaround on by default and
> have a white list.
The exception list means "usb_device_id entries for specific devices
that are known to need the workaround." There are just two such entries.
There isn't even a separate list. So maybe we just have a nomenclature
problem, and we could simply be calling this a "white list" instead of
"exception list". The other possible meaning of whitelist (all devices
that *don't* need the workaround) is unthinkable, as that would be a huge
list and much more prone to be unmanageable than what we've got now.
--
Rob Gardner <robmatic@gmail.com>
^ permalink raw reply
* Re: [net-next 07/10] ixgbe: fix SFF data dumps of SFP+ modules from an offset
From: Ben Hutchings @ 2013-08-29 1:00 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, Emil Tantilov, netdev, gospo, sassmann
In-Reply-To: <1377686028-30747-8-git-send-email-jeffrey.t.kirsher@intel.com>
On Wed, 2013-08-28 at 03:33 -0700, Jeff Kirsher wrote:
> From: Emil Tantilov <emil.s.tantilov@intel.com>
>
> This patch fixes the read loop for the I2C data to account for the offset.
>
> Also includes a whitespace cleanup and removes ret_val as it is not needed.
>
> CC: Ben Hutchings <bhutchings@solarflare.com>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Reported-by: Ben Hutchings <bhutchings@solarflare.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
[...]
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Thanks.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] net: revert 8728c544a9c ("net: dev_pick_tx() fix")
From: Eric Dumazet @ 2013-08-29 1:10 UTC (permalink / raw)
To: David Miller
Cc: netdev, Alexander Duyck, Xi Wang, Tom Herbert,
Denys Fedorysychenko
From: Eric Dumazet <edumazet@google.com>
commit 8728c544a9cbdc ("net: dev_pick_tx() fix") and commit
b6fe83e9525a ("bonding: refine IFF_XMIT_DST_RELEASE capability")
are quite incompatible : Queue selection is disabled because skb
dst was dropped before entering bonding device.
This causes major performance regression, mainly because TCP packets
for a given flow can be sent to multiple queues.
This is particularly visible when using the new FQ packet scheduler
with MQ + FQ setup on the slaves.
We can safely revert the first commit now that 416186fbf8c5b
("net: Split core bits of netdev_pick_tx into __netdev_pick_tx")
properly caps the queue_index.
Reported-by: Xi Wang <xii@google.com>
Diagnosed-by: Xi Wang <xii@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Denys Fedorysychenko <nuclearcat@nuclearcat.com>
---
Google-Bug-Id: 10230478
net/core/flow_dissector.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 159737c..0ff42f0 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -350,14 +350,9 @@ u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)
if (new_index < 0)
new_index = skb_tx_hash(dev, skb);
- if (queue_index != new_index && sk) {
- struct dst_entry *dst =
- rcu_dereference_check(sk->sk_dst_cache, 1);
-
- if (dst && skb_dst(skb) == dst)
- sk_tx_queue_set(sk, queue_index);
-
- }
+ if (queue_index != new_index && sk &&
+ rcu_access_pointer(sk->sk_dst_cache))
+ sk_tx_queue_set(sk, queue_index);
queue_index = new_index;
}
^ permalink raw reply related
* Re: [PATCH net-next 1/1] net: neighbour: Simplify ifdefs around neigh_app_ns()
From: Joe Perches @ 2013-08-29 1:26 UTC (permalink / raw)
To: Tim Gardner
Cc: netdev, linux-kernel, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy,
Eric W. Biederman, Gao feng
In-Reply-To: <521E4AE6.7080703@canonical.com>
On Wed, 2013-08-28 at 13:09 -0600, Tim Gardner wrote:
> On 08/28/2013 12:51 PM, Joe Perches wrote:
> > On Wed, 2013-08-28 at 12:24 -0600, Tim Gardner wrote:
> >> Drop a couple of ifdef/endif pairs by moving the ifdef
> >> surrounding neigh_app_ns() to the interior of neigh_app_ns().
> > []
> >> This is an admittedly trivial change. I stumbled on it while trying to figure
> >> out why Ubuntu doesn't have CONFIG_ARPD enabled.
> > I'd be more inclined to make neigh_app_ns static inline
> > in the .h file and remove the EXPORT_SYMBOL
> I thought about that as well, but then you'd have to extern
> __neigh_notify(), which is currently a static function and large enough
> to not really be suitable for inlining. Seems like unnecessary churn to me.
Hi Tim.
As is, this makes the call to neight_app_ns
impossible to optimize away.
Perhaps this:
(this does add a possibly unused neigh_notify as a global symbol)
Rename __neigh_notify to neigh_notify and make public
Add static inline neigh_app_ns
Remove #ifdefs around use of neigh_app_ns
---
Compile tested only
include/net/neighbour.h | 10 +++++++++-
net/core/neighbour.c | 15 +++------------
net/ipv4/arp.c | 2 --
net/ipv6/ndisc.c | 2 --
4 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 536501a..a08b0a7 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -249,7 +249,15 @@ static inline struct net *pneigh_net(const struct pneigh_entry *pneigh)
return read_pnet(&pneigh->net);
}
-void neigh_app_ns(struct neighbour *n);
+void neigh_notify(struct neighbour *n, int type, int flags);
+
+static inline void neigh_app_ns(struct neighbour *n)
+{
+#ifdef CONFIG_ARPD
+ neigh_notify(n, RTM_GETNEIGH, NLM_F_REQUEST);
+#endif
+}
+
void neigh_for_each(struct neigh_table *tbl,
void (*cb)(struct neighbour *, void *), void *cookie);
void __neigh_for_each_release(struct neigh_table *tbl,
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 60533db..6ec5f86 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -50,7 +50,6 @@ do { \
#define PNEIGH_HASHMASK 0xF
static void neigh_timer_handler(unsigned long arg);
-static void __neigh_notify(struct neighbour *n, int type, int flags);
static void neigh_update_notify(struct neighbour *neigh);
static int pneigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
@@ -103,7 +102,7 @@ static void neigh_cleanup_and_release(struct neighbour *neigh)
if (neigh->parms->neigh_cleanup)
neigh->parms->neigh_cleanup(neigh);
- __neigh_notify(neigh, RTM_DELNEIGH, 0);
+ neigh_notify(neigh, RTM_DELNEIGH, 0);
neigh_release(neigh);
}
@@ -2215,7 +2214,7 @@ nla_put_failure:
static void neigh_update_notify(struct neighbour *neigh)
{
call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);
- __neigh_notify(neigh, RTM_NEWNEIGH, 0);
+ neigh_notify(neigh, RTM_NEWNEIGH, 0);
}
static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
@@ -2735,7 +2734,7 @@ static inline size_t neigh_nlmsg_size(void)
+ nla_total_size(4); /* NDA_PROBES */
}
-static void __neigh_notify(struct neighbour *n, int type, int flags)
+void neigh_notify(struct neighbour *n, int type, int flags)
{
struct net *net = dev_net(n->dev);
struct sk_buff *skb;
@@ -2759,14 +2758,6 @@ errout:
rtnl_set_sk_err(net, RTNLGRP_NEIGH, err);
}
-#ifdef CONFIG_ARPD
-void neigh_app_ns(struct neighbour *n)
-{
- __neigh_notify(n, RTM_GETNEIGH, NLM_F_REQUEST);
-}
-EXPORT_SYMBOL(neigh_app_ns);
-#endif /* CONFIG_ARPD */
-
#ifdef CONFIG_SYSCTL
static int zero;
static int int_max = INT_MAX;
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4429b01..7808093 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -368,9 +368,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
} else {
probes -= neigh->parms->app_probes;
if (probes < 0) {
-#ifdef CONFIG_ARPD
neigh_app_ns(neigh);
-#endif
return;
}
}
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 04d31c2..d5693ad 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -663,9 +663,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
}
ndisc_send_ns(dev, neigh, target, target, saddr);
} else if ((probes -= neigh->parms->app_probes) < 0) {
-#ifdef CONFIG_ARPD
neigh_app_ns(neigh);
-#endif
} else {
addrconf_addr_solict_mult(target, &mcaddr);
ndisc_send_ns(dev, NULL, target, &mcaddr, saddr);
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox