summaryrefslogtreecommitdiffstats
path: root/sys/dev/xen
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/xen')
-rw-r--r--sys/dev/xen/blkfront/blkfront.c28
-rw-r--r--sys/dev/xen/blkfront/block.h7
-rw-r--r--sys/dev/xen/netfront/netfront.c7
3 files changed, 31 insertions, 11 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index d35e04a..ef36b94 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -855,6 +855,20 @@ xbd_feature_string(struct xbd_softc *sc, char *features, size_t len)
feature_cnt++;
}
+ if ((sc->xbd_flags & XBDF_DISCARD) != 0) {
+ if (feature_cnt != 0)
+ sbuf_printf(&sb, ", ");
+ sbuf_printf(&sb, "discard");
+ feature_cnt++;
+ }
+
+ if ((sc->xbd_flags & XBDF_PERSISTENT) != 0) {
+ if (feature_cnt != 0)
+ sbuf_printf(&sb, ", ");
+ sbuf_printf(&sb, "persistent_grants");
+ feature_cnt++;
+ }
+
(void) sbuf_finish(&sb);
return (sbuf_len(&sb));
}
@@ -985,7 +999,8 @@ xbd_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name)
int
xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors,
- int vdevice, uint16_t vdisk_info, unsigned long sector_size)
+ int vdevice, uint16_t vdisk_info, unsigned long sector_size,
+ unsigned long phys_sector_size)
{
char features[80];
int unit, error = 0;
@@ -1013,6 +1028,8 @@ xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors,
sc->xbd_disk->d_name = name;
sc->xbd_disk->d_drv1 = sc;
sc->xbd_disk->d_sectorsize = sector_size;
+ sc->xbd_disk->d_stripesize = phys_sector_size;
+ sc->xbd_disk->d_stripeoffset = 0;
sc->xbd_disk->d_mediasize = sectors * sector_size;
sc->xbd_disk->d_maxsize = sc->xbd_max_request_size;
@@ -1206,7 +1223,7 @@ static void
xbd_connect(struct xbd_softc *sc)
{
device_t dev = sc->xbd_dev;
- unsigned long sectors, sector_size;
+ unsigned long sectors, sector_size, phys_sector_size;
unsigned int binfo;
int err, feature_barrier, feature_flush;
int i, j;
@@ -1229,6 +1246,11 @@ xbd_connect(struct xbd_softc *sc)
return;
}
err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
+ "physical-sector-size", "%lu", &phys_sector_size,
+ NULL);
+ if (err || phys_sector_size <= sector_size)
+ phys_sector_size = 0;
+ err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev),
"feature-barrier", "%lu", &feature_barrier,
NULL);
if (err == 0 && feature_barrier != 0)
@@ -1330,7 +1352,7 @@ xbd_connect(struct xbd_softc *sc)
bus_print_child_footer(device_get_parent(dev), dev);
xbd_instance_create(sc, sectors, sc->xbd_vdevice, binfo,
- sector_size);
+ sector_size, phys_sector_size);
}
(void)xenbus_set_state(dev, XenbusStateConnected);
diff --git a/sys/dev/xen/blkfront/block.h b/sys/dev/xen/blkfront/block.h
index 28c6ff2..ddb4088 100644
--- a/sys/dev/xen/blkfront/block.h
+++ b/sys/dev/xen/blkfront/block.h
@@ -159,10 +159,12 @@ typedef enum {
XBDF_READY = 1 << 3, /* Is ready */
XBDF_CM_SHORTAGE = 1 << 4, /* Free cm resource shortage active. */
XBDF_GNT_SHORTAGE = 1 << 5, /* Grant ref resource shortage active */
- XBDF_WAIT_IDLE = 1 << 6 /*
+ XBDF_WAIT_IDLE = 1 << 6, /*
* No new work until oustanding work
* completes.
*/
+ XBDF_DISCARD = 1 << 7, /* backend supports discard */
+ XBDF_PERSISTENT = 1 << 8 /* backend supports persistent grants */
} xbd_flag_t;
/*
@@ -200,7 +202,8 @@ struct xbd_softc {
};
int xbd_instance_create(struct xbd_softc *, blkif_sector_t sectors, int device,
- uint16_t vdisk_info, unsigned long sector_size);
+ uint16_t vdisk_info, unsigned long sector_size,
+ unsigned long phys_sector_size);
static inline void
xbd_added_qentry(struct xbd_softc *sc, xbd_q_index_t index)
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 22ca81c..7add70a 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -1202,7 +1202,6 @@ xn_rxeof(struct netfront_rxq *rxq)
struct netfront_info *np = rxq->info;
#if (defined(INET) || defined(INET6))
struct lro_ctrl *lro = &rxq->lro;
- struct lro_entry *queued;
#endif
struct netfront_rx_info rinfo;
struct netif_rx_response *rx = &rinfo.rx;
@@ -1296,11 +1295,7 @@ xn_rxeof(struct netfront_rxq *rxq)
/*
* Flush any outstanding LRO work
*/
- while (!SLIST_EMPTY(&lro->lro_active)) {
- queued = SLIST_FIRST(&lro->lro_active);
- SLIST_REMOVE_HEAD(&lro->lro_active, next);
- tcp_lro_flush(lro, queued);
- }
+ tcp_lro_flush_all(lro);
#endif
xn_alloc_rx_buffers(rxq);
OpenPOWER on IntegriCloud