| 92 | } |
| 93 | |
| 94 | void |
| 95 | ssf_add_dict_string(struct rte_tel_data *d, const char *name_str, const char *value_str) |
| 96 | { |
| 97 | struct tel_dict_entry *e = &d->data.dict[d->data_len]; |
| 98 | |
| 99 | if (d->type != TEL_DICT) |
| 100 | return; |
| 101 | if (d->data_len >= RTE_TEL_MAX_DICT_ENTRIES) { |
| 102 | RTE_ETHDEV_LOG(ERR, "data_len has exceeded the maximum number of inserts\n"); |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | e->type = RTE_TEL_STRING_VAL; |
| 107 | /* append different values for same keys */ |
| 108 | if (d->data_len > 0) { |
| 109 | struct tel_dict_entry *previous = &d->data.dict[d->data_len - 1]; |
| 110 | if (strcmp(previous->name, name_str) == 0) { |
| 111 | strlcat(previous->value.sval, "; ", RTE_TEL_MAX_STRING_LEN); |
| 112 | strlcat(previous->value.sval, value_str, RTE_TEL_MAX_STRING_LEN); |
| 113 | goto end; |
| 114 | } |
| 115 | } |
| 116 | strlcpy(e->value.sval, value_str, RTE_TEL_MAX_STRING_LEN); |
| 117 | strlcpy(e->name, name_str, RTE_TEL_MAX_STRING_LEN); |
| 118 | d->data_len++; |
| 119 | |
| 120 | end: |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | int |
| 125 | eth_dev_handle_port_module_eeprom(const char *cmd __rte_unused, const char *params, |
no test coverage detected