search for: kernel_param

Displaying 20 results from an estimated 40 matches for "kernel_param".

2014 Mar 17
2
[PATCH] virtio-blk: make the queue depth configurable
...;> 6) < (((perm) >> 3) & 7)) \ > + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ > static const char __param_str_##name[] = prefix #name; \ > static struct kernel_param __moduleparam_const __param_##name \ It might make sense to separate this octal permissions test into a new macro for other checks in macros like CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. Maybe something like: #define VERIFY_OCTAL_PERMISSIONS(perm) \ static int __param_perm_ch...
2014 Mar 17
2
[PATCH] virtio-blk: make the queue depth configurable
...;> 6) < (((perm) >> 3) & 7)) \ > + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ > static const char __param_str_##name[] = prefix #name; \ > static struct kernel_param __moduleparam_const __param_##name \ It might make sense to separate this octal permissions test into a new macro for other checks in macros like CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. Maybe something like: #define VERIFY_OCTAL_PERMISSIONS(perm) \ static int __param_perm_ch...
2014 Mar 19
5
[PATCH] virtio-blk: make the queue depth configurable
...amp; 7)) \ >> > + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ >> > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ >> > static const char __param_str_##name[] = prefix #name; \ >> > static struct kernel_param __moduleparam_const __param_##name \ >> >> It might make sense to separate this octal permissions >> test into a new macro for other checks in macros like >> CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. OK, I took your bikeshed and re-painted it below. > #de...
2014 Mar 19
5
[PATCH] virtio-blk: make the queue depth configurable
...amp; 7)) \ >> > + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ >> > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ >> > static const char __param_str_##name[] = prefix #name; \ >> > static struct kernel_param __moduleparam_const __param_##name \ >> >> It might make sense to separate this octal permissions >> test into a new macro for other checks in macros like >> CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. OK, I took your bikeshed and re-painted it below. > #de...
2018 Apr 05
0
[RFC PATCH 2/2] virtio_blk: add new module parameter to set max request size
...--git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 4a07593c..5ac6d59 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -64,6 +64,34 @@ struct virtblk_req { struct scatterlist sg[]; }; + +static int max_request_size_set(const char *val, const struct kernel_param *kp); + +static const struct kernel_param_ops max_request_size_ops = { + .set = max_request_size_set, + .get = param_get_uint, +}; + +static unsigned long max_request_size = 4096; /* in unit of KiB */ +module_param_cb(max_request_size, &max_request_size_ops, &max_request_size, + 0444); +MO...
2014 Mar 14
2
[PATCH] virtio-blk: make the queue depth configurable
On Fri, Mar 14, 2014 at 10:38:40AM -0700, Joe Perches wrote: > > +static int queue_depth = 64; > > +module_param(queue_depth, int, 444); > > 444? Really Ted? Oops, *blush*. Thanks for catching that. - Ted
2014 Mar 14
2
[PATCH] virtio-blk: make the queue depth configurable
On Fri, Mar 14, 2014 at 10:38:40AM -0700, Joe Perches wrote: > > +static int queue_depth = 64; > > +module_param(queue_depth, int, 444); > > 444? Really Ted? Oops, *blush*. Thanks for catching that. - Ted
2014 Mar 19
0
[PATCH] virtio-blk: make the queue depth configurable
...LD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ >>> > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ >>> > static const char __param_str_##name[] = prefix #name; \ >>> > static struct kernel_param __moduleparam_const __param_##name \ >>> >>> It might make sense to separate this octal permissions >>> test into a new macro for other checks in macros like >>> CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. > > OK, I took your bikeshed and re-p...
2017 May 26
2
[RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value
...orrect it before notification. + */ + if (!bios_notify && + lid_init_state != ACPI_BUTTON_LID_INIT_METHOD) + state = acpi_lid_evaluate_state(device); + } acpi_lid_notifier_call(device, state); } @@ -572,10 +584,10 @@ static int param_set_lid_init_state(const char *val, struct kernel_param *kp) if (!strncmp(val, "open", sizeof("open") - 1)) { lid_init_state = ACPI_BUTTON_LID_INIT_OPEN; - pr_info("Notify initial lid state as open\n"); + pr_info("Notify initial lid state to users space as open and kernel drivers with _LID return value\n"...
2019 May 13
2
[PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable
...virtio_transport.c > +++ b/net/vmw_vsock/virtio_transport.c > @@ -66,6 +66,31 @@ struct virtio_vsock { > u32 guest_cid; > }; > > +static unsigned int rx_buf_size = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; > + > +static int param_set_rx_buf_size(const char *val, const struct kernel_param *kp) > +{ > + unsigned int size; > + int ret; > + > + ret = kstrtouint(val, 0, &size); > + if (ret) > + return ret; > + > + if (size < VIRTIO_VSOCK_MIN_PKT_BUF_SIZE || > + size > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) > + return -EINVAL; > + > + return...
2019 May 13
2
[PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable
...virtio_transport.c > +++ b/net/vmw_vsock/virtio_transport.c > @@ -66,6 +66,31 @@ struct virtio_vsock { > u32 guest_cid; > }; > > +static unsigned int rx_buf_size = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; > + > +static int param_set_rx_buf_size(const char *val, const struct kernel_param *kp) > +{ > + unsigned int size; > + int ret; > + > + ret = kstrtouint(val, 0, &size); > + if (ret) > + return ret; > + > + if (size < VIRTIO_VSOCK_MIN_PKT_BUF_SIZE || > + size > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) > + return -EINVAL; > + > + return...
2012 May 09
1
[PATCH] virtio-mmio: Devices parameter parsing
...t parameter */ + +#if defined(CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES) + +static struct device vm_cmdline_parent = { + .init_name = "virtio-mmio-cmdline", +}; + +static int vm_cmdline_parent_registered; +static int vm_cmdline_id; + +static int vm_cmdline_set(const char *device, + const struct kernel_param *kp) +{ + int err; + struct resource resources[2] = {}; + char *str; + long long int base; + int processed, consumed = 0; + struct platform_device *pdev; + + resources[0].flags = IORESOURCE_MEM; + resources[1].flags = IORESOURCE_IRQ; + + resources[0].end = memparse(device, &str) - 1; + + proces...
2012 May 09
1
[PATCH] virtio-mmio: Devices parameter parsing
...t parameter */ + +#if defined(CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES) + +static struct device vm_cmdline_parent = { + .init_name = "virtio-mmio-cmdline", +}; + +static int vm_cmdline_parent_registered; +static int vm_cmdline_id; + +static int vm_cmdline_set(const char *device, + const struct kernel_param *kp) +{ + int err; + struct resource resources[2] = {}; + char *str; + long long int base; + int processed, consumed = 0; + struct platform_device *pdev; + + resources[0].flags = IORESOURCE_MEM; + resources[1].flags = IORESOURCE_IRQ; + + resources[0].end = memparse(device, &str) - 1; + + proces...
2018 Apr 05
5
[RFC PATCH 0/2] use larger max_request_size for virtio_blk
Hi, For virtio block device, actually there is no a hard limit for max request size, and virtio_blk driver set -1 to blk_queue_max_hw_sectors(q, -1U);. But it doesn't work, because there is a default upper limitation BLK_DEF_MAX_SECTORS (1280 sectors). So this series want to add a new helper blk_queue_max_hw_sectors_no_limit to set a proper max reqeust size. Weiping Zhang (2): blk-setting:
2018 Apr 05
5
[RFC PATCH 0/2] use larger max_request_size for virtio_blk
Hi, For virtio block device, actually there is no a hard limit for max request size, and virtio_blk driver set -1 to blk_queue_max_hw_sectors(q, -1U);. But it doesn't work, because there is a default upper limitation BLK_DEF_MAX_SECTORS (1280 sectors). So this series want to add a new helper blk_queue_max_hw_sectors_no_limit to set a proper max reqeust size. Weiping Zhang (2): blk-setting:
2019 May 10
0
[PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable
...4..732398b4e28f 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -66,6 +66,31 @@ struct virtio_vsock { u32 guest_cid; }; +static unsigned int rx_buf_size = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; + +static int param_set_rx_buf_size(const char *val, const struct kernel_param *kp) +{ + unsigned int size; + int ret; + + ret = kstrtouint(val, 0, &size); + if (ret) + return ret; + + if (size < VIRTIO_VSOCK_MIN_PKT_BUF_SIZE || + size > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) + return -EINVAL; + + return param_set_uint(val, kp); +}; + +static const struct kernel_param...
2019 May 13
0
[PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable
...et/vmw_vsock/virtio_transport.c >> @@ -66,6 +66,31 @@ struct virtio_vsock { >> ????? u32 guest_cid; >> ? }; >> ? +static unsigned int rx_buf_size = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; >> + >> +static int param_set_rx_buf_size(const char *val, const struct >> kernel_param *kp) >> +{ >> +??? unsigned int size; >> +??? int ret; >> + >> +??? ret = kstrtouint(val, 0, &size); >> +??? if (ret) >> +??????? return ret; >> + >> +??? if (size < VIRTIO_VSOCK_MIN_PKT_BUF_SIZE || >> +??????? size > VIRTIO_VSOC...
2014 Mar 17
0
[PATCH] virtio-blk: make the queue depth configurable
..._ON_ZERO(((perm) >> 6) < (((perm) >> 3) & 7)) \ + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ static const char __param_str_##name[] = prefix #name; \ static struct kernel_param __moduleparam_const __param_##name \
2014 Mar 17
0
[PATCH] virtio-blk: make the queue depth configurable
...m) >> 3) & 7)) \ > > + + BUILD_BUG_ON_ZERO((((perm) >> 3) & 7) < ((perm) & 7)) \ > > + BUILD_BUG_ON_ZERO(sizeof(""prefix) > MAX_PARAM_PREFIX_LEN); \ > > static const char __param_str_##name[] = prefix #name; \ > > static struct kernel_param __moduleparam_const __param_##name \ > > It might make sense to separate this octal permissions > test into a new macro for other checks in macros like > CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2. > > Maybe something like: > > #define VERIFY_OCTAL_PERMISSIONS...
2017 May 29
0
[RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value
...t; + if (!bios_notify && > + lid_init_state != ACPI_BUTTON_LID_INIT_METHOD) > + state = acpi_lid_evaluate_state(device); > + } > acpi_lid_notifier_call(device, state); > } > > @@ -572,10 +584,10 @@ static int param_set_lid_init_state(const char *val, struct kernel_param *kp) > > if (!strncmp(val, "open", sizeof("open") - 1)) { > lid_init_state = ACPI_BUTTON_LID_INIT_OPEN; > - pr_info("Notify initial lid state as open\n"); > + pr_info("Notify initial lid state to users space as open and kernel drivers with...