struct tm_node *ns = np->parent_node;
uint32_t subport_id = tm_node_subport_id(dev, ns);
struct tm_params *t = &p->soft.tm.params;
- uint32_t subport_profile_id = t->subport_to_profile[subport_id];
+ uint32_t subport_profile_id;
struct tm_shaper_profile *sp_old = tm_shaper_profile_search(dev,
ss->shaper_profile_id);
+ if (subport_id >= TM_MAX_SUBPORT_PROFILE)
+ return -1;
+
+ subport_profile_id = t->subport_to_profile[subport_id];
+
/* Derive new subport configuration. */
memcpy(&subport_profile,
&p->soft.tm.params.subport_profile[subport_profile_id],
struct tm_params *t = &p->soft.tm.params;
uint32_t subport_id = tm_node_subport_id(dev, np->parent_node);
+ if (subport_id >= TM_MAX_SUBPORT_PROFILE)
+ return NULL;
+
return &t->subport_profile[subport_id];
}
struct rte_sched_subport_profile_params profile1;
uint32_t subport_profile_id;
+ if (profile0 == NULL)
+ return -1;
+
/* Derive new pipe profile. */
memcpy(&profile1, profile0, sizeof(profile1));
profile1.tb_rate = sp->params.peak.rate;