summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Sharp2008-09-26 22:08:10 +0200
committerRoland Dreier2008-10-01 00:35:47 +0200
commite0e31afbf9a9bb6ca934d3c64ef321cb5f873efe (patch)
tree4006d1e4495422ab3f397c5fe5e2c46b35265240
parentRDMA/nes: Free NIC TX buffers when destroying NIC QP (diff)
downloadkernel-qcow2-linux-e0e31afbf9a9bb6ca934d3c64ef321cb5f873efe.tar.gz
kernel-qcow2-linux-e0e31afbf9a9bb6ca934d3c64ef321cb5f873efe.tar.xz
kernel-qcow2-linux-e0e31afbf9a9bb6ca934d3c64ef321cb5f873efe.zip
RDMA/nes: Enable MC/UC after changing MTU
Re-enable multicast and unicast after changing MTU. Signed-off-by: Bob Sharp <bsharp@neteffect.com> Signed-off-by: Sweta Bhatt <sweta.bhatt@einfochips.com> Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 1b0938c87774..77e258a57d4c 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -918,6 +918,10 @@ static int nes_netdev_change_mtu(struct net_device *netdev, int new_mtu)
struct nes_device *nesdev = nesvnic->nesdev;
int ret = 0;
u8 jumbomode = 0;
+ u32 nic_active;
+ u32 nic_active_bit;
+ u32 uc_all_active;
+ u32 mc_all_active;
if ((new_mtu < ETH_ZLEN) || (new_mtu > max_mtu))
return -EINVAL;
@@ -931,8 +935,24 @@ static int nes_netdev_change_mtu(struct net_device *netdev, int new_mtu)
nes_nic_init_timer_defaults(nesdev, jumbomode);
if (netif_running(netdev)) {
+ nic_active_bit = 1 << nesvnic->nic_index;
+ mc_all_active = nes_read_indexed(nesdev,
+ NES_IDX_NIC_MULTICAST_ALL) & nic_active_bit;
+ uc_all_active = nes_read_indexed(nesdev,
+ NES_IDX_NIC_UNICAST_ALL) & nic_active_bit;
+
nes_netdev_stop(netdev);
nes_netdev_open(netdev);
+
+ nic_active = nes_read_indexed(nesdev,
+ NES_IDX_NIC_MULTICAST_ALL);
+ nic_active |= mc_all_active;
+ nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL,
+ nic_active);
+
+ nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL);
+ nic_active |= uc_all_active;
+ nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL, nic_active);
}
return ret;