|
51 | 51 | */
|
52 | 52 | #define VHOST_SCSI_MAX_RESP_IOVS sizeof(struct virtio_scsi_cmd_resp)
|
53 | 53 |
|
54 |
| -static unsigned int vhost_scsi_inline_sg_cnt = VHOST_SCSI_PREALLOC_SGLS; |
| 54 | +static unsigned int vhost_scsi_inline_sg_cnt = UINT_MAX; |
55 | 55 |
|
56 | 56 | #ifdef CONFIG_ARCH_NO_SG_CHAIN
|
57 | 57 | static int vhost_scsi_set_inline_sg_cnt(const char *buf,
|
@@ -199,10 +199,11 @@ enum {
|
199 | 199 | };
|
200 | 200 |
|
201 | 201 | #define VHOST_SCSI_MAX_TARGET 256
|
| 202 | +#define VHOST_SCSI_DEF_IO_VQ 128 |
202 | 203 | #define VHOST_SCSI_MAX_IO_VQ 1024
|
203 | 204 | #define VHOST_SCSI_MAX_EVENT 128
|
204 | 205 |
|
205 |
| -static unsigned vhost_scsi_max_io_vqs = 128; |
| 206 | +static unsigned vhost_scsi_max_io_vqs = UINT_MAX; |
206 | 207 | module_param_named(max_io_vqs, vhost_scsi_max_io_vqs, uint, 0644);
|
207 | 208 | MODULE_PARM_DESC(max_io_vqs, "Set the max number of IO virtqueues a vhost scsi device can support. The default is 128. The max is 1024.");
|
208 | 209 |
|
@@ -2811,6 +2812,35 @@ static int __init vhost_scsi_init(void)
|
2811 | 2812 | {
|
2812 | 2813 | int ret = -ENOMEM;
|
2813 | 2814 |
|
| 2815 | + |
| 2816 | + if (static_branch_unlikely(&on_exadata)) { |
| 2817 | + /* |
| 2818 | + * We can't change the upstream default because existing users |
| 2819 | + * with more than 1 queue will hit failures during device |
| 2820 | + * setup. Exadata has never used vhost-scsi before so it's ok |
| 2821 | + * to start them at 1 so they can use as little mem as possible |
| 2822 | + * initially. |
| 2823 | + */ |
| 2824 | + if (vhost_scsi_max_io_vqs == UINT_MAX) |
| 2825 | + vhost_scsi_max_io_vqs = 1; |
| 2826 | + /* |
| 2827 | + * We have not changed the upstream default because there's |
| 2828 | + * a chance of a perf regression if there are users doing |
| 2829 | + * muiltiple LUNs per vhost-scsi device and using high perf |
| 2830 | + * devices for the backends. For exadata we use 0, because |
| 2831 | + * their primary concern is memory use. |
| 2832 | + */ |
| 2833 | + if (vhost_scsi_inline_sg_cnt == UINT_MAX) |
| 2834 | + vhost_scsi_inline_sg_cnt = 0; |
| 2835 | + } else { |
| 2836 | + if (vhost_scsi_max_io_vqs == UINT_MAX) |
| 2837 | + vhost_scsi_max_io_vqs = VHOST_SCSI_DEF_IO_VQ; |
| 2838 | + |
| 2839 | + if (vhost_scsi_inline_sg_cnt == UINT_MAX) |
| 2840 | + vhost_scsi_inline_sg_cnt = VHOST_SCSI_PREALLOC_SGLS; |
| 2841 | + } |
| 2842 | + |
| 2843 | + |
2814 | 2844 | pr_debug("TCM_VHOST fabric module %s on %s/%s"
|
2815 | 2845 | " on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname,
|
2816 | 2846 | utsname()->machine);
|
|
0 commit comments