Re: [Bonding-devel] [PATCH] [bonding 2.4] Add balance-xor-ip bonding mode

2 messages, 2 authors, 2004-01-08 · open the first message on its own page

Re: [Bonding-devel] [PATCH] [bonding 2.4] Add balance-xor-ip bonding mode

From: Amir Noam <hidden>
Date: 2004-01-08 15:33:44

On Wednesday 07 January 2004 10:58 pm, Per Hedeland wrote:
        struct bonding *bond = bond_dev->priv; 
        struct ethhdr *data = (struct ethhdr *)skb->data; 
        struct slave *slave, *start_at; 
-       int slave_no; 
+       int slave_no = 0; 
        int i; 
+       __u32 u; 
 
        read_lock(&bond->lock);
Please use u32 instead of __u32.

+static int bond_xmit_xor_mac(struct sk_buff *skb, struct net_device *bond_dev) 
+{ 
+       return bond_xmit_xor(skb, bond_dev, 0); 
+} 
+ 
+static int bond_xmit_xor_ip(struct sk_buff *skb, struct net_device *bond_dev) 
+{ 
+       return bond_xmit_xor(skb, bond_dev, 1); 
+} 
+
hmm...

I don't like this. The reason we give different tx function pointers
to dev->hard_start_xmit in different bonding mode is to make the tx
path as fast as possible. Otherwise we might as well use a single tx
function that chooses its exact operation based on the bonding mode.

It might be better to have some code duplication if it results in
faster tx, but I'm not sure what's the optimal solution in this case.

-- 
Amir

Re: [Bonding-devel] [PATCH] [bonding 2.4] Add balance-xor-ip bonding mode

From: Per Hedeland <hidden>
Date: 2004-01-08 16:43:58

Amir Noam [off-list ref] wrote:
Please use u32 instead of __u32.
OK.
hmm...

I don't like this. The reason we give different tx function pointers
to dev->hard_start_xmit in different bonding mode is to make the tx
path as fast as possible. Otherwise we might as well use a single tx
function that chooses its exact operation based on the bonding mode.

It might be better to have some code duplication if it results in
faster tx, but I'm not sure what's the optimal solution in this case.
Well, I don't really have an opinion since I don't have a good idea
about the cost of a function call relative to "everything else" that is
happening here. I don't see a way to do "limited" duplication without
using function calls though, but I'm quite happy to make it two entirely
separate functions for MAC vs IP. Please advise.

--Per Hedeland
per@hedeland.org
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help