diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-11 21:41:01 +0200 |
---|---|---|
committer | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2016-01-12 19:33:06 +0200 |
commit | b8492e2ba12ce5d74a35cc5e38e8b718d66af88f (patch) | |
tree | 61cdd94e81201a840ae31fad7fd64127f52031f7 /platform/linux-keystone2 | |
parent | 38d0735e8df45908766c86d244bd1f4f2b9c0bba (diff) |
linux-ks2: packet_io: cls: add initial odp_pktio_skip_set()
By a big account change of pktio flow parameters may require to
change all dependent resources, but for now lets see on it like
it's only changing skip value for all future connections.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Diffstat (limited to 'platform/linux-keystone2')
-rw-r--r-- | platform/linux-keystone2/odp_packet_io.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/platform/linux-keystone2/odp_packet_io.c b/platform/linux-keystone2/odp_packet_io.c index 5acd740c..e463bdd8 100644 --- a/platform/linux-keystone2/odp_packet_io.c +++ b/platform/linux-keystone2/odp_packet_io.c @@ -872,16 +872,33 @@ int odp_pktio_error_cos_set(odp_pktio_t pktio, return -1; } -int odp_pktio_skip_set(odp_pktio_t pktio, - uint32_t offset ODP_UNUSED) +int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t offset) { + pktio_entry_t *entry; + cppi_flow_entry_t *old_cppi_flow; + if (pktio == ODP_PKTIO_INVALID) { ODP_ERR("Invalid input parameters\n"); return -1; } - ODP_UNIMPLEMENTED(); - return -1; + entry = _odp_pktio_entry(pktio); + old_cppi_flow = entry->cppi_flow; + + entry->cppi_flow = _odp_pool_cppi_flow_create(entry->in_pool, + entry->headroom + offset); + if (!entry->cppi_flow) { + entry->cppi_flow = old_cppi_flow; + odp_pr_err("Failed to create cppi flow\n"); + return -1; + } + + if (cppi_flow_destroy(old_cppi_flow) < 0) { + odp_pr_err("Failed to destroy old cppi flow\n"); + return -1; + } + + return 0; } uint16_t _odp_pktio_port_id(odp_pktio_t pktio) |