Skip to content

Commit f9e2922

Browse files
Thomas KleinJeff Garzik
authored andcommitted
eHEA: Fix bonding support
The driver didn't allow an interface's MAC address to be modified if the respective interface wasn't setup - a failing Hcall was the result. Thus bonding wasn't usable. The fix moves the failing Hcall which was registering a MAC address for the reception of BC packets in firmware from the port up and down functions to the port resources setup functions. Additionally the missing update of the last_rx member of the netdev structure was added. Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent e190d6b commit f9e2922

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

drivers/net/ehea/ehea.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <asm/io.h>
4040

4141
#define DRV_NAME "ehea"
42-
#define DRV_VERSION "EHEA_0070"
42+
#define DRV_VERSION "EHEA_0071"
4343

4444
/* eHEA capability flags */
4545
#define DLPAR_PORT_ADD_REM 1

drivers/net/ehea/ehea_main.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
466466
cqe->vlan_tag);
467467
else
468468
netif_receive_skb(skb);
469+
470+
dev->last_rx = jiffies;
469471
} else {
470472
pr->p_stats.poll_receive_errors++;
471473
port_reset = ehea_treat_poll_error(pr, rq, cqe,
@@ -1433,7 +1435,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
14331435
port->logical_port_id,
14341436
reg_type, port->mac_addr, 0, hcallid);
14351437
if (hret != H_SUCCESS) {
1436-
ehea_error("reg_dereg_bcmc failed (tagged)");
1438+
ehea_error("%sregistering bc address failed (tagged)",
1439+
hcallid == H_REG_BCMC ? "" : "de");
14371440
ret = -EIO;
14381441
goto out_herr;
14391442
}
@@ -1444,7 +1447,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
14441447
port->logical_port_id,
14451448
reg_type, port->mac_addr, 0, hcallid);
14461449
if (hret != H_SUCCESS) {
1447-
ehea_error("reg_dereg_bcmc failed (vlan)");
1450+
ehea_error("%sregistering bc address failed (vlan)",
1451+
hcallid == H_REG_BCMC ? "" : "de");
14481452
ret = -EIO;
14491453
}
14501454
out_herr:
@@ -2170,7 +2174,6 @@ static int ehea_up(struct net_device *dev)
21702174
{
21712175
int ret, i;
21722176
struct ehea_port *port = netdev_priv(dev);
2173-
u64 mac_addr = 0;
21742177

21752178
if (port->state == EHEA_PORT_UP)
21762179
return 0;
@@ -2189,18 +2192,10 @@ static int ehea_up(struct net_device *dev)
21892192
goto out_clean_pr;
21902193
}
21912194

2192-
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2193-
if (ret) {
2194-
ret = -EIO;
2195-
ehea_error("out_clean_pr");
2196-
goto out_clean_pr;
2197-
}
2198-
mac_addr = (*(u64*)dev->dev_addr) >> 16;
2199-
22002195
ret = ehea_reg_interrupts(dev);
22012196
if (ret) {
2202-
ehea_error("out_dereg_bc");
2203-
goto out_dereg_bc;
2197+
ehea_error("reg_interrupts failed. ret:%d", ret);
2198+
goto out_clean_pr;
22042199
}
22052200

22062201
for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
@@ -2226,9 +2221,6 @@ static int ehea_up(struct net_device *dev)
22262221
out_free_irqs:
22272222
ehea_free_interrupts(dev);
22282223

2229-
out_dereg_bc:
2230-
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2231-
22322224
out_clean_pr:
22332225
ehea_clean_all_portres(port);
22342226
out:
@@ -2273,7 +2265,6 @@ static int ehea_down(struct net_device *dev)
22732265
&port->port_res[i].d_netdev->state))
22742266
msleep(1);
22752267

2276-
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
22772268
port->state = EHEA_PORT_DOWN;
22782269

22792270
ret = ehea_clean_all_portres(port);
@@ -2655,12 +2646,18 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
26552646

26562647
INIT_WORK(&port->reset_task, ehea_reset_port);
26572648

2649+
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2650+
if (ret) {
2651+
ret = -EIO;
2652+
goto out_unreg_port;
2653+
}
2654+
26582655
ehea_set_ethtool_ops(dev);
26592656

26602657
ret = register_netdev(dev);
26612658
if (ret) {
26622659
ehea_error("register_netdev failed. ret=%d", ret);
2663-
goto out_unreg_port;
2660+
goto out_dereg_bc;
26642661
}
26652662

26662663
ret = ehea_get_jumboframe_status(port, &jumbo);
@@ -2675,6 +2672,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
26752672

26762673
return port;
26772674

2675+
out_dereg_bc:
2676+
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2677+
26782678
out_unreg_port:
26792679
ehea_unregister_port(port);
26802680

@@ -2694,6 +2694,7 @@ static void ehea_shutdown_single_port(struct ehea_port *port)
26942694
{
26952695
unregister_netdev(port->netdev);
26962696
ehea_unregister_port(port);
2697+
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
26972698
kfree(port->mc_list);
26982699
free_netdev(port->netdev);
26992700
port->adapter->active_ports--;

0 commit comments

Comments
 (0)