1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Revert "Only return one nonce range per device per cycle through scanwork in bflsc to avoid batching of result count."

This reverts commit 4530a74e0b.
This commit is contained in:
Con Kolivas 2013-06-09 22:00:49 +10:00
parent 6d7f079f07
commit 4f36d38c0f

View File

@ -59,7 +59,7 @@ struct bflsc_dev {
int work_complete; int work_complete;
int nonces_hw; // TODO: this - need to add a paramter to submit_nonce() int nonces_hw; // TODO: this - need to add a paramter to submit_nonce()
// so can pass 'dev' to hw_error // so can pass 'dev' to hw_error
uint64_t nonces_unsent; uint64_t hashes_unsent;
uint64_t hashes_sent; uint64_t hashes_sent;
uint64_t nonces_found; uint64_t nonces_found;
@ -1360,7 +1360,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
if (res) if (res)
sc_info->sc_devs[dev].result_id++; sc_info->sc_devs[dev].result_id++;
sc_info->sc_devs[dev].work_complete++; sc_info->sc_devs[dev].work_complete++;
sc_info->sc_devs[dev].nonces_unsent++; sc_info->sc_devs[dev].hashes_unsent += FULLNONCE;
// If not flushed (stale) // If not flushed (stale)
if (!(work->devflag)) if (!(work->devflag))
sc_info->sc_devs[dev].work_queued -= 1; 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 cgpu_info *bflsc = thr->cgpu;
struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_data); struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_data);
struct work *work, *tmp; int64_t ret, unsent;
bool flushed, cleanup; bool flushed, cleanup;
struct work *work, *tmp;
int dev, waited, i; int dev, waited, i;
int64_t ret;
// Device is gone // Device is gone
if (bflsc->usbinfo.nodev) if (bflsc->usbinfo.nodev)
@ -1791,14 +1791,11 @@ static int64_t bflsc_scanwork(struct thr_info *thr)
ret = 0; ret = 0;
wr_lock(&(sc_info->stat_lock)); wr_lock(&(sc_info->stat_lock));
for (dev = 0; dev < sc_info->sc_count; dev++) { for (dev = 0; dev < sc_info->sc_count; dev++) {
/* Only return one nonce range per cycle through scanwork to unsent = sc_info->sc_devs[dev].hashes_unsent;
* avoid batching of results during downtime. */ sc_info->sc_devs[dev].hashes_unsent = 0;
if (sc_info->sc_devs[dev].nonces_unsent) { sc_info->sc_devs[dev].hashes_sent += unsent;
sc_info->sc_devs[dev].nonces_unsent--; sc_info->hashes_sent += unsent;
sc_info->sc_devs[dev].hashes_sent += FULLNONCE; ret += unsent;
sc_info->hashes_sent += FULLNONCE;
ret += FULLNONCE;
}
} }
wr_unlock(&(sc_info->stat_lock)); wr_unlock(&(sc_info->stat_lock));