aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-07-15 13:36:08 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-16 02:16:06 -0400
commit2de390bace7c533c88359404911ff6e080de4004 (patch)
treead736b084052bc08c39decb55438789cb9ace0d2 /drivers/net/bonding
parentc735ee6c4376663f1a7a281c837d839037792748 (diff)
bonding: convert bond_options.c to use netdev_printk instead of pr_
CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_options.c216
1 files changed, 101 insertions, 115 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index cf720ce1b69e..1e28de28dddd 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -544,9 +544,8 @@ static void bond_opt_dep_print(struct bonding *bond,
544 params = &bond->params; 544 params = &bond->params;
545 modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode); 545 modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode);
546 if (test_bit(params->mode, &opt->unsuppmodes)) 546 if (test_bit(params->mode, &opt->unsuppmodes))
547 pr_err("%s: option %s: mode dependency failed, not supported in mode %s(%llu)\n", 547 netdev_err(bond->dev, "option %s: mode dependency failed, not supported in mode %s(%llu)\n",
548 bond->dev->name, opt->name, 548 opt->name, modeval->string, modeval->value);
549 modeval->string, modeval->value);
550} 549}
551 550
552static void bond_opt_error_interpret(struct bonding *bond, 551static void bond_opt_error_interpret(struct bonding *bond,
@@ -564,31 +563,30 @@ static void bond_opt_error_interpret(struct bonding *bond,
564 p = strchr(val->string, '\n'); 563 p = strchr(val->string, '\n');
565 if (p) 564 if (p)
566 *p = '\0'; 565 *p = '\0';
567 pr_err("%s: option %s: invalid value (%s)\n", 566 netdev_err(bond->dev, "option %s: invalid value (%s)\n",
568 bond->dev->name, opt->name, val->string); 567 opt->name, val->string);
569 } else { 568 } else {
570 pr_err("%s: option %s: invalid value (%llu)\n", 569 netdev_err(bond->dev, "option %s: invalid value (%llu)\n",
571 bond->dev->name, opt->name, val->value); 570 opt->name, val->value);
572 } 571 }
573 } 572 }
574 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); 573 minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN);
575 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); 574 maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX);
576 if (!maxval) 575 if (!maxval)
577 break; 576 break;
578 pr_err("%s: option %s: allowed values %llu - %llu\n", 577 netdev_err(bond->dev, "option %s: allowed values %llu - %llu\n",
579 bond->dev->name, opt->name, minval ? minval->value : 0, 578 opt->name, minval ? minval->value : 0, maxval->value);
580 maxval->value);
581 break; 579 break;
582 case -EACCES: 580 case -EACCES:
583 bond_opt_dep_print(bond, opt); 581 bond_opt_dep_print(bond, opt);
584 break; 582 break;
585 case -ENOTEMPTY: 583 case -ENOTEMPTY:
586 pr_err("%s: option %s: unable to set because the bond device has slaves\n", 584 netdev_err(bond->dev, "option %s: unable to set because the bond device has slaves\n",
587 bond->dev->name, opt->name); 585 opt->name);
588 break; 586 break;
589 case -EBUSY: 587 case -EBUSY:
590 pr_err("%s: option %s: unable to set because the bond device is up\n", 588 netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n",
591 bond->dev->name, opt->name); 589 opt->name);
592 break; 590 break;
593 default: 591 default:
594 break; 592 break;
@@ -675,14 +673,14 @@ static int bond_option_mode_set(struct bonding *bond,
675 const struct bond_opt_value *newval) 673 const struct bond_opt_value *newval)
676{ 674{
677 if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { 675 if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
678 pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", 676 netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
679 bond->dev->name, newval->string); 677 newval->string);
680 /* disable arp monitoring */ 678 /* disable arp monitoring */
681 bond->params.arp_interval = 0; 679 bond->params.arp_interval = 0;
682 /* set miimon to default value */ 680 /* set miimon to default value */
683 bond->params.miimon = BOND_DEFAULT_MIIMON; 681 bond->params.miimon = BOND_DEFAULT_MIIMON;
684 pr_info("%s: Setting MII monitoring interval to %d\n", 682 netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
685 bond->dev->name, bond->params.miimon); 683 bond->params.miimon);
686 } 684 }
687 685
688 /* don't cache arp_validate between modes */ 686 /* don't cache arp_validate between modes */
@@ -723,14 +721,14 @@ static int bond_option_active_slave_set(struct bonding *bond,
723 721
724 if (slave_dev) { 722 if (slave_dev) {
725 if (!netif_is_bond_slave(slave_dev)) { 723 if (!netif_is_bond_slave(slave_dev)) {
726 pr_err("Device %s is not bonding slave\n", 724 netdev_err(bond->dev, "Device %s is not bonding slave\n",
727 slave_dev->name); 725 slave_dev->name);
728 return -EINVAL; 726 return -EINVAL;
729 } 727 }
730 728
731 if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { 729 if (bond->dev != netdev_master_upper_dev_get(slave_dev)) {
732 pr_err("%s: Device %s is not our slave\n", 730 netdev_err(bond->dev, "Device %s is not our slave\n",
733 bond->dev->name, slave_dev->name); 731 slave_dev->name);
734 return -EINVAL; 732 return -EINVAL;
735 } 733 }
736 } 734 }
@@ -740,7 +738,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
740 738
741 /* check to see if we are clearing active */ 739 /* check to see if we are clearing active */
742 if (!slave_dev) { 740 if (!slave_dev) {
743 pr_info("%s: Clearing current active slave\n", bond->dev->name); 741 netdev_info(bond->dev, "Clearing current active slave\n");
744 RCU_INIT_POINTER(bond->curr_active_slave, NULL); 742 RCU_INIT_POINTER(bond->curr_active_slave, NULL);
745 bond_select_active_slave(bond); 743 bond_select_active_slave(bond);
746 } else { 744 } else {
@@ -751,18 +749,18 @@ static int bond_option_active_slave_set(struct bonding *bond,
751 749
752 if (new_active == old_active) { 750 if (new_active == old_active) {
753 /* do nothing */ 751 /* do nothing */
754 pr_info("%s: %s is already the current active slave\n", 752 netdev_info(bond->dev, "%s is already the current active slave\n",
755 bond->dev->name, new_active->dev->name); 753 new_active->dev->name);
756 } else { 754 } else {
757 if (old_active && (new_active->link == BOND_LINK_UP) && 755 if (old_active && (new_active->link == BOND_LINK_UP) &&
758 bond_slave_is_up(new_active)) { 756 bond_slave_is_up(new_active)) {
759 pr_info("%s: Setting %s as active slave\n", 757 netdev_info(bond->dev, "Setting %s as active slave\n",
760 bond->dev->name, new_active->dev->name); 758 new_active->dev->name);
761 bond_change_active_slave(bond, new_active); 759 bond_change_active_slave(bond, new_active);
762 } else { 760 } else {
763 pr_err("%s: Could not set %s as active slave; either %s is down or the link is down\n", 761 netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
764 bond->dev->name, new_active->dev->name, 762 new_active->dev->name,
765 new_active->dev->name); 763 new_active->dev->name);
766 ret = -EINVAL; 764 ret = -EINVAL;
767 } 765 }
768 } 766 }
@@ -781,20 +779,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
781static int bond_option_miimon_set(struct bonding *bond, 779static int bond_option_miimon_set(struct bonding *bond,
782 const struct bond_opt_value *newval) 780 const struct bond_opt_value *newval)
783{ 781{
784 pr_info("%s: Setting MII monitoring interval to %llu\n", 782 netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
785 bond->dev->name, newval->value); 783 newval->value);
786 bond->params.miimon = newval->value; 784 bond->params.miimon = newval->value;
787 if (bond->params.updelay) 785 if (bond->params.updelay)
788 pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value\n", 786 netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
789 bond->dev->name,
790 bond->params.updelay * bond->params.miimon); 787 bond->params.updelay * bond->params.miimon);
791 if (bond->params.downdelay) 788 if (bond->params.downdelay)
792 pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n", 789 netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
793 bond->dev->name, 790 bond->params.downdelay * bond->params.miimon);
794 bond->params.downdelay * bond->params.miimon);
795 if (newval->value && bond->params.arp_interval) { 791 if (newval->value && bond->params.arp_interval) {
796 pr_info("%s: MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n", 792 netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
797 bond->dev->name);
798 bond->params.arp_interval = 0; 793 bond->params.arp_interval = 0;
799 if (bond->params.arp_validate) 794 if (bond->params.arp_validate)
800 bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; 795 bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
@@ -826,20 +821,18 @@ static int bond_option_updelay_set(struct bonding *bond,
826 int value = newval->value; 821 int value = newval->value;
827 822
828 if (!bond->params.miimon) { 823 if (!bond->params.miimon) {
829 pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", 824 netdev_err(bond->dev, "Unable to set up delay as MII monitoring is disabled\n");
830 bond->dev->name);
831 return -EPERM; 825 return -EPERM;
832 } 826 }
833 if ((value % bond->params.miimon) != 0) { 827 if ((value % bond->params.miimon) != 0) {
834 pr_warn("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", 828 netdev_warn(bond->dev, "up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
835 bond->dev->name, value, 829 value, bond->params.miimon,
836 bond->params.miimon, 830 (value / bond->params.miimon) *
837 (value / bond->params.miimon) * 831 bond->params.miimon);
838 bond->params.miimon);
839 } 832 }
840 bond->params.updelay = value / bond->params.miimon; 833 bond->params.updelay = value / bond->params.miimon;
841 pr_info("%s: Setting up delay to %d\n", 834 netdev_info(bond->dev, "Setting up delay to %d\n",
842 bond->dev->name, bond->params.updelay * bond->params.miimon); 835 bond->params.updelay * bond->params.miimon);
843 836
844 return 0; 837 return 0;
845} 838}
@@ -850,20 +843,18 @@ static int bond_option_downdelay_set(struct bonding *bond,
850 int value = newval->value; 843 int value = newval->value;
851 844
852 if (!bond->params.miimon) { 845 if (!bond->params.miimon) {
853 pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", 846 netdev_err(bond->dev, "Unable to set down delay as MII monitoring is disabled\n");
854 bond->dev->name);
855 return -EPERM; 847 return -EPERM;
856 } 848 }
857 if ((value % bond->params.miimon) != 0) { 849 if ((value % bond->params.miimon) != 0) {
858 pr_warn("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", 850 netdev_warn(bond->dev, "down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
859 bond->dev->name, value, 851 value, bond->params.miimon,
860 bond->params.miimon, 852 (value / bond->params.miimon) *
861 (value / bond->params.miimon) * 853 bond->params.miimon);
862 bond->params.miimon);
863 } 854 }
864 bond->params.downdelay = value / bond->params.miimon; 855 bond->params.downdelay = value / bond->params.miimon;
865 pr_info("%s: Setting down delay to %d\n", 856 netdev_info(bond->dev, "Setting down delay to %d\n",
866 bond->dev->name, bond->params.downdelay * bond->params.miimon); 857 bond->params.downdelay * bond->params.miimon);
867 858
868 return 0; 859 return 0;
869} 860}
@@ -871,8 +862,8 @@ static int bond_option_downdelay_set(struct bonding *bond,
871static int bond_option_use_carrier_set(struct bonding *bond, 862static int bond_option_use_carrier_set(struct bonding *bond,
872 const struct bond_opt_value *newval) 863 const struct bond_opt_value *newval)
873{ 864{
874 pr_info("%s: Setting use_carrier to %llu\n", 865 netdev_info(bond->dev, "Setting use_carrier to %llu\n",
875 bond->dev->name, newval->value); 866 newval->value);
876 bond->params.use_carrier = newval->value; 867 bond->params.use_carrier = newval->value;
877 868
878 return 0; 869 return 0;
@@ -885,18 +876,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
885static int bond_option_arp_interval_set(struct bonding *bond, 876static int bond_option_arp_interval_set(struct bonding *bond,
886 const struct bond_opt_value *newval) 877 const struct bond_opt_value *newval)
887{ 878{
888 pr_info("%s: Setting ARP monitoring interval to %llu\n", 879 netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
889 bond->dev->name, newval->value); 880 newval->value);
890 bond->params.arp_interval = newval->value; 881 bond->params.arp_interval = newval->value;
891 if (newval->value) { 882 if (newval->value) {
892 if (bond->params.miimon) { 883 if (bond->params.miimon) {
893 pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring\n", 884 netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
894 bond->dev->name, bond->dev->name);
895 bond->params.miimon = 0; 885 bond->params.miimon = 0;
896 } 886 }
897 if (!bond->params.arp_targets[0]) 887 if (!bond->params.arp_targets[0])
898 pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified\n", 888 netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
899 bond->dev->name);
900 } 889 }
901 if (bond->dev->flags & IFF_UP) { 890 if (bond->dev->flags & IFF_UP) {
902 /* If the interface is up, we may need to fire off 891 /* If the interface is up, we may need to fire off
@@ -940,24 +929,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
940 int ind; 929 int ind;
941 930
942 if (!bond_is_ip_target_ok(target)) { 931 if (!bond_is_ip_target_ok(target)) {
943 pr_err("%s: invalid ARP target %pI4 specified for addition\n", 932 netdev_err(bond->dev, "invalid ARP target %pI4 specified for addition\n",
944 bond->dev->name, &target); 933 &target);
945 return -EINVAL; 934 return -EINVAL;
946 } 935 }
947 936
948 if (bond_get_targets_ip(targets, target) != -1) { /* dup */ 937 if (bond_get_targets_ip(targets, target) != -1) { /* dup */
949 pr_err("%s: ARP target %pI4 is already present\n", 938 netdev_err(bond->dev, "ARP target %pI4 is already present\n",
950 bond->dev->name, &target); 939 &target);
951 return -EINVAL; 940 return -EINVAL;
952 } 941 }
953 942
954 ind = bond_get_targets_ip(targets, 0); /* first free slot */ 943 ind = bond_get_targets_ip(targets, 0); /* first free slot */
955 if (ind == -1) { 944 if (ind == -1) {
956 pr_err("%s: ARP target table is full!\n", bond->dev->name); 945 netdev_err(bond->dev, "ARP target table is full!\n");
957 return -EINVAL; 946 return -EINVAL;
958 } 947 }
959 948
960 pr_info("%s: Adding ARP target %pI4\n", bond->dev->name, &target); 949 netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
961 950
962 _bond_options_arp_ip_target_set(bond, ind, target, jiffies); 951 _bond_options_arp_ip_target_set(bond, ind, target, jiffies);
963 952
@@ -985,23 +974,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
985 int ind, i; 974 int ind, i;
986 975
987 if (!bond_is_ip_target_ok(target)) { 976 if (!bond_is_ip_target_ok(target)) {
988 pr_err("%s: invalid ARP target %pI4 specified for removal\n", 977 netdev_err(bond->dev, "invalid ARP target %pI4 specified for removal\n",
989 bond->dev->name, &target); 978 &target);
990 return -EINVAL; 979 return -EINVAL;
991 } 980 }
992 981
993 ind = bond_get_targets_ip(targets, target); 982 ind = bond_get_targets_ip(targets, target);
994 if (ind == -1) { 983 if (ind == -1) {
995 pr_err("%s: unable to remove nonexistent ARP target %pI4\n", 984 netdev_err(bond->dev, "unable to remove nonexistent ARP target %pI4\n",
996 bond->dev->name, &target); 985 &target);
997 return -EINVAL; 986 return -EINVAL;
998 } 987 }
999 988
1000 if (ind == 0 && !targets[1] && bond->params.arp_interval) 989 if (ind == 0 && !targets[1] && bond->params.arp_interval)
1001 pr_warn("%s: Removing last arp target with arp_interval on\n", 990 netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
1002 bond->dev->name);
1003 991
1004 pr_info("%s: Removing ARP target %pI4\n", bond->dev->name, &target); 992 netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
1005 993
1006 /* not to race with bond_arp_rcv */ 994 /* not to race with bond_arp_rcv */
1007 write_lock_bh(&bond->lock); 995 write_lock_bh(&bond->lock);
@@ -1040,8 +1028,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
1040 1028
1041 if (newval->string) { 1029 if (newval->string) {
1042 if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) { 1030 if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) {
1043 pr_err("%s: invalid ARP target %pI4 specified\n", 1031 netdev_err(bond->dev, "invalid ARP target %pI4 specified\n",
1044 bond->dev->name, &target); 1032 &target);
1045 return ret; 1033 return ret;
1046 } 1034 }
1047 if (newval->string[0] == '+') 1035 if (newval->string[0] == '+')
@@ -1049,8 +1037,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
1049 else if (newval->string[0] == '-') 1037 else if (newval->string[0] == '-')
1050 ret = bond_option_arp_ip_target_rem(bond, target); 1038 ret = bond_option_arp_ip_target_rem(bond, target);
1051 else 1039 else
1052 pr_err("no command found in arp_ip_targets file for bond %s - use +<addr> or -<addr>\n", 1040 netdev_err(bond->dev, "no command found in arp_ip_targets file - use +<addr> or -<addr>\n");
1053 bond->dev->name);
1054 } else { 1041 } else {
1055 target = newval->value; 1042 target = newval->value;
1056 ret = bond_option_arp_ip_target_add(bond, target); 1043 ret = bond_option_arp_ip_target_add(bond, target);
@@ -1062,8 +1049,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
1062static int bond_option_arp_validate_set(struct bonding *bond, 1049static int bond_option_arp_validate_set(struct bonding *bond,
1063 const struct bond_opt_value *newval) 1050 const struct bond_opt_value *newval)
1064{ 1051{
1065 pr_info("%s: Setting arp_validate to %s (%llu)\n", 1052 netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
1066 bond->dev->name, newval->string, newval->value); 1053 newval->string, newval->value);
1067 1054
1068 if (bond->dev->flags & IFF_UP) { 1055 if (bond->dev->flags & IFF_UP) {
1069 if (!newval->value) 1056 if (!newval->value)
@@ -1079,8 +1066,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
1079static int bond_option_arp_all_targets_set(struct bonding *bond, 1066static int bond_option_arp_all_targets_set(struct bonding *bond,
1080 const struct bond_opt_value *newval) 1067 const struct bond_opt_value *newval)
1081{ 1068{
1082 pr_info("%s: Setting arp_all_targets to %s (%llu)\n", 1069 netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
1083 bond->dev->name, newval->string, newval->value); 1070 newval->string, newval->value);
1084 bond->params.arp_all_targets = newval->value; 1071 bond->params.arp_all_targets = newval->value;
1085 1072
1086 return 0; 1073 return 0;
@@ -1102,7 +1089,7 @@ static int bond_option_primary_set(struct bonding *bond,
1102 *p = '\0'; 1089 *p = '\0';
1103 /* check to see if we are clearing primary */ 1090 /* check to see if we are clearing primary */
1104 if (!strlen(primary)) { 1091 if (!strlen(primary)) {
1105 pr_info("%s: Setting primary slave to None\n", bond->dev->name); 1092 netdev_info(bond->dev, "Setting primary slave to None\n");
1106 bond->primary_slave = NULL; 1093 bond->primary_slave = NULL;
1107 memset(bond->params.primary, 0, sizeof(bond->params.primary)); 1094 memset(bond->params.primary, 0, sizeof(bond->params.primary));
1108 bond_select_active_slave(bond); 1095 bond_select_active_slave(bond);
@@ -1111,8 +1098,8 @@ static int bond_option_primary_set(struct bonding *bond,
1111 1098
1112 bond_for_each_slave(bond, slave, iter) { 1099 bond_for_each_slave(bond, slave, iter) {
1113 if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) { 1100 if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
1114 pr_info("%s: Setting %s as primary slave\n", 1101 netdev_info(bond->dev, "Setting %s as primary slave\n",
1115 bond->dev->name, slave->dev->name); 1102 slave->dev->name);
1116 bond->primary_slave = slave; 1103 bond->primary_slave = slave;
1117 strcpy(bond->params.primary, slave->dev->name); 1104 strcpy(bond->params.primary, slave->dev->name);
1118 bond_select_active_slave(bond); 1105 bond_select_active_slave(bond);
@@ -1121,15 +1108,15 @@ static int bond_option_primary_set(struct bonding *bond,
1121 } 1108 }
1122 1109
1123 if (bond->primary_slave) { 1110 if (bond->primary_slave) {
1124 pr_info("%s: Setting primary slave to None\n", bond->dev->name); 1111 netdev_info(bond->dev, "Setting primary slave to None\n");
1125 bond->primary_slave = NULL; 1112 bond->primary_slave = NULL;
1126 bond_select_active_slave(bond); 1113 bond_select_active_slave(bond);
1127 } 1114 }
1128 strncpy(bond->params.primary, primary, IFNAMSIZ); 1115 strncpy(bond->params.primary, primary, IFNAMSIZ);
1129 bond->params.primary[IFNAMSIZ - 1] = 0; 1116 bond->params.primary[IFNAMSIZ - 1] = 0;
1130 1117
1131 pr_info("%s: Recording %s as primary, but it has not been enslaved to %s yet\n", 1118 netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
1132 bond->dev->name, primary, bond->dev->name); 1119 primary, bond->dev->name);
1133 1120
1134out: 1121out:
1135 write_unlock_bh(&bond->curr_slave_lock); 1122 write_unlock_bh(&bond->curr_slave_lock);
@@ -1142,8 +1129,8 @@ out:
1142static int bond_option_primary_reselect_set(struct bonding *bond, 1129static int bond_option_primary_reselect_set(struct bonding *bond,
1143 const struct bond_opt_value *newval) 1130 const struct bond_opt_value *newval)
1144{ 1131{
1145 pr_info("%s: Setting primary_reselect to %s (%llu)\n", 1132 netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
1146 bond->dev->name, newval->string, newval->value); 1133 newval->string, newval->value);
1147 bond->params.primary_reselect = newval->value; 1134 bond->params.primary_reselect = newval->value;
1148 1135
1149 block_netpoll_tx(); 1136 block_netpoll_tx();
@@ -1158,8 +1145,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
1158static int bond_option_fail_over_mac_set(struct bonding *bond, 1145static int bond_option_fail_over_mac_set(struct bonding *bond,
1159 const struct bond_opt_value *newval) 1146 const struct bond_opt_value *newval)
1160{ 1147{
1161 pr_info("%s: Setting fail_over_mac to %s (%llu)\n", 1148 netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
1162 bond->dev->name, newval->string, newval->value); 1149 newval->string, newval->value);
1163 bond->params.fail_over_mac = newval->value; 1150 bond->params.fail_over_mac = newval->value;
1164 1151
1165 return 0; 1152 return 0;
@@ -1168,8 +1155,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
1168static int bond_option_xmit_hash_policy_set(struct bonding *bond, 1155static int bond_option_xmit_hash_policy_set(struct bonding *bond,
1169 const struct bond_opt_value *newval) 1156 const struct bond_opt_value *newval)
1170{ 1157{
1171 pr_info("%s: Setting xmit hash policy to %s (%llu)\n", 1158 netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
1172 bond->dev->name, newval->string, newval->value); 1159 newval->string, newval->value);
1173 bond->params.xmit_policy = newval->value; 1160 bond->params.xmit_policy = newval->value;
1174 1161
1175 return 0; 1162 return 0;
@@ -1178,8 +1165,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
1178static int bond_option_resend_igmp_set(struct bonding *bond, 1165static int bond_option_resend_igmp_set(struct bonding *bond,
1179 const struct bond_opt_value *newval) 1166 const struct bond_opt_value *newval)
1180{ 1167{
1181 pr_info("%s: Setting resend_igmp to %llu\n", 1168 netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
1182 bond->dev->name, newval->value); 1169 newval->value);
1183 bond->params.resend_igmp = newval->value; 1170 bond->params.resend_igmp = newval->value;
1184 1171
1185 return 0; 1172 return 0;
@@ -1217,8 +1204,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
1217static int bond_option_min_links_set(struct bonding *bond, 1204static int bond_option_min_links_set(struct bonding *bond,
1218 const struct bond_opt_value *newval) 1205 const struct bond_opt_value *newval)
1219{ 1206{
1220 pr_info("%s: Setting min links value to %llu\n", 1207 netdev_info(bond->dev, "Setting min links value to %llu\n",
1221 bond->dev->name, newval->value); 1208 newval->value);
1222 bond->params.min_links = newval->value; 1209 bond->params.min_links = newval->value;
1223 1210
1224 return 0; 1211 return 0;
@@ -1253,8 +1240,8 @@ static int bond_option_pps_set(struct bonding *bond,
1253static int bond_option_lacp_rate_set(struct bonding *bond, 1240static int bond_option_lacp_rate_set(struct bonding *bond,
1254 const struct bond_opt_value *newval) 1241 const struct bond_opt_value *newval)
1255{ 1242{
1256 pr_info("%s: Setting LACP rate to %s (%llu)\n", 1243 netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
1257 bond->dev->name, newval->string, newval->value); 1244 newval->string, newval->value);
1258 bond->params.lacp_fast = newval->value; 1245 bond->params.lacp_fast = newval->value;
1259 bond_3ad_update_lacp_rate(bond); 1246 bond_3ad_update_lacp_rate(bond);
1260 1247
@@ -1264,8 +1251,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
1264static int bond_option_ad_select_set(struct bonding *bond, 1251static int bond_option_ad_select_set(struct bonding *bond,
1265 const struct bond_opt_value *newval) 1252 const struct bond_opt_value *newval)
1266{ 1253{
1267 pr_info("%s: Setting ad_select to %s (%llu)\n", 1254 netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
1268 bond->dev->name, newval->string, newval->value); 1255 newval->string, newval->value);
1269 bond->params.ad_select = newval->value; 1256 bond->params.ad_select = newval->value;
1270 1257
1271 return 0; 1258 return 0;
@@ -1326,7 +1313,7 @@ out:
1326 return ret; 1313 return ret;
1327 1314
1328err_no_cmd: 1315err_no_cmd:
1329 pr_info("invalid input for queue_id set for %s\n", bond->dev->name); 1316 netdev_info(bond->dev, "invalid input for queue_id set\n");
1330 ret = -EPERM; 1317 ret = -EPERM;
1331 goto out; 1318 goto out;
1332 1319
@@ -1348,20 +1335,20 @@ static int bond_option_slaves_set(struct bonding *bond,
1348 1335
1349 dev = __dev_get_by_name(dev_net(bond->dev), ifname); 1336 dev = __dev_get_by_name(dev_net(bond->dev), ifname);
1350 if (!dev) { 1337 if (!dev) {
1351 pr_info("%s: interface %s does not exist!\n", 1338 netdev_info(bond->dev, "interface %s does not exist!\n",
1352 bond->dev->name, ifname); 1339 ifname);
1353 ret = -ENODEV; 1340 ret = -ENODEV;
1354 goto out; 1341 goto out;
1355 } 1342 }
1356 1343
1357 switch (command[0]) { 1344 switch (command[0]) {
1358 case '+': 1345 case '+':
1359 pr_info("%s: Adding slave %s\n", bond->dev->name, dev->name); 1346 netdev_info(bond->dev, "Adding slave %s\n", dev->name);
1360 ret = bond_enslave(bond->dev, dev); 1347 ret = bond_enslave(bond->dev, dev);
1361 break; 1348 break;
1362 1349
1363 case '-': 1350 case '-':
1364 pr_info("%s: Removing slave %s\n", bond->dev->name, dev->name); 1351 netdev_info(bond->dev, "Removing slave %s\n", dev->name);
1365 ret = bond_release(bond->dev, dev); 1352 ret = bond_release(bond->dev, dev);
1366 break; 1353 break;
1367 1354
@@ -1373,8 +1360,7 @@ out:
1373 return ret; 1360 return ret;
1374 1361
1375err_no_cmd: 1362err_no_cmd:
1376 pr_err("no command found in slaves file for bond %s - use +ifname or -ifname\n", 1363 netdev_err(bond->dev, "no command found in slaves file - use +ifname or -ifname\n");
1377 bond->dev->name);
1378 ret = -EPERM; 1364 ret = -EPERM;
1379 goto out; 1365 goto out;
1380} 1366}
@@ -1382,8 +1368,8 @@ err_no_cmd:
1382static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, 1368static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
1383 const struct bond_opt_value *newval) 1369 const struct bond_opt_value *newval)
1384{ 1370{
1385 pr_info("%s: Setting dynamic-lb to %s (%llu)\n", 1371 netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
1386 bond->dev->name, newval->string, newval->value); 1372 newval->string, newval->value);
1387 bond->params.tlb_dynamic_lb = newval->value; 1373 bond->params.tlb_dynamic_lb = newval->value;
1388 1374
1389 return 0; 1375 return 0;