Lines Matching refs:buf

129 			   struct device_attribute *attr, char *buf,  in netdev_show()  argument
137 ret = (*format)(ndev, buf); in netdev_show()
145 static ssize_t format_##field(const struct net_device *dev, char *buf) \
147 return sysfs_emit(buf, format_string, READ_ONCE(dev->field)); \
150 struct device_attribute *attr, char *buf) \
152 return netdev_show(dev, attr, buf, format_##field); \
165 const char *buf, size_t len, in netdev_store() argument
176 ret = kstrtoul(buf, 0, &new); in netdev_store()
196 const char *buf, size_t len, in netdev_lock_store() argument
207 ret = kstrtoul(buf, 0, &new); in netdev_lock_store()
232 char *buf) in iflink_show() argument
236 return sysfs_emit(buf, fmt_dec, dev_get_iflink(ndev)); in iflink_show()
240 static ssize_t format_name_assign_type(const struct net_device *dev, char *buf) in format_name_assign_type() argument
242 return sysfs_emit(buf, fmt_dec, READ_ONCE(dev->name_assign_type)); in format_name_assign_type()
247 char *buf) in name_assign_type_show() argument
253 ret = netdev_show(dev, attr, buf, format_name_assign_type); in name_assign_type_show()
261 char *buf) in address_show() argument
270 ret = sysfs_format_mac(buf, ndev->dev_addr, ndev->addr_len); in address_show()
279 struct device_attribute *attr, char *buf) in broadcast_show() argument
286 ret = sysfs_format_mac(buf, ndev->broadcast, ndev->addr_len); in broadcast_show()
300 const char *buf, size_t len) in carrier_store() argument
310 return netdev_store(dev, attr, buf, len, change_carrier); in carrier_store()
314 struct device_attribute *attr, char *buf) in carrier_show() argument
330 ret = sysfs_emit(buf, fmt_dec, !!netif_carrier_ok(netdev)); in carrier_show()
339 struct device_attribute *attr, char *buf) in speed_show() argument
359 ret = sysfs_emit(buf, fmt_dec, cmd.base.speed); in speed_show()
367 struct device_attribute *attr, char *buf) in duplex_show() argument
400 ret = sysfs_emit(buf, "%s\n", duplex); in duplex_show()
409 struct device_attribute *attr, char *buf) in testing_show() argument
414 return sysfs_emit(buf, fmt_dec, !!netif_testing(netdev)); in testing_show()
421 struct device_attribute *attr, char *buf) in dormant_show() argument
426 return sysfs_emit(buf, fmt_dec, !!netif_dormant(netdev)); in dormant_show()
443 struct device_attribute *attr, char *buf) in operstate_show() argument
455 return sysfs_emit(buf, "%s\n", operstates[operstate]); in operstate_show()
461 char *buf) in carrier_changes_show() argument
465 return sysfs_emit(buf, fmt_dec, in carrier_changes_show()
473 char *buf) in carrier_up_count_show() argument
477 return sysfs_emit(buf, fmt_dec, atomic_read(&netdev->carrier_up_count)); in carrier_up_count_show()
483 char *buf) in carrier_down_count_show() argument
487 return sysfs_emit(buf, fmt_dec, atomic_read(&netdev->carrier_down_count)); in carrier_down_count_show()
499 const char *buf, size_t len) in mtu_store() argument
501 return netdev_store(dev, attr, buf, len, change_mtu); in mtu_store()
511 const char *buf, size_t len) in flags_store() argument
513 return netdev_store(dev, attr, buf, len, change_flags); in flags_store()
519 const char *buf, size_t len) in tx_queue_len_store() argument
524 return netdev_store(dev, attr, buf, len, dev_change_tx_queue_len); in tx_queue_len_store()
536 const char *buf, size_t len) in gro_flush_timeout_store() argument
541 return netdev_lock_store(dev, attr, buf, len, change_gro_flush_timeout); in gro_flush_timeout_store()
556 const char *buf, size_t len) in napi_defer_hard_irqs_store() argument
561 return netdev_lock_store(dev, attr, buf, len, in napi_defer_hard_irqs_store()
567 const char *buf, size_t len) in ifalias_store() argument
578 if (len > 0 && buf[len - 1] == '\n') in ifalias_store()
585 ret = dev_set_alias(netdev, buf, count); in ifalias_store()
597 struct device_attribute *attr, char *buf) in ifalias_show() argument
605 ret = sysfs_emit(buf, "%s\n", tmp); in ifalias_show()
617 const char *buf, size_t len) in group_store() argument
619 return netdev_store(dev, attr, buf, len, change_group); in group_store()
631 const char *buf, size_t len) in proto_down_store() argument
633 return netdev_store(dev, attr, buf, len, change_proto_down); in proto_down_store()
638 struct device_attribute *attr, char *buf) in phys_port_id_show() argument
650 ret = sysfs_emit(buf, "%*phN\n", ppid.id_len, ppid.id); in phys_port_id_show()
659 struct device_attribute *attr, char *buf) in phys_port_name_show() argument
671 ret = sysfs_emit(buf, "%s\n", name); in phys_port_name_show()
680 struct device_attribute *attr, char *buf) in phys_switch_id_show() argument
692 ret = sysfs_emit(buf, "%*phN\n", ppid.id_len, ppid.id); in phys_switch_id_show()
735 struct device_attribute *attr, char *buf) in threaded_show() argument
743 ret = sysfs_emit(buf, fmt_dec, READ_ONCE(netdev->threaded)); in threaded_show()
767 const char *buf, size_t len) in threaded_store() argument
769 return netdev_lock_store(dev, attr, buf, len, modify_napi_threaded); in threaded_store()
809 struct device_attribute *attr, char *buf, in netstat_show() argument
823 ret = sysfs_emit(buf, fmt_u64, *(u64 *)(((u8 *)stats) + offset)); in netstat_show()
832 struct device_attribute *attr, char *buf) \
834 return netstat_show(d, attr, buf, \
930 char *buf) in rx_queue_attr_show() argument
938 return attribute->show(queue, buf); in rx_queue_attr_show()
942 const char *buf, size_t count) in rx_queue_attr_store() argument
950 return attribute->store(queue, buf, count); in rx_queue_attr_store()
959 static ssize_t show_rps_map(struct netdev_rx_queue *queue, char *buf) in show_rps_map() argument
974 len = sysfs_emit(buf, "%*pb\n", cpumask_pr_args(mask)); in show_rps_map()
1034 const char *buf, size_t len) in store_rps_map() argument
1045 err = bitmap_parse(buf, len, cpumask_bits(mask), nr_cpumask_bits); in store_rps_map()
1061 char *buf) in show_rps_dev_flow_table_cnt() argument
1072 return sysfs_emit(buf, "%lu\n", val); in show_rps_dev_flow_table_cnt()
1083 const char *buf, size_t len) in store_rps_dev_flow_table_cnt() argument
1093 rc = kstrtoul(buf, 0, &count); in store_rps_dev_flow_table_cnt()
1375 struct netdev_queue *queue, char *buf);
1377 struct netdev_queue *queue, const char *buf,
1386 struct attribute *attr, char *buf) in netdev_queue_attr_show() argument
1395 return attribute->show(kobj, attr, queue, buf); in netdev_queue_attr_show()
1400 const char *buf, size_t count) in netdev_queue_attr_store() argument
1409 return attribute->store(kobj, attr, queue, buf, count); in netdev_queue_attr_store()
1418 struct netdev_queue *queue, char *buf) in tx_timeout_show() argument
1422 return sysfs_emit(buf, fmt_ulong, trans_timeout); in tx_timeout_show()
1437 struct netdev_queue *queue, char *buf) in traffic_class_show() argument
1469 return num_tc < 0 ? sysfs_emit(buf, "%d%d\n", tc, num_tc) : in traffic_class_show()
1470 sysfs_emit(buf, "%d\n", tc); in traffic_class_show()
1475 struct netdev_queue *queue, char *buf) in tx_maxrate_show() argument
1477 return sysfs_emit(buf, "%lu\n", queue->tx_maxrate); in tx_maxrate_show()
1481 struct netdev_queue *queue, const char *buf, in tx_maxrate_store() argument
1497 err = kstrtou32(buf, 10, &rate); in tx_maxrate_store()
1535 static ssize_t bql_show(char *buf, unsigned int value) in bql_show() argument
1537 return sysfs_emit(buf, "%u\n", value); in bql_show()
1540 static ssize_t bql_set(const char *buf, const size_t count, in bql_set() argument
1546 if (!strcmp(buf, "max") || !strcmp(buf, "max\n")) { in bql_set()
1549 err = kstrtouint(buf, 10, &value); in bql_set()
1562 struct netdev_queue *queue, char *buf) in bql_show_hold_time() argument
1566 return sysfs_emit(buf, "%u\n", jiffies_to_msecs(dql->slack_hold_time)); in bql_show_hold_time()
1570 struct netdev_queue *queue, const char *buf, in bql_set_hold_time() argument
1577 err = kstrtouint(buf, 10, &value); in bql_set_hold_time()
1591 struct netdev_queue *queue, char *buf) in bql_show_stall_thrs() argument
1595 return sysfs_emit(buf, "%u\n", jiffies_to_msecs(dql->stall_thrs)); in bql_show_stall_thrs()
1599 struct netdev_queue *queue, const char *buf, in bql_set_stall_thrs() argument
1606 err = kstrtouint(buf, 10, &value); in bql_set_stall_thrs()
1627 struct netdev_queue *queue, char *buf) in bql_show_stall_max() argument
1629 return sysfs_emit(buf, "%u\n", READ_ONCE(queue->dql.stall_max)); in bql_show_stall_max()
1633 struct netdev_queue *queue, const char *buf, in bql_set_stall_max() argument
1644 struct netdev_queue *queue, char *buf) in bql_show_stall_cnt() argument
1648 return sysfs_emit(buf, "%lu\n", dql->stall_cnt); in bql_show_stall_cnt()
1655 struct netdev_queue *queue, char *buf) in bql_show_inflight() argument
1659 return sysfs_emit(buf, "%u\n", dql->num_queued - dql->num_completed); in bql_show_inflight()
1668 struct netdev_queue *queue, char *buf) \
1670 return bql_show(buf, queue->dql.FIELD); \
1676 const char *buf, size_t len) \
1678 return bql_set(buf, len, &queue->dql.FIELD); \
1712 int tc, char *buf, enum xps_map_type type) in xps_queue_show() argument
1755 len = bitmap_print_to_pagebuf(false, buf, mask, nr_ids); in xps_queue_show()
1762 struct netdev_queue *queue, char *buf) in xps_cpus_show() argument
1792 len = xps_queue_show(dev, index, tc, buf, XPS_CPUS); in xps_cpus_show()
1799 struct netdev_queue *queue, const char *buf, in xps_cpus_store() argument
1818 err = bitmap_parse(buf, len, cpumask_bits(mask), nr_cpumask_bits); in xps_cpus_store()
1842 struct netdev_queue *queue, char *buf) in xps_rxqs_show() argument
1862 ret = tc >= 0 ? xps_queue_show(dev, index, tc, buf, XPS_RXQS) : -EINVAL; in xps_rxqs_show()
1868 struct netdev_queue *queue, const char *buf, in xps_rxqs_store() argument
1886 err = bitmap_parse(buf, len, mask, dev->num_rx_queues); in xps_rxqs_store()