2020-05-08 03:22:37

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the net-next tree with the rdma tree

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

drivers/net/bonding/bond_main.c

between commits:

ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
c071d91d2a89 ("bonding: Add helper function to get the xmit slave based on hash")
29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave in rr mode")

from the rdma and mlx5-next trees and commit:

ae46f184bc1f ("bonding: propagate transmit status")

from the net-next tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging. You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc drivers/net/bonding/bond_main.c
index 39b1ad7edbb4,4f9e7c421f57..000000000000
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@@ -4022,32 -4024,12 +4022,30 @@@ static struct slave *bond_xmit_roundrob
non_igmp:
slave_cnt = READ_ONCE(bond->slave_cnt);
if (likely(slave_cnt)) {
- slave_id = bond_rr_gen_slave_id(bond);
- return bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
+ slave_id = bond_rr_gen_slave_id(bond) % slave_cnt;
+ return bond_get_slave_by_id(bond, slave_id);
}
+ return NULL;
+}
+
+static netdev_tx_t bond_xmit_roundrobin(struct sk_buff *skb,
+ struct net_device *bond_dev)
+{
+ struct bonding *bond = netdev_priv(bond_dev);
+ struct slave *slave;
+
+ slave = bond_xmit_roundrobin_slave_get(bond, skb);
+ if (slave)
- bond_dev_queue_xmit(bond, skb, slave->dev);
- else
- bond_tx_drop(bond_dev, skb);
- return NETDEV_TX_OK;
++ return bond_dev_queue_xmit(bond, skb, slave->dev);
+ return bond_tx_drop(bond_dev, skb);
}

+static struct slave *bond_xmit_activebackup_slave_get(struct bonding *bond,
+ struct sk_buff *skb)
+{
+ return rcu_dereference(bond->curr_active_slave);
+}
+
/* In active-backup mode, we know that bond->curr_active_slave is always valid if
* the bond has a usable interface.
*/
@@@ -4057,13 -4039,11 +4055,11 @@@ static netdev_tx_t bond_xmit_activeback
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;

- slave = rcu_dereference(bond->curr_active_slave);
+ slave = bond_xmit_activebackup_slave_get(bond, skb);
if (slave)
- bond_dev_queue_xmit(bond, skb, slave->dev);
- else
- bond_tx_drop(bond_dev, skb);
+ return bond_dev_queue_xmit(bond, skb, slave->dev);

- return NETDEV_TX_OK;
+ return bond_tx_drop(bond_dev, skb);
}

/* Use this to update slave_array when (a) it's not appropriate to update
@@@ -4254,17 -4178,17 +4250,14 @@@ static netdev_tx_t bond_3ad_xor_xmit(st
struct net_device *dev)
{
struct bonding *bond = netdev_priv(dev);
- struct slave *slave;
struct bond_up_slave *slaves;
- unsigned int count;
+ struct slave *slave;

- slaves = rcu_dereference(bond->slave_arr);
- count = slaves ? READ_ONCE(slaves->count) : 0;
- if (likely(count)) {
- slave = slaves->arr[bond_xmit_hash(bond, skb) % count];
+ slaves = rcu_dereference(bond->usable_slaves);
+ slave = bond_xmit_3ad_xor_slave_get(bond, skb, slaves);
+ if (likely(slave))
- bond_dev_queue_xmit(bond, skb, slave->dev);
- else
- bond_tx_drop(dev, skb);
-
- return NETDEV_TX_OK;
+ return bond_dev_queue_xmit(bond, skb, slave->dev);
- }
+ return bond_tx_drop(dev, skb);
}

/* in broadcast mode, we send everything to all usable interfaces. */


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-05-08 12:38:00

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree

On Fri, May 08, 2020 at 01:18:51PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
> drivers/net/bonding/bond_main.c
>
> between commits:
>
> ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
> c071d91d2a89 ("bonding: Add helper function to get the xmit slave based on hash")
> 29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave in rr mode")
>
> from the rdma and mlx5-next trees and commit:
>
> ae46f184bc1f ("bonding: propagate transmit status")
>
> from the net-next tree.

Saeed? These patches in the shared branch were supposed to be a PR to
net-net? I see it hasn't happened yet and now we have conflicts??

Jason

2020-05-09 07:42:24

by Saeed Mahameed

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree

On Fri, 2020-05-08 at 13:18 +1000, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
> drivers/net/bonding/bond_main.c
>
> between commits:
>
> ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
> c071d91d2a89 ("bonding: Add helper function to get the xmit slave
> based on hash")
> 29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave
> in rr mode")
>
> from the rdma and mlx5-next trees and commit:
>
> ae46f184bc1f ("bonding: propagate transmit status")
>
> from the net-next tree.
>
> I fixed it up (I think - see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but
> any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging. You may also want to
> consider
> cooperating with the maintainer of the conflicting tree to minimise
> any
> particularly complex conflicts.
>

Hi Stephen and thanks for the report.

Your fix seems to be ok, i think it is missing some hunks for
bond_get_slave_by_id function and some "likely" directives are missing,
which were added by Maor's or Eric's patches.

Anyway this is already fixed up in my net-next-mlx5 tree and will be
submitted very soon to net-next with the conflict fixup ..

Thanks,
Saeed.

2020-05-09 07:51:41

by Saeed Mahameed

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree

On Fri, 2020-05-08 at 09:35 -0300, Jason Gunthorpe wrote:
> On Fri, May 08, 2020 at 01:18:51PM +1000, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the net-next tree got a conflict in:
> >
> > drivers/net/bonding/bond_main.c
> >
> > between commits:
> >
> > ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
> > c071d91d2a89 ("bonding: Add helper function to get the xmit slave
> > based on hash")
> > 29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave
> > in rr mode")
> >
> > from the rdma and mlx5-next trees and commit:
> >
> > ae46f184bc1f ("bonding: propagate transmit status")
> >
> > from the net-next tree.
>
> Saeed? These patches in the shared branch were supposed to be a PR to
> net-net? I see it hasn't happened yet and now we have conflicts??
>

Yes, I don't usually send standalone PRs of mlx5-next, and I only do it
with the corresponding (depending on) patches from net-next-mlx5, but I
agree this one was different I should have submitted it .. anyway the
conflict is minor, i already fixed it up and will submit soon..

Thanks,
Saeed.