Only return one nonce range per device per cycle through scanwork in bflsc to avoid batching of result count.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/driver-bflsc.c b/driver-bflsc.c
index b72d3e1..457cc8c 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -59,7 +59,7 @@ struct bflsc_dev {
int work_complete;
int nonces_hw; // TODO: this - need to add a paramter to submit_nonce()
// so can pass 'dev' to hw_error
- uint64_t hashes_unsent;
+ uint64_t nonces_unsent;
uint64_t hashes_sent;
uint64_t nonces_found;
@@ -1360,7 +1360,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
if (res)
sc_info->sc_devs[dev].result_id++;
sc_info->sc_devs[dev].work_complete++;
- sc_info->sc_devs[dev].hashes_unsent += FULLNONCE;
+ sc_info->sc_devs[dev].nonces_unsent++;
// If not flushed (stale)
if (!(work->devflag))
sc_info->sc_devs[dev].work_queued -= 1;
@@ -1698,10 +1698,10 @@ static int64_t bflsc_scanwork(struct thr_info *thr)
{
struct cgpu_info *bflsc = thr->cgpu;
struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_data);
- int64_t ret, unsent;
- bool flushed, cleanup;
struct work *work, *tmp;
+ bool flushed, cleanup;
int dev, waited, i;
+ int64_t ret;
// Device is gone
if (bflsc->usbinfo.nodev)
@@ -1791,11 +1791,14 @@ static int64_t bflsc_scanwork(struct thr_info *thr)
ret = 0;
wr_lock(&(sc_info->stat_lock));
for (dev = 0; dev < sc_info->sc_count; dev++) {
- unsent = sc_info->sc_devs[dev].hashes_unsent;
- sc_info->sc_devs[dev].hashes_unsent = 0;
- sc_info->sc_devs[dev].hashes_sent += unsent;
- sc_info->hashes_sent += unsent;
- ret += unsent;
+ /* Only return one nonce range per cycle through scanwork to
+ * avoid batching of results during downtime. */
+ if (sc_info->sc_devs[dev].nonces_unsent) {
+ sc_info->sc_devs[dev].nonces_unsent--;
+ sc_info->sc_devs[dev].hashes_sent += FULLNONCE;
+ sc_info->hashes_sent += FULLNONCE;
+ ret += FULLNONCE;
+ }
}
wr_unlock(&(sc_info->stat_lock));