osd
void *hdata, struct osd *hosd)
void *ctx_data, void *hdata, struct osd *hosd);
struct i40e_hw_port_stats *osd = &pf->stats_offsets;
&osd->crc_errors, &nsd->crc_errors);
&osd->illegal_bytes, &nsd->illegal_bytes);
&osd->eth.rx_bytes, &nsd->eth.rx_bytes);
&osd->eth.tx_bytes, &nsd->eth.tx_bytes);
&osd->eth.rx_discards,
&osd->eth.rx_unicast,
&osd->eth.tx_unicast,
&osd->eth.rx_multicast,
&osd->eth.tx_multicast,
&osd->eth.rx_broadcast,
&osd->eth.tx_broadcast,
&osd->tx_dropped_link_down,
&osd->mac_local_faults,
&osd->mac_remote_faults,
&osd->rx_length_errors,
&osd->link_xon_rx, &nsd->link_xon_rx);
&osd->link_xon_tx, &nsd->link_xon_tx);
&osd->link_xoff_rx, &nsd->link_xoff_rx);
&osd->link_xoff_tx, &nsd->link_xoff_tx);
&osd->rx_size_64, &nsd->rx_size_64);
&osd->rx_size_127, &nsd->rx_size_127);
&osd->rx_size_255, &nsd->rx_size_255);
&osd->rx_size_511, &nsd->rx_size_511);
&osd->rx_size_1023, &nsd->rx_size_1023);
&osd->rx_size_1522, &nsd->rx_size_1522);
&osd->rx_size_big, &nsd->rx_size_big);
&osd->tx_size_64, &nsd->tx_size_64);
&osd->tx_size_127, &nsd->tx_size_127);
&osd->tx_size_255, &nsd->tx_size_255);
&osd->tx_size_511, &nsd->tx_size_511);
&osd->tx_size_1023, &nsd->tx_size_1023);
&osd->tx_size_1522, &nsd->tx_size_1522);
&osd->tx_size_big, &nsd->tx_size_big);
&osd->rx_undersize, &nsd->rx_undersize);
&osd->rx_fragments, &nsd->rx_fragments);
&osd->rx_oversize, &rx_roc);
&osd->rx_err1,
&osd->rx_jabber, &nsd->rx_jabber);
&osd->tx_lpi_count, &nsd->tx_lpi_count,
&osd->rx_lpi_count, &nsd->rx_lpi_count);
hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd)
char *osd;
osd = NULL;
osd = malloc(osdlen, M_PRISON, M_WAITOK);
jm_h_assemble(osd, h);
osd[osdlen - 1] = '\0'; /* sealed */
error = osd_jail_set(pr, meta->osd_slot, osd);
osd = oldosd;
free(osd, M_PRISON);
char *osd = NULL;
osd = osd_jail_get(pr, meta->osd_slot);
if (osd == NULL)
osd = ∅
if (strlcpy(opt->value, osd, opt->len) >= opt->len) {
p = osd;
if ((p == osd || *(p - 1) == '\n')
jm_osd_destructor(void *osd)
free(osd, M_PRISON);
khelp_init_osd(uint32_t classes, struct osd *hosd)
khelp_destroy_osd(struct osd *hosd)
khelp_remove_osd(struct helper *h, struct osd *hosd)
khelp_get_osd(struct osd *hosd, int32_t id)
static inline void khelp_remove_osd(struct helper *h, struct osd *hosd);
struct osd *osd, *tosd;
LIST_FOREACH_SAFE(osd, &osdm[type].osd_list, osd_next, tosd)
do_osd_del(type, osd, slot, 1);
osd_set(u_int type, struct osd *osd, u_int slot, void *value)
return (osd_set_reserved(type, osd, slot, NULL, value));
osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv,
if (slot > osd->osd_nslots) {
if (osd->osd_nslots != 0) {
memcpy(newptr, osd->osd_slots,
sizeof(void *) * osd->osd_nslots);
free(osd->osd_slots, M_OSD);
newptr = realloc(osd->osd_slots, sizeof(void *) * slot,
if (osd->osd_nslots == 0) {
LIST_INSERT_HEAD(&osdm[type].osd_list, osd, osd_next);
osd->osd_slots = newptr;
osd->osd_nslots = slot;
osd->osd_slots[slot - 1] = value;
osd_get_unlocked(u_int type, struct osd *osd, u_int slot)
if (slot > osd->osd_nslots) {
value = atomic_load_ptr(&osd->osd_slots[slot - 1]);
osd_get(u_int type, struct osd *osd, u_int slot)
value = osd_get_unlocked(type, osd, slot);
osd_del(u_int type, struct osd *osd, u_int slot)
do_osd_del(type, osd, slot, 0);
do_osd_del(u_int type, struct osd *osd, u_int slot, int list_locked)
if (slot > osd->osd_nslots) {
if (osd->osd_slots[slot - 1] != NULL) {
osdm[type].osd_destructors[slot - 1](osd->osd_slots[slot - 1]);
osd->osd_slots[slot - 1] = NULL;
for (i = osd->osd_nslots - 1; i >= 0; i--) {
if (osd->osd_slots[i] != NULL) {
LIST_REMOVE(osd, osd_next);
free(osd->osd_slots, M_OSD);
osd->osd_slots = NULL;
osd->osd_nslots = 0;
} else if (slot == osd->osd_nslots) {
osd->osd_slots = realloc(osd->osd_slots,
KASSERT(osd->osd_slots != NULL, ("realloc() failed"));
osd->osd_nslots = i + 1;
osd->osd_nslots, type);
osd_exit(u_int type, struct osd *osd)
if (osd->osd_nslots == 0) {
KASSERT(osd->osd_slots == NULL, ("Non-null osd_slots."));
for (i = 1; i <= osd->osd_nslots; i++) {
do_osd_del(type, osd, i, 0);
SYSINIT(osd, SI_SUB_LOCK, SI_ORDER_ANY, osd_init, NULL);
LIST_HEAD(, osd) osd_list; /* (l) */
SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RWTUN, &osd_debug, 0, "OSD debug level");
static void do_osd_del(u_int type, struct osd *osd, u_int slot,
HHOOKS_RUN_IF(V_socket_hhh[h_id], &hhook_data, &so->osd);
if (khelp_init_osd(HELPER_CLASS_SOCKET, &so->osd)) {
khelp_destroy_osd(&so->osd);
void *hdata, struct osd *hosd)
void *ctx_data, void *hdata, struct osd *hosd)
void *ctx_data, void *hdata, struct osd *hosd)
void *udata, void *ctx_data, void *hdata, struct osd *hosd);
void *udata, void *ctx_data, void *hdata, struct osd *hosd);
struct osd t_osd; /* storage for Khelp module data */
void hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd);
struct osd;
void *ctx_data, void *hdata, struct osd *hosd);
struct osd pr_osd; /* (p) additional data */
struct osd;
int khelp_init_osd(uint32_t classes, struct osd *hosd);
int khelp_destroy_osd(struct osd *hosd);
void * khelp_get_osd(struct osd *hosd, int32_t id);
LIST_ENTRY(osd) osd_next; /* (l) */
int osd_set(u_int type, struct osd *osd, u_int slot, void *value);
int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv,
void *osd_get(u_int type, struct osd *osd, u_int slot);
void *osd_get_unlocked(u_int type, struct osd *osd, u_int slot);
void osd_del(u_int type, struct osd *osd, u_int slot);
void osd_exit(u_int type, struct osd *osd);
struct osd td_osd; /* (k) Object specific data. */
struct osd osd; /* Object Specific extensions */