Lines 81-86
Link Here
|
81 |
struct virtio_scsi_config *); |
81 |
struct virtio_scsi_config *); |
82 |
static int vtscsi_maximum_segments(struct vtscsi_softc *, int); |
82 |
static int vtscsi_maximum_segments(struct vtscsi_softc *, int); |
83 |
static int vtscsi_alloc_virtqueues(struct vtscsi_softc *); |
83 |
static int vtscsi_alloc_virtqueues(struct vtscsi_softc *); |
|
|
84 |
static void vtscsi_check_sizes(struct vtscsi_softc *); |
84 |
static void vtscsi_write_device_config(struct vtscsi_softc *); |
85 |
static void vtscsi_write_device_config(struct vtscsi_softc *); |
85 |
static int vtscsi_reinit(struct vtscsi_softc *); |
86 |
static int vtscsi_reinit(struct vtscsi_softc *); |
86 |
|
87 |
|
Lines 311-316
Link Here
|
311 |
goto fail; |
312 |
goto fail; |
312 |
} |
313 |
} |
313 |
|
314 |
|
|
|
315 |
vtscsi_check_sizes(sc); |
316 |
|
314 |
error = vtscsi_init_event_vq(sc); |
317 |
error = vtscsi_init_event_vq(sc); |
315 |
if (error) { |
318 |
if (error) { |
316 |
device_printf(dev, "cannot populate the eventvq\n"); |
319 |
device_printf(dev, "cannot populate the eventvq\n"); |
Lines 478-483
Link Here
|
478 |
} |
481 |
} |
479 |
|
482 |
|
480 |
static void |
483 |
static void |
|
|
484 |
vtscsi_check_sizes(struct vtscsi_softc *sc) |
485 |
{ |
486 |
int rqsize; |
487 |
|
488 |
if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) { |
489 |
/* |
490 |
* Ensure the assertions in virtqueue_enqueue(), |
491 |
* even if the hypervisor reports a bad seg_max. |
492 |
*/ |
493 |
rqsize = virtqueue_size(sc->vtscsi_request_vq); |
494 |
if (sc->vtscsi_max_nsegs > rqsize) { |
495 |
device_printf(sc->vtscsi_dev, |
496 |
"clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs, |
497 |
rqsize); |
498 |
sc->vtscsi_max_nsegs = rqsize; |
499 |
} |
500 |
} |
501 |
} |
502 |
|
503 |
static void |
481 |
vtscsi_write_device_config(struct vtscsi_softc *sc) |
504 |
vtscsi_write_device_config(struct vtscsi_softc *sc) |
482 |
{ |
505 |
{ |
483 |
|
506 |
|