536
543
pr_info("%s: Setting ARP monitoring interval to %d.\n",
537
544
bond->dev->name, new_value);
538
545
bond->params.arp_interval = new_value;
539
if (bond->params.miimon) {
540
pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
541
bond->dev->name, bond->dev->name);
542
bond->params.miimon = 0;
543
if (delayed_work_pending(&bond->mii_work)) {
544
cancel_delayed_work(&bond->mii_work);
545
flush_workqueue(bond->wq);
547
if (bond->params.miimon) {
548
pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
549
bond->dev->name, bond->dev->name);
550
bond->params.miimon = 0;
548
if (!bond->params.arp_targets[0]) {
549
pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
552
if (!bond->params.arp_targets[0])
553
pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
552
556
if (bond->dev->flags & IFF_UP) {
553
557
/* If the interface is up, we may need to fire off
555
559
* timer will get fired off when the open function
558
if (!delayed_work_pending(&bond->arp_work)) {
559
if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
560
INIT_DELAYED_WORK(&bond->arp_work,
561
bond_activebackup_arp_mon);
563
INIT_DELAYED_WORK(&bond->arp_work,
564
bond_loadbalance_arp_mon);
563
cancel_delayed_work_sync(&bond->arp_work);
565
cancel_delayed_work_sync(&bond->mii_work);
566
566
queue_delayed_work(bond->wq, &bond->arp_work, 0);
573
573
static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,
972
974
if (new_value < 0) {
973
975
pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
974
bond->dev->name, new_value, 1, INT_MAX);
976
bond->dev->name, new_value, 0, INT_MAX);
978
pr_info("%s: Setting MII monitoring interval to %d.\n",
979
bond->dev->name, new_value);
980
bond->params.miimon = new_value;
981
if (bond->params.updelay)
982
pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
984
bond->params.updelay * bond->params.miimon);
985
if (bond->params.downdelay)
986
pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
988
bond->params.downdelay * bond->params.miimon);
989
if (bond->params.arp_interval) {
990
pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
992
bond->params.arp_interval = 0;
993
if (bond->params.arp_validate) {
994
bond->params.arp_validate =
995
BOND_ARP_VALIDATE_NONE;
997
if (delayed_work_pending(&bond->arp_work)) {
998
cancel_delayed_work(&bond->arp_work);
999
flush_workqueue(bond->wq);
1003
if (bond->dev->flags & IFF_UP) {
1004
/* If the interface is up, we may need to fire off
1005
* the MII timer. If the interface is down, the
1006
* timer will get fired off when the open function
1009
if (!delayed_work_pending(&bond->mii_work)) {
1010
INIT_DELAYED_WORK(&bond->mii_work,
1012
queue_delayed_work(bond->wq,
1013
&bond->mii_work, 0);
980
pr_info("%s: Setting MII monitoring interval to %d.\n",
981
bond->dev->name, new_value);
982
bond->params.miimon = new_value;
983
if (bond->params.updelay)
984
pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
986
bond->params.updelay * bond->params.miimon);
987
if (bond->params.downdelay)
988
pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
990
bond->params.downdelay * bond->params.miimon);
991
if (new_value && bond->params.arp_interval) {
992
pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
994
bond->params.arp_interval = 0;
995
if (bond->params.arp_validate)
996
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
998
if (bond->dev->flags & IFF_UP) {
999
/* If the interface is up, we may need to fire off
1000
* the MII timer. If the interface is down, the
1001
* timer will get fired off when the open function
1005
cancel_delayed_work_sync(&bond->mii_work);
1007
cancel_delayed_work_sync(&bond->arp_work);
1008
queue_delayed_work(bond->wq, &bond->mii_work, 0);
1020
1015
static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR,