]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/bonding/bond_sysfs.c
bonding: Allow userspace to set actors' system_priority in AD system
[karo-tx-linux.git] / drivers / net / bonding / bond_sysfs.c
index 7e9e151d4d6168821e28ef82e8c197b2c4666b87..4a7626611ca64b1b023c6253912b29c9a281ee77 100644 (file)
@@ -692,6 +692,20 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
 static DEVICE_ATTR(packets_per_slave, S_IRUGO | S_IWUSR,
                   bonding_show_packets_per_slave, bonding_sysfs_store_option);
 
+static ssize_t bonding_show_ad_actor_sys_prio(struct device *d,
+                                             struct device_attribute *attr,
+                                             char *buf)
+{
+       struct bonding *bond = to_bond(d);
+
+       if (BOND_MODE(bond) == BOND_MODE_8023AD)
+               return sprintf(buf, "%hu\n", bond->params.ad_actor_sys_prio);
+
+       return 0;
+}
+static DEVICE_ATTR(ad_actor_sys_prio, S_IRUGO | S_IWUSR,
+                  bonding_show_ad_actor_sys_prio, bonding_sysfs_store_option);
+
 static struct attribute *per_bond_attrs[] = {
        &dev_attr_slaves.attr,
        &dev_attr_mode.attr,
@@ -725,6 +739,7 @@ static struct attribute *per_bond_attrs[] = {
        &dev_attr_lp_interval.attr,
        &dev_attr_packets_per_slave.attr,
        &dev_attr_tlb_dynamic_lb.attr,
+       &dev_attr_ad_actor_sys_prio.attr,
        NULL,
 };