Skip to content

Commit

Permalink
Merge branch 'master' into amd/thread-count
Browse files Browse the repository at this point in the history
Features: dfuse
  • Loading branch information
ashleypittman committed Jan 23, 2024
2 parents 12b61a1 + ffe9ea0 commit d23ec28
Show file tree
Hide file tree
Showing 78 changed files with 2,069 additions and 1,204 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rpm-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ env:
# build is done on the lowest version and test on the highest with a "sanity test"
# stage done on all versions in the list ecept the highest
EL8_BUILD_VERSION: 8.6
EL8_VERSION: 8
EL8_VERSION: 8.8
EL9_BUILD_VERSION: 9
EL9_VERSION: 9
LEAP15_VERSION: 15.4
LEAP15_VERSION: 15.5

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion ci/functional/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test_cluster() {
FIRST_NODE=${first_node} \
TEST_RPMS=${TEST_RPMS} \
NODELIST=${tnodes} \
BUILD_URL=\"$BUILD_URL\" \
BUILD_URL=\"${BUILD_URL:-Unknown in GHA}\" \
STAGE_NAME=\"$STAGE_NAME\" \
$(cat ci/functional/test_main_prep_node.sh)"
}
Expand Down
51 changes: 45 additions & 6 deletions src/bio/bio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,46 @@ struct led_opts {
int status;
};

static Ctl__LedState
led_state_spdk2daos(enum spdk_vmd_led_state in)
{
switch (in) {
case SPDK_VMD_LED_STATE_OFF:
return CTL__LED_STATE__OFF;
case SPDK_VMD_LED_STATE_IDENTIFY:
return CTL__LED_STATE__QUICK_BLINK;
case SPDK_VMD_LED_STATE_FAULT:
return CTL__LED_STATE__ON;
case SPDK_VMD_LED_STATE_REBUILD:
return CTL__LED_STATE__SLOW_BLINK;
default:
return CTL__LED_STATE__NA;
}
}

static enum spdk_vmd_led_state
led_state_daos2spdk(Ctl__LedState in)
{
switch (in) {
case CTL__LED_STATE__OFF:
return SPDK_VMD_LED_STATE_OFF;
case CTL__LED_STATE__QUICK_BLINK:
return SPDK_VMD_LED_STATE_IDENTIFY;
case CTL__LED_STATE__ON:
return SPDK_VMD_LED_STATE_FAULT;
case CTL__LED_STATE__SLOW_BLINK:
return SPDK_VMD_LED_STATE_REBUILD;
default:
return SPDK_VMD_LED_STATE_UNKNOWN;
}
}

static void
led_device_action(void *ctx, struct spdk_pci_device *pci_device)
{
struct led_opts *opts = ctx;
enum spdk_vmd_led_state cur_led_state;
Ctl__LedState d_led_state;
const char *pci_dev_type = NULL;
char addr_buf[ADDR_STR_MAX_LEN + 1];
int rc;
Expand Down Expand Up @@ -656,14 +691,17 @@ led_device_action(void *ctx, struct spdk_pci_device *pci_device)
return;
}

/* Convert state to Ctl__LedState from SPDK led_state */
d_led_state = led_state_spdk2daos(cur_led_state);

D_DEBUG(DB_MGMT, "led on dev %s has state: %s (action: %s, new state: %s)\n", addr_buf,
LED_STATE_NAME(cur_led_state), LED_ACTION_NAME(opts->action),
LED_STATE_NAME(d_led_state), LED_ACTION_NAME(opts->action),
LED_STATE_NAME(opts->led_state));

switch (opts->action) {
case CTL__LED_ACTION__GET:
/* Return early with current device state set */
opts->led_state = (Ctl__LedState)cur_led_state;
opts->led_state = d_led_state;
return;
case CTL__LED_ACTION__SET:
break;
Expand All @@ -678,14 +716,14 @@ led_device_action(void *ctx, struct spdk_pci_device *pci_device)
return;
}

if (cur_led_state == (enum spdk_vmd_led_state)opts->led_state) {
if (d_led_state == opts->led_state) {
D_DEBUG(DB_MGMT, "VMD device %s LED state already in state %s\n", addr_buf,
LED_STATE_NAME(opts->led_state));
return;
}

/* Set the LED to the new state */
rc = spdk_vmd_set_led_state(pci_device, (enum spdk_vmd_led_state)opts->led_state);
rc = spdk_vmd_set_led_state(pci_device, led_state_daos2spdk(opts->led_state));
if (spdk_unlikely(rc != 0)) {
D_ERROR("Failed to set the VMD LED state on %s (%s)\n", addr_buf,
spdk_strerror(-rc));
Expand All @@ -700,11 +738,12 @@ led_device_action(void *ctx, struct spdk_pci_device *pci_device)
opts->status = -DER_NOSYS;
return;
}
d_led_state = led_state_spdk2daos(cur_led_state);

/* Verify the correct state is set */
if (cur_led_state != (enum spdk_vmd_led_state)opts->led_state) {
if (d_led_state != opts->led_state) {
D_ERROR("Unexpected LED state on %s, want %s got %s\n", addr_buf,
LED_STATE_NAME(opts->led_state), LED_STATE_NAME(cur_led_state));
LED_STATE_NAME(opts->led_state), LED_STATE_NAME(d_led_state));
opts->status = -DER_INVAL;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/bio/smd.pb-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,19 +2833,19 @@ const ProtobufCEnumDescriptor ctl__nvme_dev_state__descriptor =
};
static const ProtobufCEnumValue ctl__led_state__enum_values_by_number[5] =
{
{ "OFF", "CTL__LED_STATE__OFF", 0 },
{ "NA", "CTL__LED_STATE__NA", 0 },
{ "QUICK_BLINK", "CTL__LED_STATE__QUICK_BLINK", 1 },
{ "ON", "CTL__LED_STATE__ON", 2 },
{ "SLOW_BLINK", "CTL__LED_STATE__SLOW_BLINK", 3 },
{ "NA", "CTL__LED_STATE__NA", 4 },
{ "OFF", "CTL__LED_STATE__OFF", 4 },
};
static const ProtobufCIntRange ctl__led_state__value_ranges[] = {
{0, 0},{0, 5}
};
static const ProtobufCEnumValueIndex ctl__led_state__enum_values_by_name[5] =
{
{ "NA", 4 },
{ "OFF", 0 },
{ "NA", 0 },
{ "OFF", 4 },
{ "ON", 2 },
{ "QUICK_BLINK", 1 },
{ "SLOW_BLINK", 3 },
Expand Down
12 changes: 6 additions & 6 deletions src/bio/smd.pb-c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/cart/crt_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3508,8 +3508,8 @@ crt_iv_update_internal(crt_iv_namespace_t ivns, uint32_t class_id,

D_GOTO(exit, rc);
} else {
DL_CDEBUG(rc == -DER_NONEXIST || rc == -DER_NOTLEADER, DLOG_INFO, DLOG_ERR, rc,
"ivo_on_update failed");
DL_CDEBUG(rc == -DER_NONEXIST || rc == -DER_NOTLEADER || rc == -DER_BUSY,
DLOG_INFO, DLOG_ERR, rc, "ivo_on_update failed");

update_comp_cb(ivns, class_id, iv_key, NULL,
iv_value, rc, cb_arg);
Expand Down
Loading

0 comments on commit d23ec28

Please sign in to comment.