Store a per-core nonce and hw error count for bflsc.
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
diff --git a/driver-bflsc.c b/driver-bflsc.c
index 5dafa9c..6f9d7b9 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -1219,15 +1219,32 @@ static bool bflsc_get_temp(struct cgpu_info *bflsc, int dev)
return true;
}
+static void inc_bflsc_errors(struct thr_info *thr, struct bflsc_info *info, int8_t core)
+{
+ inc_hw_errors(thr);
+ if (core >= 0 && core < 16)
+ info->core_hw[core]++;
+ applog(LOG_WARNING, "Adding HW to core %d", core);
+}
+
+static void inc_bflsc_nonces(struct bflsc_info *info, int8_t core)
+{
+ if (core >= 0 && core < 16)
+ info->core_nonces[core]++;
+ applog(LOG_WARNING, "Adding Nonce to core %d", core);
+}
+
static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *data, int count, char **fields, int *nonces)
{
struct bflsc_info *sc_info = (struct bflsc_info *)(bflsc->device_data);
char midstate[MIDSTATE_BYTES], blockdata[MERKLE_BYTES];
+ struct thr_info *thr = bflsc->thr[0];
struct work *work;
+ int8_t core = -1;
uint32_t nonce;
int i, num, x;
- bool res;
char *tmp;
+ bool res;
if (count < sc_info->que_fld_min) {
tmp = str_text(data);
@@ -1235,15 +1252,22 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
"%s%i:%s work returned too small (%d,%s)",
bflsc->drv->name, bflsc->device_id, xlink, count, tmp);
free(tmp);
- inc_hw_errors(bflsc->thr[0]);
+ inc_bflsc_errors(thr, sc_info, core);
return;
}
+ if (sc_info->que_noncecount != QUE_NONCECOUNT_V1) {
+ unsigned int ucore;
+
+ if (sscanf(fields[QUE_CHIP_V2], "%x", &ucore) == 1)
+ core = ucore;
+ }
+
if (count > sc_info->que_fld_max) {
applog(LOG_INFO, "%s%i:%s work returned too large (%d) processing %d anyway",
bflsc->drv->name, bflsc->device_id, xlink, count, sc_info->que_fld_max);
count = sc_info->que_fld_max;
- inc_hw_errors(bflsc->thr[0]);
+ inc_bflsc_errors(thr, sc_info, core);
}
num = atoi(fields[sc_info->que_noncecount]);
@@ -1254,7 +1278,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
bflsc->drv->name, bflsc->device_id, xlink, num,
count - sc_info->que_fld_max, tmp);
free(tmp);
- inc_hw_errors(bflsc->thr[0]);
+ inc_bflsc_errors(thr, sc_info, core);
}
memset(midstate, 0, MIDSTATE_BYTES);
@@ -1263,7 +1287,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
!hex2bin((unsigned char *)blockdata, fields[QUE_BLOCKDATA], MERKLE_BYTES)) {
applog(LOG_INFO, "%s%i:%s Failed to convert binary data to hex result - ignored",
bflsc->drv->name, bflsc->device_id, xlink);
- inc_hw_errors(bflsc->thr[0]);
+ inc_bflsc_errors(thr, sc_info, core);
return;
}
@@ -1273,7 +1297,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
if (sc_info->not_first_work) {
applog(LOG_INFO, "%s%i:%s failed to find nonce work - can't be processed - ignored",
bflsc->drv->name, bflsc->device_id, xlink);
- inc_hw_errors(bflsc->thr[0]);
+ inc_bflsc_errors(thr, sc_info, core);
}
return;
}
@@ -1291,7 +1315,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
hex2bin((void*)&nonce, fields[i], 4);
nonce = htobe32(nonce);
- res = submit_nonce(bflsc->thr[0], work, nonce);
+ res = submit_nonce(thr, work, nonce);
if (res) {
wr_lock(&(sc_info->stat_lock));
sc_info->sc_devs[dev].nonces_found++;
@@ -1299,6 +1323,7 @@ static void process_nonces(struct cgpu_info *bflsc, int dev, char *xlink, char *
(*nonces)++;
x++;
+ inc_bflsc_nonces(sc_info, core);
}
}
diff --git a/driver-bflsc.h b/driver-bflsc.h
index b547ded..b1d65fa 100644
--- a/driver-bflsc.h
+++ b/driver-bflsc.h
@@ -139,6 +139,8 @@ struct bflsc_info {
int que_noncecount;
int que_fld_min;
int que_fld_max;
+ int core_nonces[17];
+ int core_hw[17];
int flush_size;
// count of given size, [+2] is for any > QUE_MAX_RESULTS
uint64_t result_size[QUE_MAX_RESULTS+2];