* [PATCH net-next 6/6] bonding: remove useless updating of slave->dev->last_rx
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek, David S. Miller
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
Now that all the logic is handled via last_arp_rx, we don't need to use
last_rx.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 3 ---
include/linux/netdevice.h | 8 +-------
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f5ac7e0..f9e5512 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1163,9 +1163,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
slave = bond_slave_get_rcu(skb->dev);
bond = slave->bond;
- if (bond->params.arp_interval)
- slave->dev->last_rx = jiffies;
-
recv_probe = ACCESS_ONCE(bond->recv_probe);
if (recv_probe) {
ret = recv_probe(skb, bond, slave);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 30f6513..2016f00 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1299,13 +1299,7 @@ struct net_device {
/*
* Cache lines mostly used on receive path (including eth_type_trans())
*/
- unsigned long last_rx; /* Time of last Rx
- * This should not be set in
- * drivers, unless really needed,
- * because network stack (bonding)
- * use it if/when necessary, to
- * avoid dirtying this cache line.
- */
+ unsigned long last_rx; /* Time of last Rx */
/* Interface address info used in eth_type_trans() */
unsigned char *dev_addr; /* hw address, (before bcast
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 5/6] bonding: use last_arp_rx in bond_loadbalance_arp_mon()
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
Now that last_arp_rx correctly show the last time we've received an ARP, we
can use it safely instead of slave->dev->last_rx.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 399e691..f5ac7e0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2406,7 +2406,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
if (slave->link != BOND_LINK_UP) {
if (bond_time_in_interval(bond, trans_start, 1) &&
- bond_time_in_interval(bond, slave->dev->last_rx, 1)) {
+ bond_time_in_interval(bond, slave->last_arp_rx, 1)) {
slave->link = BOND_LINK_UP;
bond_set_active_slave(slave);
@@ -2435,7 +2435,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
* if we don't know our ip yet
*/
if (!bond_time_in_interval(bond, trans_start, 2) ||
- !bond_time_in_interval(bond, slave->dev->last_rx, 2)) {
+ !bond_time_in_interval(bond, slave->last_arp_rx, 2)) {
slave->link = BOND_LINK_DOWN;
bond_set_backup_slave(slave);
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 4/6] bonding: rename slave_last_rx() to slave_last_arp_rx()
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
To make the code more readable.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 4 ++--
drivers/net/bonding/bonding.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1e0f21a..399e691 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2347,7 +2347,7 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
if (bond_is_active_slave(slave))
bond_validate_arp(bond, slave, sip, tip);
else if (bond->curr_active_slave &&
- time_after(slave_last_rx(bond, bond->curr_active_slave),
+ time_after(slave_last_arp_rx(bond, bond->curr_active_slave),
bond->curr_active_slave->jiffies))
bond_validate_arp(bond, slave, tip, sip);
@@ -2504,7 +2504,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
bond_for_each_slave_rcu(bond, slave, iter) {
slave->new_link = BOND_LINK_NOCHANGE;
- last_rx = slave_last_rx(bond, slave);
+ last_rx = slave_last_arp_rx(bond, slave);
if (slave->link != BOND_LINK_UP) {
if (bond_time_in_interval(bond, last_rx, 1)) {
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 1af8c1f..99126b2 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -341,8 +341,8 @@ static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond,
return ret;
}
-static inline unsigned long slave_last_rx(struct bonding *bond,
- struct slave *slave)
+static inline unsigned long slave_last_arp_rx(struct bonding *bond,
+ struct slave *slave)
{
if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
return slave_oldest_target_arp_rx(bond, slave);
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 3/6] bonding: use last_arp_rx in slave_last_rx()
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
Now that last_arp_rx really has the last time we've received any (validated or
not) ARP, we can use it in slave_last_rx() instead of slave->dev->last_rx.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bonding.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 955dc48..1af8c1f 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -344,14 +344,10 @@ static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond,
static inline unsigned long slave_last_rx(struct bonding *bond,
struct slave *slave)
{
- if (slave_do_arp_validate(bond, slave)) {
- if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
- return slave_oldest_target_arp_rx(bond, slave);
- else
- return slave->last_arp_rx;
- }
-
- return slave->dev->last_rx;
+ if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL)
+ return slave_oldest_target_arp_rx(bond, slave);
+
+ return slave->last_arp_rx;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 2/6] bonding: always set recv_probe to bond_arp_rcv in arp monitor
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
Currently we only set bond_arp_rcv() if we're using arp_validate, however
this makes us skip updating last_arp_rx if we're not validating incoming
ARPs - thus, if arp_validate is off, last_arp_rx will never be updated.
Fix this by always setting up recv_probe = bond_arp_rcv, even if we're not
using arp_validate.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 3 +--
drivers/net/bonding/bond_options.c | 12 ++----------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index cfb37af..1e0f21a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3062,8 +3062,7 @@ static int bond_open(struct net_device *bond_dev)
if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
queue_delayed_work(bond->wq, &bond->arp_work, 0);
- if (bond->params.arp_validate)
- bond->recv_probe = bond_arp_rcv;
+ bond->recv_probe = bond_arp_rcv;
}
if (bond->params.mode == BOND_MODE_8023AD) {
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 945a666..1bab20e 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -283,13 +283,11 @@ int bond_option_arp_interval_set(struct bonding *bond, int arp_interval)
* is called.
*/
if (!arp_interval) {
- if (bond->params.arp_validate)
- bond->recv_probe = NULL;
+ bond->recv_probe = NULL;
cancel_delayed_work_sync(&bond->arp_work);
} else {
/* arp_validate can be set only in active-backup mode */
- if (bond->params.arp_validate)
- bond->recv_probe = bond_arp_rcv;
+ bond->recv_probe = bond_arp_rcv;
cancel_delayed_work_sync(&bond->mii_work);
queue_delayed_work(bond->wq, &bond->arp_work, 0);
}
@@ -446,12 +444,6 @@ int bond_option_arp_validate_set(struct bonding *bond, int arp_validate)
bond->dev->name, arp_validate_tbl[arp_validate].modename,
arp_validate);
- if (bond->dev->flags & IFF_UP) {
- if (!arp_validate)
- bond->recv_probe = NULL;
- else if (bond->params.arp_interval)
- bond->recv_probe = bond_arp_rcv;
- }
bond->params.arp_validate = arp_validate;
return 0;
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 1/6] bonding: always update last_arp_rx on arp recieve
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389837916-5377-1-git-send-email-vfalico@redhat.com>
Currently we're updating the last_arp_rx only when we've validate the
packet, however afterwards we use it as 'ANY last arp received', but not
only validated ARPs.
Fix this by updating it even if the slave doesn't require arp validation.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f2fe6cb..cfb37af 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2294,8 +2294,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
read_lock(&bond->lock);
- if (!slave_do_arp_validate(bond, slave))
+ if (!slave_do_arp_validate(bond, slave)) {
+ slave->last_arp_rx = jiffies;
goto out_unlock;
+ }
alen = arp_hdr_len(bond->dev);
--
1.8.4
^ permalink raw reply related
* [PATCH net-next 0/6] bonding: only rely on arp packets if arp monitor is used
From: Veaceslav Falico @ 2014-01-16 2:05 UTC (permalink / raw)
To: netdev; +Cc: Jay Vosburgh, Andy Gospodarek, David S. Miller, Veaceslav Falico
Hi,
Currently, if arp_validate is off (0), slave_last_rx() returns the
slave->dev->last_rx, which is always updated on *any* packet received by
slave, and not only arps. This means that, if the validation of arps is
off, we're treating *any* incoming packet as a proof of slave being up, and
not only arps.
This might seem logical at the first glance, however it can cause a lot of
troubles and false-positives, one example would be:
The arp_ip_target is NOT accessible, however someone in the broadcast domain
spams with any broadcast traffic. This way bonding will be tricked that the
slave is still up (as in - can access arp_ip_target), while it's not.
The documentation for arp_validate also states that *ARPs* will (not) be
validated if it's on/off, and that the arp monitoring works on arps as
traffic generators.
Also, the net_device->last_rx is already used in a lot of drivers (even
though the comment states to NOT do it :)), and it's also ugly to modify it
from bonding.
So, to fix this, remove the last_rx from bonding, *always* call
bond_arp_rcv() in slave's rx_handler (bond_handle_frame), and if we spot an
arp there - update the slave->last_arp_rx - and use it instead of
net_device->last_rx. Finally, rename slave_last_rx() to slave_last_arp_rx()
to reflect the changes.
As the changes touch really sensitive parts, I've tried to split them as
much as possible, for easier debugging/bisecting.
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
drivers/net/bonding/bond_main.c | 18 ++++++++----------
drivers/net/bonding/bond_options.c | 12 ++----------
drivers/net/bonding/bonding.h | 16 ++++++----------
include/linux/netdevice.h | 8 +-------
4 files changed, 17 insertions(+), 37 deletions(-)
^ permalink raw reply
* Re: [PATCH 1/2 v3] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
From: Ethan Zhao @ 2014-01-16 1:58 UTC (permalink / raw)
To: Brown, Aaron F
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Allan, Bruce W, Brandeburg, Jesse, linux-kernel@vger.kernel.org,
davem@davemloft.net
In-Reply-To: <309B89C4C689E141A5FF6A0C5FB2118B7312DE7D@ORSMSX101.amr.corp.intel.com>
Aaron,
Is this your net-next repo ? if so, I rebuild the patch with this repo
right now .
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git
Thanks,
Ethan
On Thu, Jan 16, 2014 at 9:54 AM, Brown, Aaron F <aaron.f.brown@intel.com> wrote:
> On Thu, 2014-01-16 at 09:27 +0800, Ethan Zhao wrote:
>> On Thu, Jan 16, 2014 at 6:00 AM, Brown, Aaron F <aaron.f.brown@intel.com> wrote:
>> > On Wed, 2014-01-15 at 22:12 +0800, Ethan Zhao wrote:
>> >> Because ixgbe driver limit the max number of VF functions could be enabled
>> >> to 63, so define one macro IXGBE_MAX_VFS_DRV_LIMIT and cleanup the const 63
>> >> in code.
>> >>
>> >> v2: fix a typo.
>> >> v3: fix a encoding issue.
>> >>
>> >> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
>> >> ---
>> >> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
>> >> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +++--
>> >> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 5 +++++
>> >> 3 files changed, 10 insertions(+), 4 deletions(-)
>> >>
>> >> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> >> index 0ade0cd..47e9b44 100644
>> >> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> >> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> >> @@ -4818,7 +4818,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
>> >> #ifdef CONFIG_PCI_IOV
>> >> /* assign number of SR-IOV VFs */
>> >> if (hw->mac.type != ixgbe_mac_82598EB)
>> >> - adapter->num_vfs = (max_vfs > 63) ? 0 : max_vfs;
>> >
>> >
>> > Unfortunately the if statement got changed considerably with a recent
>> > commit:
>> >
>> > commit 170e85430bcbe4d18e81b5a70bb163c741381092
>> > ixgbe: add warning when max_vfs is out of range.
>> >
>> > And the pattern no longer exists to make a match. In other words, this
>> > patch no longer applies to net-next and I have to ask you for yet
>> > another spin if you still want to squash the magic number.
>>
>> It's not a good news. Our distro is waiting for this patch showing up in stable.
>> OK, info me if there is a windows for me to revise the patch.
>
> I don't think any particular window of time is better than another. I
> don't see this change as needing very thorough testing so if you send in
> (yet) another version I'll try to get it through our internal process as
> rapidly as I can.
>
>>
>> Thanks,
>> Ethan
>>
>> >
>> > Thanks,
>> > Aaron
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH 1/2 v3] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
From: Brown, Aaron F @ 2014-01-16 1:54 UTC (permalink / raw)
To: ethan.kernel@gmail.com
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Wyborny, Carolyn, davem@davemloft.net,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <CABawtvNEDjTJAjJ9TeEvZd7+2kD=H6zA23T-aQo3uVm5SUEhCQ@mail.gmail.com>
On Thu, 2014-01-16 at 09:27 +0800, Ethan Zhao wrote:
> On Thu, Jan 16, 2014 at 6:00 AM, Brown, Aaron F <aaron.f.brown@intel.com> wrote:
> > On Wed, 2014-01-15 at 22:12 +0800, Ethan Zhao wrote:
> >> Because ixgbe driver limit the max number of VF functions could be enabled
> >> to 63, so define one macro IXGBE_MAX_VFS_DRV_LIMIT and cleanup the const 63
> >> in code.
> >>
> >> v2: fix a typo.
> >> v3: fix a encoding issue.
> >>
> >> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
> >> ---
> >> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
> >> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +++--
> >> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 5 +++++
> >> 3 files changed, 10 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> >> index 0ade0cd..47e9b44 100644
> >> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> >> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> >> @@ -4818,7 +4818,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
> >> #ifdef CONFIG_PCI_IOV
> >> /* assign number of SR-IOV VFs */
> >> if (hw->mac.type != ixgbe_mac_82598EB)
> >> - adapter->num_vfs = (max_vfs > 63) ? 0 : max_vfs;
> >
> >
> > Unfortunately the if statement got changed considerably with a recent
> > commit:
> >
> > commit 170e85430bcbe4d18e81b5a70bb163c741381092
> > ixgbe: add warning when max_vfs is out of range.
> >
> > And the pattern no longer exists to make a match. In other words, this
> > patch no longer applies to net-next and I have to ask you for yet
> > another spin if you still want to squash the magic number.
>
> It's not a good news. Our distro is waiting for this patch showing up in stable.
> OK, info me if there is a windows for me to revise the patch.
I don't think any particular window of time is better than another. I
don't see this change as needing very thorough testing so if you send in
(yet) another version I'll try to get it through our internal process as
rapidly as I can.
>
> Thanks,
> Ethan
>
> >
> > Thanks,
> > Aaron
^ permalink raw reply
* Re: [PATCH v4 net-next] bonding: handle slave's name change with primary_slave logic
From: Veaceslav Falico @ 2014-01-16 1:40 UTC (permalink / raw)
To: Ding Tianhong; +Cc: netdev, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <52D7382A.1090607@huawei.com>
On Thu, Jan 16, 2014 at 09:38:50AM +0800, Ding Tianhong wrote:
>On 2014/1/16 9:04, Veaceslav Falico wrote:
>> Currently, if a slave's name change, we just pass it by. However, if the
>> slave is a current primary_slave, then we end up with using a slave, whose
>> name != params.primary, for primary_slave. And vice-versa, if we don't have
>> a primary_slave but have params.primary set - we will not detected a new
>> primary_slave.
>>
>> Fix this by catching the NETDEV_CHANGENAME event and setting primary_slave
>> accordingly. Also, if the primary_slave was changed, issue a reselection of
>> the active slave, cause the priorities have changed.
>>
>> Reported-by: Ding Tianhong <dingtianhong@huawei.com>
>> CC: Ding Tianhong <dingtianhong@huawei.com>
>> CC: Jay Vosburgh <fubar@us.ibm.com>
>> CC: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
>> ---
>>
>> Notes:
>> v3->v4:
>> Fix style issue.
>>
>> v2->v3:
>> Reword the info message, per Jay's comment.
>>
>> v1->v2:
>> Proper patch
>>
>> drivers/net/bonding/bond_main.c | 24 +++++++++++++++++++++---
>> 1 file changed, 21 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index f2fe6cb..f00dd45 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -2860,9 +2860,27 @@ static int bond_slave_netdev_event(unsigned long event,
>> */
>> break;
>> case NETDEV_CHANGENAME:
>> - /*
>> - * TODO: handle changing the primary's name
>> - */
>> + /* we don't care if we don't have primary set */
>> + if (!USES_PRIMARY(bond->params.mode) ||
>> + !bond->params.primary[0])
>> + break;
>> +
>> + if (slave == bond->primary_slave) {
>> + /* slave's name changed - he's no longer primary */
>> + bond->primary_slave = NULL;
>> + } else if (!strcmp(slave_dev->name, bond->params.primary)) {
>> + /* we have a new primary slave */
>> + bond->primary_slave = slave;
>> + } else { /* we didn't change primary - exit */
>> + break;
>> + }
>> +
>why not remove all the { } for the if else, there are only one line for each if.
It's written so in CodingStyles, as spotted by Sergei -
http://www.spinics.net/lists/netdev/msg266612.html .
>
>but seems good for logic.
>
>Acked-by: Ding Tianhong <dingtianhong@huawei.com>
>
>> + pr_info("%s: Primary slave changed to %s, reselecting active slave.\n",
>> + bond->dev->name, bond->primary_slave ? slave_dev->name :
>> + "none");
>> + write_lock_bh(&bond->curr_slave_lock);
>> + bond_select_active_slave(bond);
>> + write_unlock_bh(&bond->curr_slave_lock);
>> break;
>> case NETDEV_FEAT_CHANGE:
>> bond_compute_features(bond);
>>
>
>
^ permalink raw reply
* linux-next: manual merge of the net-next tree with the uml tree
From: Stephen Rothwell @ 2014-01-16 1:42 UTC (permalink / raw)
To: David Miller, netdev, Richard Weinberger; +Cc: linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 827 bytes --]
Hi all,
Today's linux-next merge of the net-next tree got a conflict in
arch/um/include/asm/Kbuild between commit 989e59fa41c5 ("um: Include
generic barrier.h") from the uml tree and commit e3fec2f74f7f ("lib: Add
missing arch generic-y entries for asm-generic/hash.h") from the net-next
tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc arch/um/include/asm/Kbuild
index fb3a6cc23015,75de4abe4f94..000000000000
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@@ -4,4 -4,4 +4,5 @@@ generic-y += ftrace.h pci.h io.h param.
generic-y += switch_to.h clkdev.h
generic-y += trace_clock.h
generic-y += preempt.h
+generic-y += barrier.h
+ generic-y += hash.h
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v4 net-next] bonding: handle slave's name change with primary_slave logic
From: Ding Tianhong @ 2014-01-16 1:38 UTC (permalink / raw)
To: Veaceslav Falico, netdev; +Cc: Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1389834269-4740-1-git-send-email-vfalico@redhat.com>
On 2014/1/16 9:04, Veaceslav Falico wrote:
> Currently, if a slave's name change, we just pass it by. However, if the
> slave is a current primary_slave, then we end up with using a slave, whose
> name != params.primary, for primary_slave. And vice-versa, if we don't have
> a primary_slave but have params.primary set - we will not detected a new
> primary_slave.
>
> Fix this by catching the NETDEV_CHANGENAME event and setting primary_slave
> accordingly. Also, if the primary_slave was changed, issue a reselection of
> the active slave, cause the priorities have changed.
>
> Reported-by: Ding Tianhong <dingtianhong@huawei.com>
> CC: Ding Tianhong <dingtianhong@huawei.com>
> CC: Jay Vosburgh <fubar@us.ibm.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
> ---
>
> Notes:
> v3->v4:
> Fix style issue.
>
> v2->v3:
> Reword the info message, per Jay's comment.
>
> v1->v2:
> Proper patch
>
> drivers/net/bonding/bond_main.c | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index f2fe6cb..f00dd45 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2860,9 +2860,27 @@ static int bond_slave_netdev_event(unsigned long event,
> */
> break;
> case NETDEV_CHANGENAME:
> - /*
> - * TODO: handle changing the primary's name
> - */
> + /* we don't care if we don't have primary set */
> + if (!USES_PRIMARY(bond->params.mode) ||
> + !bond->params.primary[0])
> + break;
> +
> + if (slave == bond->primary_slave) {
> + /* slave's name changed - he's no longer primary */
> + bond->primary_slave = NULL;
> + } else if (!strcmp(slave_dev->name, bond->params.primary)) {
> + /* we have a new primary slave */
> + bond->primary_slave = slave;
> + } else { /* we didn't change primary - exit */
> + break;
> + }
> +
why not remove all the { } for the if else, there are only one line for each if.
but seems good for logic.
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
> + pr_info("%s: Primary slave changed to %s, reselecting active slave.\n",
> + bond->dev->name, bond->primary_slave ? slave_dev->name :
> + "none");
> + write_lock_bh(&bond->curr_slave_lock);
> + bond_select_active_slave(bond);
> + write_unlock_bh(&bond->curr_slave_lock);
> break;
> case NETDEV_FEAT_CHANGE:
> bond_compute_features(bond);
>
^ permalink raw reply
* [net-next 2/2] ixgbe: Clear head write-back registers on VF reset
From: Aaron Brown @ 2014-01-16 1:38 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, sassmann, Aaron Brown
In-Reply-To: <1389836321-17013-1-git-send-email-aaron.f.brown@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
The Tx head write-back registers are not cleared during an FLR or VF reset.
As a result a configuration that had head write-back enabled can leave the
registers set after the driver is unloaded. If the next driver loaded doesn't
use the write-back registers this can lead to a bad configuration where
head write-back is enabled, but the driver didn't request it.
To avoid this situation the PF should be resetting the Tx head write-back
registers when the VF requests a reset.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 9 +++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 43e10c6..0558c71 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -698,6 +698,15 @@ static int ixgbe_vf_reset_msg(struct ixgbe_adapter *adapter, u32 vf)
reg |= (1 << vf_shift);
IXGBE_WRITE_REG(hw, IXGBE_VMECM(reg_offset), reg);
+ /*
+ * Reset the VFs TDWBAL and TDWBAH registers
+ * which are not cleared by an FLR
+ */
+ for (i = 0; i < q_per_pool; i++) {
+ IXGBE_WRITE_REG(hw, IXGBE_PVFTDWBAHn(q_per_pool, vf, i), 0);
+ IXGBE_WRITE_REG(hw, IXGBE_PVFTDWBALn(q_per_pool, vf, i), 0);
+ }
+
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET;
if (!is_zero_ether_addr(vf_mac)) {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index d8e59f4..0d39cfc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2174,6 +2174,14 @@ enum {
#define IXGBE_MBVFICR(_i) (0x00710 + ((_i) * 4))
#define IXGBE_VFLRE(_i) ((((_i) & 1) ? 0x001C0 : 0x00600))
#define IXGBE_VFLREC(_i) (0x00700 + ((_i) * 4))
+/* Translated register #defines */
+#define IXGBE_PVFTDWBAL(P) (0x06038 + (0x40 * (P)))
+#define IXGBE_PVFTDWBAH(P) (0x0603C + (0x40 * (P)))
+
+#define IXGBE_PVFTDWBALn(q_per_pool, vf_number, vf_q_index) \
+ (IXGBE_PVFTDWBAL((q_per_pool)*(vf_number) + (vf_q_index)))
+#define IXGBE_PVFTDWBAHn(q_per_pool, vf_number, vf_q_index) \
+ (IXGBE_PVFTDWBAH((q_per_pool)*(vf_number) + (vf_q_index)))
enum ixgbe_fdir_pballoc_type {
IXGBE_FDIR_PBALLOC_NONE = 0,
--
1.8.5.GIT
^ permalink raw reply related
* [net-next 0/2] Intel Wired LAN Driver Updates
From: Aaron Brown @ 2014-01-16 1:38 UTC (permalink / raw)
To: davem; +Cc: Aaron Brown, netdev, gospo, sassmann
This series contains several updates from Alex to ixgbe.
To avoid head of line blocking in the event a VF stops cleaning Rx descriptors
he makes sure QDE bits are set for a VF before the Rx queues are enabled.
To avoid a situation where the head write-back registers can remain set ofter
the driver is unloaded he clears them on a VF reset.
Alexander Duyck (2):
ixgbe: Force QDE via PFQDE for VFs during reset
ixgbe: Clear head write-back registers on VF reset
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 23 +++++++++++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 15 ++++++++++++---
2 files changed, 35 insertions(+), 3 deletions(-)
--
1.8.5.GIT
^ permalink raw reply
* [net-next 1/2] ixgbe: Force QDE via PFQDE for VFs during reset
From: Aaron Brown @ 2014-01-16 1:38 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, gospo, sassmann, Aaron Brown
In-Reply-To: <1389836321-17013-1-git-send-email-aaron.f.brown@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change makes it so that the QDE bits are set for a VF before the Rx
queues are enabled. As such we avoid head of line blocking in the event
that the VF stops cleaning Rx descriptors for whatever reason.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 14 ++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 7 ++++---
2 files changed, 18 insertions(+), 3 deletions(-)
Signed-off-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 14 ++++++++++++++
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 7 ++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 359f6e6..43e10c6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -631,11 +631,14 @@ int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask)
static int ixgbe_vf_reset_msg(struct ixgbe_adapter *adapter, u32 vf)
{
+ struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
struct ixgbe_hw *hw = &adapter->hw;
unsigned char *vf_mac = adapter->vfinfo[vf].vf_mac_addresses;
u32 reg, reg_offset, vf_shift;
u32 msgbuf[4] = {0, 0, 0, 0};
u8 *addr = (u8 *)(&msgbuf[1]);
+ u32 q_per_pool = __ALIGN_MASK(1, ~vmdq->mask);
+ int i;
e_info(probe, "VF Reset msg received from vf %d\n", vf);
@@ -654,6 +657,17 @@ static int ixgbe_vf_reset_msg(struct ixgbe_adapter *adapter, u32 vf)
reg |= 1 << vf_shift;
IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), reg);
+ /* force drop enable for all VF Rx queues */
+ for (i = vf * q_per_pool; i < ((vf + 1) * q_per_pool); i++) {
+ /* flush previous write */
+ IXGBE_WRITE_FLUSH(hw);
+
+ /* indicate to hardware that we want to set drop enable */
+ reg = IXGBE_QDE_WRITE | IXGBE_QDE_ENABLE;
+ reg |= i << IXGBE_QDE_IDX_SHIFT;
+ IXGBE_WRITE_REG(hw, IXGBE_QDE, reg);
+ }
+
/* enable receive for vf */
reg = IXGBE_READ_REG(hw, IXGBE_VFRE(reg_offset));
reg |= 1 << vf_shift;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 7c19e96..d8e59f4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -1980,9 +1980,10 @@ enum {
#define IXGBE_FWSM_TS_ENABLED 0x1
/* Queue Drop Enable */
-#define IXGBE_QDE_ENABLE 0x00000001
-#define IXGBE_QDE_IDX_MASK 0x00007F00
-#define IXGBE_QDE_IDX_SHIFT 8
+#define IXGBE_QDE_ENABLE 0x00000001
+#define IXGBE_QDE_IDX_MASK 0x00007F00
+#define IXGBE_QDE_IDX_SHIFT 8
+#define IXGBE_QDE_WRITE 0x00010000
#define IXGBE_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */
#define IXGBE_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */
--
1.8.5.GIT
^ permalink raw reply related
* Re: PROBLEM: usbnet / ax88179_178a: Panic in usb_hcd_map_urb_for_dma
From: Ming Lei @ 2014-01-16 1:28 UTC (permalink / raw)
To: David Laight
Cc: Bjørn Mork, Thomas Kear, Ben Hutchings, netdev,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D4590AF-VkEWCZq2GCInGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
On Mon, Jan 13, 2014 at 9:26 PM, David Laight <David.Laight-JxhZ9S5GRejQT0dZR+AlfA@public.gmane.org> wrote:
>>
>> I believe all processing use the urb->num_sgs field to limit the number
>> of entries. Common interfaces like dma_map_sg() and for_each_sg() limit
>> their processing to "nents" entries, and the USB code use the value of
>> urb->num_sgs for this parameter.
>
> Which mostly means that the sg_xxx functions are doing a whole load
> of unnecessary instructions and memory accesses...
>
> This probably has a lot to do with the significant difference in the
> cpu use for the usb3 and 'normal' ethernet interfaces.
>
> While each bit doesn't seem significant, they soon add up.
If you plan to remove the 'nents' parameter, I am wondering if it is
a good idea, because sg_nents() should be more heavy. Not mention
sometimes the callers just want to map/unmap part of entries.
Thanks,
--
Ming Lei
--
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 1/2 v3] ixgbe: define IXGBE_MAX_VFS_DRV_LIMIT macro and cleanup const 63
From: Ethan Zhao @ 2014-01-16 1:27 UTC (permalink / raw)
To: Brown, Aaron F
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Allan, Bruce W, Brandeburg, Jesse, linux-kernel@vger.kernel.org,
davem@davemloft.net
In-Reply-To: <309B89C4C689E141A5FF6A0C5FB2118B7312DA20@ORSMSX101.amr.corp.intel.com>
On Thu, Jan 16, 2014 at 6:00 AM, Brown, Aaron F <aaron.f.brown@intel.com> wrote:
> On Wed, 2014-01-15 at 22:12 +0800, Ethan Zhao wrote:
>> Because ixgbe driver limit the max number of VF functions could be enabled
>> to 63, so define one macro IXGBE_MAX_VFS_DRV_LIMIT and cleanup the const 63
>> in code.
>>
>> v2: fix a typo.
>> v3: fix a encoding issue.
>>
>> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
>> ---
>> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
>> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +++--
>> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 5 +++++
>> 3 files changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index 0ade0cd..47e9b44 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -4818,7 +4818,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
>> #ifdef CONFIG_PCI_IOV
>> /* assign number of SR-IOV VFs */
>> if (hw->mac.type != ixgbe_mac_82598EB)
>> - adapter->num_vfs = (max_vfs > 63) ? 0 : max_vfs;
>
>
> Unfortunately the if statement got changed considerably with a recent
> commit:
>
> commit 170e85430bcbe4d18e81b5a70bb163c741381092
> ixgbe: add warning when max_vfs is out of range.
>
> And the pattern no longer exists to make a match. In other words, this
> patch no longer applies to net-next and I have to ask you for yet
> another spin if you still want to squash the magic number.
It's not a good news. Our distro is waiting for this patch showing up in stable.
OK, info me if there is a windows for me to revise the patch.
Thanks,
Ethan
>
> Thanks,
> Aaron
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH v5 net-next 1/4] sh_eth: Use bool as return type of sh_eth_is_gether()
From: Simon Horman @ 2014-01-16 1:15 UTC (permalink / raw)
To: Joe Perches
Cc: David S. Miller, netdev, linux-sh, linux-arm-kernel, Magnus Damm,
Sergei Shtylyov
In-Reply-To: <1389778520.14001.16.camel@joe-AO722>
On Wed, Jan 15, 2014 at 01:35:20AM -0800, Joe Perches wrote:
> On Wed, 2014-01-15 at 15:12 +0900, Simon Horman wrote:
> > Return a boolean and use true and false.
> []
> > diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> []
> > @@ -310,12 +310,12 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
> > [TSU_ADRL31] = 0x01fc,
> > };
> >
> > -static int sh_eth_is_gether(struct sh_eth_private *mdp)
> > +static bool sh_eth_is_gether(struct sh_eth_private *mdp)
> > {
> > if (mdp->reg_offset == sh_eth_offset_gigabit)
> > - return 1;
> > + return true;
> > else
> > - return 0;
> > + return false;
> > }
>
> Or maybe:
>
> static bool sh_eth_is_gether(struct sh_eth_private *mdp)
> {
> return mdp->reg_offset == sh_eth_offset_gigabit;
> }
Thanks, will do.
^ permalink raw reply
* [PATCH v4 net-next] bonding: handle slave's name change with primary_slave logic
From: Veaceslav Falico @ 2014-01-16 1:04 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Ding Tianhong, Jay Vosburgh, Andy Gospodarek
Currently, if a slave's name change, we just pass it by. However, if the
slave is a current primary_slave, then we end up with using a slave, whose
name != params.primary, for primary_slave. And vice-versa, if we don't have
a primary_slave but have params.primary set - we will not detected a new
primary_slave.
Fix this by catching the NETDEV_CHANGENAME event and setting primary_slave
accordingly. Also, if the primary_slave was changed, issue a reselection of
the active slave, cause the priorities have changed.
Reported-by: Ding Tianhong <dingtianhong@huawei.com>
CC: Ding Tianhong <dingtianhong@huawei.com>
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
v3->v4:
Fix style issue.
v2->v3:
Reword the info message, per Jay's comment.
v1->v2:
Proper patch
drivers/net/bonding/bond_main.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f2fe6cb..f00dd45 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2860,9 +2860,27 @@ static int bond_slave_netdev_event(unsigned long event,
*/
break;
case NETDEV_CHANGENAME:
- /*
- * TODO: handle changing the primary's name
- */
+ /* we don't care if we don't have primary set */
+ if (!USES_PRIMARY(bond->params.mode) ||
+ !bond->params.primary[0])
+ break;
+
+ if (slave == bond->primary_slave) {
+ /* slave's name changed - he's no longer primary */
+ bond->primary_slave = NULL;
+ } else if (!strcmp(slave_dev->name, bond->params.primary)) {
+ /* we have a new primary slave */
+ bond->primary_slave = slave;
+ } else { /* we didn't change primary - exit */
+ break;
+ }
+
+ pr_info("%s: Primary slave changed to %s, reselecting active slave.\n",
+ bond->dev->name, bond->primary_slave ? slave_dev->name :
+ "none");
+ write_lock_bh(&bond->curr_slave_lock);
+ bond_select_active_slave(bond);
+ write_unlock_bh(&bond->curr_slave_lock);
break;
case NETDEV_FEAT_CHANGE:
bond_compute_features(bond);
--
1.8.4
^ permalink raw reply related
* Re: [PATCH v2 net] bpf: do not use reciprocal divide
From: David Miller @ 2014-01-16 1:02 UTC (permalink / raw)
To: eric.dumazet
Cc: heiko.carstens, schwidefsky, hannes, netdev, dborkman,
darkjames-ws, mgherzan, rmk+kernel, matt
In-Reply-To: <1389797407.31367.340.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 15 Jan 2014 06:50:07 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> At first Jakub Zawadzki noticed that some divisions by reciprocal_divide
> were not correct. (off by one in some cases)
> http://www.wireshark.org/~darkjames/reciprocal-buggy.c
>
> He could also show this with BPF:
> http://www.wireshark.org/~darkjames/set-and-dump-filter-k-bug.c
>
> The reciprocal divide in linux kernel is not generic enough,
> lets remove its use in BPF, as it is not worth the pain with
> current cpus.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Applied and queued up for -stable, thanks Eric.
^ permalink raw reply
* Re: [PATCH v5 0/2] ipv6 addrconf: add IFA_F_NOPREFIXROUTE flag to suppress creation of IP6 routes
From: David Miller @ 2014-01-16 1:01 UTC (permalink / raw)
To: thaller; +Cc: hannes, jiri, netdev, stephen, dcbw
In-Reply-To: <1389796619-13440-1-git-send-email-thaller@redhat.com>
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 15 Jan 2014 15:36:57 +0100
> v1 -> v2: add a second commit, handling NOPREFIXROUTE in ip6_del_addr.
> v2 -> v3: reword commit messages, code comments and some refactoring.
> v3 -> v4: refactor, rename variables, add enum
> v4 -> v5: rebase, so that patch applies cleanly to current net-next/master
Applied, sorry for not pushing these out properly last time.
^ permalink raw reply
* Re: [PATCH net-next] net: stmmac: fix NULL pointer dereference in stmmac_get_tx_hwtstamp
From: David Miller @ 2014-01-16 0:58 UTC (permalink / raw)
To: damuzi000; +Cc: peppe.cavallaro, netdev, linux-kernel
In-Reply-To: <1389795967-2452-1-git-send-email-damuzi000@gmail.com>
From: Bruce Liu <damuzi000@gmail.com>
Date: Wed, 15 Jan 2014 22:26:07 +0800
> When timestamping is enabled, stmmac_tx_clean will call
> stmmac_get_tx_hwtstamp to get tx TS.
> But the skb can be NULL because the last of its tx_skbuff is NULL
> if this packet frame is filled in more than one descriptors.
>
> Signed-off-by: Bruce Liu <damuzi000@gmail.com>
Sometimes the cure is worse than the disease.
Your change means that every multi-segment packet will never have
it's timestamp properly recorded, which is of course bogus.
You need to change this code such that the SKB from the first
descriptor is maintained so that we can pass it into
stmmac_get_tx_hwtstamp() at the appropriate time.
Thanks.
^ permalink raw reply
* Re: [PATCH 14/14] batman-adv: drop dependency against CRC16
From: David Miller @ 2014-01-16 0:54 UTC (permalink / raw)
To: antonio; +Cc: netdev, b.a.t.m.a.n
In-Reply-To: <52D68A1C.3080302@meshcoding.com>
From: Antonio Quartulli <antonio@meshcoding.com>
Date: Wed, 15 Jan 2014 14:16:12 +0100
> On 13/01/14 23:31, Antonio Quartulli wrote:
>> The crc16 functionality is not used anymore, therefore
>> we can safely remove the dependency in the Kbuild file.
>>
>> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
>
> David,
>
> we just realized that this dependency is still needed by our module.
> (also thanks to Fengguang Wu build bot!)
>
> Could you please revert this patch only?
I've reverted this change from net-next, thanks.
^ permalink raw reply
* Re: [PATCH V2 net-next 3/3] ipv6: add ip6_flowlabel_consistency sysctl
From: David Miller @ 2014-01-16 0:52 UTC (permalink / raw)
To: florent.fourcot; +Cc: netdev
In-Reply-To: <1389785403-6401-3-git-send-email-florent.fourcot@enst-bretagne.fr>
From: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
Date: Wed, 15 Jan 2014 12:30:03 +0100
> + if (net->ipv6.sysctl.ip6_flowlabel_consistency) {
> + pr_info("Can not set IPV6_FL_F_REFLECT if ip6_flowlabel_consistency sysctl is enable \n");
As others have mentioned, please ratelimit this.
^ permalink raw reply
* Re: [PATCH net v2] be2net: add dma_mapping_error() check for dma_map_page()
From: David Miller @ 2014-01-16 0:50 UTC (permalink / raw)
To: ivecera; +Cc: netdev, sathya.perla, subbu.seetharaman, ajit.khaparde
In-Reply-To: <1389780694-6299-1-git-send-email-ivecera@redhat.com>
From: Ivan Vecera <ivecera@redhat.com>
Date: Wed, 15 Jan 2014 11:11:34 +0100
> The driver does not check value returned by dma_map_page. The patch
> fixes this.
>
> v2: Removed the bugfix for non-bug ;-) (thanks Sathya)
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Applied, thank you.
^ permalink raw reply
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