Message ID | 1422277551-16417-8-git-send-email-petri.savolainen@linaro.org |
---|---|
State | New |
Headers | show |
This no longer applies to tip classification/odp_classification_tests.c: In function ‘enqueue_loop_interface’: classification/odp_classification_tests.c:108:2: error: implicit declaration of function ‘odp_packet_to_buffer’ [-Werror=implicit-function-declaration] odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); ^ classification/odp_classification_tests.c:108:2: error: nested extern declaration of ‘odp_packet_to_buffer’ [-Werror=nested-externs] On 26 January 2015 at 08:05, Petri Savolainen <petri.savolainen@linaro.org> wrote: > Removed packet to buffer conversion. > > packet -> event -> buffer conversions are temporary. > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > --- > example/generator/odp_generator.c | 2 +- > example/ipsec/odp_ipsec.c | 8 ++++---- > platform/linux-generic/include/api/odp_packet.h | 9 --------- > platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ > platform/linux-generic/odp_crypto.c | 4 ++-- > platform/linux-generic/odp_packet.c | 2 +- > platform/linux-generic/odp_packet_io.c | 6 +++--- > test/validation/buffer/odp_packet_test.c | 2 +- > 8 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/example/generator/odp_generator.c > b/example/generator/odp_generator.c > index 547366a..5df8868 100644 > --- a/example/generator/odp_generator.c > +++ b/example/generator/odp_generator.c > @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t > pkt_tbl[], unsigned len) > > odp_atomic_inc_u64(&counters.ip); > rlen += sprintf(msg, "receive Packet proto:IP "); > - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); > + buf = odp_packet_data(pkt); > ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); > rlen += sprintf(msg + rlen, "id %d ", > odp_be_to_cpu_16(ip->id)); > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index a59794a..9fdaeab 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t > pkt, > *skip = FALSE; > if (odp_crypto_operation(¶ms, > &posted, > - odp_packet_to_buffer(pkt))) { > + > odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, > int trl_len = 0; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, > /* Issue crypto request */ > if (odp_crypto_operation(&ctx->ipsec.params, > &posted, > - odp_packet_to_buffer(pkt))) { > + > odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, > odph_ipv4hdr_t *ip; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > diff --git a/platform/linux-generic/include/api/odp_packet.h > b/platform/linux-generic/include/api/odp_packet.h > index 92b6016..fa3e321 100644 > --- a/platform/linux-generic/include/api/odp_packet.h > +++ b/platform/linux-generic/include/api/odp_packet.h > @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); > odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); > > /** > - * Convert a packet handle to a buffer handle > - * > - * @param pkt Packet handle > - * > - * @return Buffer handle > - */ > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); > - > -/** > * Get packet handle from event > * > * Converts an ODP_EVENT_PACKET type event to a packet. > diff --git a/platform/linux-generic/include/odp_packet_internal.h > b/platform/linux-generic/include/odp_packet_internal.h > index 179330c..fe4a223 100644 > --- a/platform/linux-generic/include/odp_packet_internal.h > +++ b/platform/linux-generic/include/odp_packet_internal.h > @@ -257,6 +257,15 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t > pool_hdl); > > int _odp_packet_parse(odp_packet_t pkt); > > +/* > + * Convert a packet handle to a buffer handle > + * > + * @param pkt Packet handle > + * > + * @return Buffer handle > + */ > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); > + > #ifdef __cplusplus > } > #endif > diff --git a/platform/linux-generic/odp_crypto.c > b/platform/linux-generic/odp_crypto.c > index bee6fe5..74fac5c 100644 > --- a/platform/linux-generic/odp_crypto.c > +++ b/platform/linux-generic/odp_crypto.c > @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, > ODP_ABORT(); > _odp_packet_copy_to_packet(params->pkt, 0, > params->out_pkt, 0, > odp_packet_len(params->pkt)); > - if (completion_event == odp_packet_to_buffer(params->pkt)) > + if (completion_event == _odp_packet_to_buffer(params->pkt)) > completion_event = > - odp_packet_to_buffer(params->out_pkt); > + _odp_packet_to_buffer(params->out_pkt); > odp_packet_free(params->pkt); > params->pkt = ODP_PACKET_INVALID; > } > diff --git a/platform/linux-generic/odp_packet.c > b/platform/linux-generic/odp_packet.c > index ebe3b55..bcbac79 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) > return (odp_packet_t)buf; > } > > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) > { > return (odp_buffer_t)pkt; > } > diff --git a/platform/linux-generic/odp_packet_io.c > b/platform/linux-generic/odp_packet_io.c > index 0efa3d0..2de6335 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t *pktio_entry, > odp_packet_t pkt_tbl[], > unsigned i; > > for (i = 0; i < len; ++i) > - hdr_tbl[i] = > odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); > + hdr_tbl[i] = > odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); > > qentry = queue_to_qentry(pktio_entry->s.loopq); > return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; > @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) > return NULL; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > buf_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = buf_hdr; > @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, > odp_buffer_hdr_t *buf_hdr[], int num) > return nbr; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > tmp_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = tmp_hdr; > diff --git a/test/validation/buffer/odp_packet_test.c > b/test/validation/buffer/odp_packet_test.c > index 63caec6..6e44443 100644 > --- a/test/validation/buffer/odp_packet_test.c > +++ b/test/validation/buffer/odp_packet_test.c > @@ -374,7 +374,7 @@ static void packet_segments(void) > } > > CU_ASSERT(seg_index == num_segs); > - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); > + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); > CU_ASSERT(data_len == odp_packet_len(pkt)); > > if (seg_index == num_segs) > -- > 2.2.2 > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
We need to halt merges until events are merged. That's why it's critical path. We should be able to fix this as a one-off but we can't keep rebasing it. Everything else should rebase on events. We'll have the same merge-barrier "all stop" issue with the API directory change. Bill On Mon, Jan 26, 2015 at 3:57 PM, Mike Holmes <mike.holmes@linaro.org> wrote: > This no longer applies to tip > > classification/odp_classification_tests.c: In function > ‘enqueue_loop_interface’: > classification/odp_classification_tests.c:108:2: error: implicit > declaration of function ‘odp_packet_to_buffer’ > [-Werror=implicit-function-declaration] > odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); > ^ > classification/odp_classification_tests.c:108:2: error: nested extern > declaration of ‘odp_packet_to_buffer’ [-Werror=nested-externs] > > > On 26 January 2015 at 08:05, Petri Savolainen <petri.savolainen@linaro.org > > wrote: > >> Removed packet to buffer conversion. >> >> packet -> event -> buffer conversions are temporary. >> >> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >> --- >> example/generator/odp_generator.c | 2 +- >> example/ipsec/odp_ipsec.c | 8 ++++---- >> platform/linux-generic/include/api/odp_packet.h | 9 --------- >> platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ >> platform/linux-generic/odp_crypto.c | 4 ++-- >> platform/linux-generic/odp_packet.c | 2 +- >> platform/linux-generic/odp_packet_io.c | 6 +++--- >> test/validation/buffer/odp_packet_test.c | 2 +- >> 8 files changed, 21 insertions(+), 21 deletions(-) >> >> diff --git a/example/generator/odp_generator.c >> b/example/generator/odp_generator.c >> index 547366a..5df8868 100644 >> --- a/example/generator/odp_generator.c >> +++ b/example/generator/odp_generator.c >> @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t >> pkt_tbl[], unsigned len) >> >> odp_atomic_inc_u64(&counters.ip); >> rlen += sprintf(msg, "receive Packet proto:IP "); >> - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); >> + buf = odp_packet_data(pkt); >> ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); >> rlen += sprintf(msg + rlen, "id %d ", >> odp_be_to_cpu_16(ip->id)); >> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >> index a59794a..9fdaeab 100644 >> --- a/example/ipsec/odp_ipsec.c >> +++ b/example/ipsec/odp_ipsec.c >> @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t >> pkt, >> *skip = FALSE; >> if (odp_crypto_operation(¶ms, >> &posted, >> - odp_packet_to_buffer(pkt))) { >> + >> odp_buffer_from_event(odp_packet_to_event(pkt)))) { >> abort(); >> } >> return (posted) ? PKT_POSTED : PKT_CONTINUE; >> @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, >> int trl_len = 0; >> >> /* Check crypto result */ >> - event = odp_packet_to_buffer(pkt); >> + event = odp_buffer_from_event(odp_packet_to_event(pkt)); >> odp_crypto_get_operation_compl_status(event, &auth_rc, >> &cipher_rc); >> if (!is_crypto_compl_status_ok(&cipher_rc)) >> return PKT_DROP; >> @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, >> /* Issue crypto request */ >> if (odp_crypto_operation(&ctx->ipsec.params, >> &posted, >> - odp_packet_to_buffer(pkt))) { >> + >> odp_buffer_from_event(odp_packet_to_event(pkt)))) { >> abort(); >> } >> return (posted) ? PKT_POSTED : PKT_CONTINUE; >> @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t >> pkt, >> odph_ipv4hdr_t *ip; >> >> /* Check crypto result */ >> - event = odp_packet_to_buffer(pkt); >> + event = odp_buffer_from_event(odp_packet_to_event(pkt)); >> odp_crypto_get_operation_compl_status(event, &auth_rc, >> &cipher_rc); >> if (!is_crypto_compl_status_ok(&cipher_rc)) >> return PKT_DROP; >> diff --git a/platform/linux-generic/include/api/odp_packet.h >> b/platform/linux-generic/include/api/odp_packet.h >> index 92b6016..fa3e321 100644 >> --- a/platform/linux-generic/include/api/odp_packet.h >> +++ b/platform/linux-generic/include/api/odp_packet.h >> @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); >> odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); >> >> /** >> - * Convert a packet handle to a buffer handle >> - * >> - * @param pkt Packet handle >> - * >> - * @return Buffer handle >> - */ >> -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); >> - >> -/** >> * Get packet handle from event >> * >> * Converts an ODP_EVENT_PACKET type event to a packet. >> diff --git a/platform/linux-generic/include/odp_packet_internal.h >> b/platform/linux-generic/include/odp_packet_internal.h >> index 179330c..fe4a223 100644 >> --- a/platform/linux-generic/include/odp_packet_internal.h >> +++ b/platform/linux-generic/include/odp_packet_internal.h >> @@ -257,6 +257,15 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t >> pool_hdl); >> >> int _odp_packet_parse(odp_packet_t pkt); >> >> +/* >> + * Convert a packet handle to a buffer handle >> + * >> + * @param pkt Packet handle >> + * >> + * @return Buffer handle >> + */ >> +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/platform/linux-generic/odp_crypto.c >> b/platform/linux-generic/odp_crypto.c >> index bee6fe5..74fac5c 100644 >> --- a/platform/linux-generic/odp_crypto.c >> +++ b/platform/linux-generic/odp_crypto.c >> @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, >> ODP_ABORT(); >> _odp_packet_copy_to_packet(params->pkt, 0, >> params->out_pkt, 0, >> odp_packet_len(params->pkt)); >> - if (completion_event == odp_packet_to_buffer(params->pkt)) >> + if (completion_event == >> _odp_packet_to_buffer(params->pkt)) >> completion_event = >> - odp_packet_to_buffer(params->out_pkt); >> + _odp_packet_to_buffer(params->out_pkt); >> odp_packet_free(params->pkt); >> params->pkt = ODP_PACKET_INVALID; >> } >> diff --git a/platform/linux-generic/odp_packet.c >> b/platform/linux-generic/odp_packet.c >> index ebe3b55..bcbac79 100644 >> --- a/platform/linux-generic/odp_packet.c >> +++ b/platform/linux-generic/odp_packet.c >> @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) >> return (odp_packet_t)buf; >> } >> >> -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) >> +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) >> { >> return (odp_buffer_t)pkt; >> } >> diff --git a/platform/linux-generic/odp_packet_io.c >> b/platform/linux-generic/odp_packet_io.c >> index 0efa3d0..2de6335 100644 >> --- a/platform/linux-generic/odp_packet_io.c >> +++ b/platform/linux-generic/odp_packet_io.c >> @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t *pktio_entry, >> odp_packet_t pkt_tbl[], >> unsigned i; >> >> for (i = 0; i < len; ++i) >> - hdr_tbl[i] = >> odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); >> + hdr_tbl[i] = >> odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); >> >> qentry = queue_to_qentry(pktio_entry->s.loopq); >> return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; >> @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) >> return NULL; >> >> for (i = 0, j = 0; i < pkts; ++i) { >> - buf = odp_packet_to_buffer(pkt_tbl[i]); >> + buf = _odp_packet_to_buffer(pkt_tbl[i]); >> buf_hdr = odp_buf_to_hdr(buf); >> if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) >> tmp_hdr_tbl[j++] = buf_hdr; >> @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, >> odp_buffer_hdr_t *buf_hdr[], int num) >> return nbr; >> >> for (i = 0, j = 0; i < pkts; ++i) { >> - buf = odp_packet_to_buffer(pkt_tbl[i]); >> + buf = _odp_packet_to_buffer(pkt_tbl[i]); >> tmp_hdr = odp_buf_to_hdr(buf); >> if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) >> tmp_hdr_tbl[j++] = tmp_hdr; >> diff --git a/test/validation/buffer/odp_packet_test.c >> b/test/validation/buffer/odp_packet_test.c >> index 63caec6..6e44443 100644 >> --- a/test/validation/buffer/odp_packet_test.c >> +++ b/test/validation/buffer/odp_packet_test.c >> @@ -374,7 +374,7 @@ static void packet_segments(void) >> } >> >> CU_ASSERT(seg_index == num_segs); >> - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); >> + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); >> CU_ASSERT(data_len == odp_packet_len(pkt)); >> >> if (seg_index == num_segs) >> -- >> 2.2.2 >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > -- > *Mike Holmes* > Linaro Sr Technical Manager > LNG - ODP > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > >
I agree, the intent was not to apply anything that interrupted Events, maybe it is a simple conflict that can be solved as it is applied, but if not I think we should revert classification. On 27 January 2015 at 03:08, Savolainen, Petri (NSN - FI/Espoo) < petri.savolainen@nsn.com> wrote: > I don’t have time to rebase it today. I’d propose to revert the > conflicting patch from the repo and rebase that instead. It saves a day or > two, plus stops conflicting new development (usage of buffers instead of > events). > > > > - Petri > > > > *From:* ext Bill Fischofer [mailto:bill.fischofer@linaro.org] > *Sent:* Tuesday, January 27, 2015 12:17 AM > *To:* Mike Holmes > *Cc:* Petri Savolainen; lng-odp > *Subject:* Re: [lng-odp] [PATCH v5 07/17] api: packet: Removed > odp_packet_to_buffer > > > > We need to halt merges until events are merged. That's why it's critical > path. We should be able to fix this as a one-off but we can't keep > rebasing it. Everything else should rebase on events. > > > > We'll have the same merge-barrier "all stop" issue with the API directory > change. > > > > Bill > > > > On Mon, Jan 26, 2015 at 3:57 PM, Mike Holmes <mike.holmes@linaro.org> > wrote: > > This no longer applies to tip > > > > classification/odp_classification_tests.c: In function > ‘enqueue_loop_interface’: > > classification/odp_classification_tests.c:108:2: error: implicit > declaration of function ‘odp_packet_to_buffer’ > [-Werror=implicit-function-declaration] > > odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); > > ^ > > classification/odp_classification_tests.c:108:2: error: nested extern > declaration of ‘odp_packet_to_buffer’ [-Werror=nested-externs] > > > > > > On 26 January 2015 at 08:05, Petri Savolainen <petri.savolainen@linaro.org> > wrote: > > Removed packet to buffer conversion. > > packet -> event -> buffer conversions are temporary. > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > --- > example/generator/odp_generator.c | 2 +- > example/ipsec/odp_ipsec.c | 8 ++++---- > platform/linux-generic/include/api/odp_packet.h | 9 --------- > platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ > platform/linux-generic/odp_crypto.c | 4 ++-- > platform/linux-generic/odp_packet.c | 2 +- > platform/linux-generic/odp_packet_io.c | 6 +++--- > test/validation/buffer/odp_packet_test.c | 2 +- > 8 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/example/generator/odp_generator.c > b/example/generator/odp_generator.c > index 547366a..5df8868 100644 > --- a/example/generator/odp_generator.c > +++ b/example/generator/odp_generator.c > @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t > pkt_tbl[], unsigned len) > > odp_atomic_inc_u64(&counters.ip); > rlen += sprintf(msg, "receive Packet proto:IP "); > - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); > + buf = odp_packet_data(pkt); > ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); > rlen += sprintf(msg + rlen, "id %d ", > odp_be_to_cpu_16(ip->id)); > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index a59794a..9fdaeab 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t > pkt, > *skip = FALSE; > if (odp_crypto_operation(¶ms, > &posted, > - odp_packet_to_buffer(pkt))) { > + > odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, > int trl_len = 0; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, > /* Issue crypto request */ > if (odp_crypto_operation(&ctx->ipsec.params, > &posted, > - odp_packet_to_buffer(pkt))) { > + > odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, > odph_ipv4hdr_t *ip; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > diff --git a/platform/linux-generic/include/api/odp_packet.h > b/platform/linux-generic/include/api/odp_packet.h > index 92b6016..fa3e321 100644 > --- a/platform/linux-generic/include/api/odp_packet.h > +++ b/platform/linux-generic/include/api/odp_packet.h > @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); > odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); > > /** > - * Convert a packet handle to a buffer handle > - * > - * @param pkt Packet handle > - * > - * @return Buffer handle > - */ > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); > - > -/** > * Get packet handle from event > * > * Converts an ODP_EVENT_PACKET type event to a packet. > diff --git a/platform/linux-generic/include/odp_packet_internal.h > b/platform/linux-generic/include/odp_packet_internal.h > index 179330c..fe4a223 100644 > --- a/platform/linux-generic/include/odp_packet_internal.h > +++ b/platform/linux-generic/include/odp_packet_internal.h > @@ -257,6 +257,15 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t > pool_hdl); > > int _odp_packet_parse(odp_packet_t pkt); > > +/* > + * Convert a packet handle to a buffer handle > + * > + * @param pkt Packet handle > + * > + * @return Buffer handle > + */ > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); > + > #ifdef __cplusplus > } > #endif > diff --git a/platform/linux-generic/odp_crypto.c > b/platform/linux-generic/odp_crypto.c > index bee6fe5..74fac5c 100644 > --- a/platform/linux-generic/odp_crypto.c > +++ b/platform/linux-generic/odp_crypto.c > @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, > ODP_ABORT(); > _odp_packet_copy_to_packet(params->pkt, 0, > params->out_pkt, 0, > odp_packet_len(params->pkt)); > - if (completion_event == odp_packet_to_buffer(params->pkt)) > + if (completion_event == _odp_packet_to_buffer(params->pkt)) > completion_event = > - odp_packet_to_buffer(params->out_pkt); > + _odp_packet_to_buffer(params->out_pkt); > odp_packet_free(params->pkt); > params->pkt = ODP_PACKET_INVALID; > } > diff --git a/platform/linux-generic/odp_packet.c > b/platform/linux-generic/odp_packet.c > index ebe3b55..bcbac79 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) > return (odp_packet_t)buf; > } > > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) > { > return (odp_buffer_t)pkt; > } > diff --git a/platform/linux-generic/odp_packet_io.c > b/platform/linux-generic/odp_packet_io.c > index 0efa3d0..2de6335 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t *pktio_entry, > odp_packet_t pkt_tbl[], > unsigned i; > > for (i = 0; i < len; ++i) > - hdr_tbl[i] = > odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); > + hdr_tbl[i] = > odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); > > qentry = queue_to_qentry(pktio_entry->s.loopq); > return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; > @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) > return NULL; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > buf_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = buf_hdr; > @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, > odp_buffer_hdr_t *buf_hdr[], int num) > return nbr; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > tmp_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = tmp_hdr; > diff --git a/test/validation/buffer/odp_packet_test.c > b/test/validation/buffer/odp_packet_test.c > index 63caec6..6e44443 100644 > --- a/test/validation/buffer/odp_packet_test.c > +++ b/test/validation/buffer/odp_packet_test.c > @@ -374,7 +374,7 @@ static void packet_segments(void) > } > > CU_ASSERT(seg_index == num_segs); > - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); > + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); > CU_ASSERT(data_len == odp_packet_len(pkt)); > > if (seg_index == num_segs) > -- > 2.2.2 > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > > -- > > *Mike Holmes* > > Linaro Sr Technical Manager > > LNG - ODP > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > > >
On Tuesday 27 January 2015 01:50 PM, Mike Holmes wrote: > I agree, the intent was not to apply anything that interrupted Events, > maybe it is a simple conflict that can be solved as it is applied, but if > not I think we should revert classification. I needed I can provide a patch to resolve this conflict. Regards, Bala > > On 27 January 2015 at 03:08, Savolainen, Petri (NSN - FI/Espoo) < > petri.savolainen@nsn.com> wrote: > >> I don’t have time to rebase it today. I’d propose to revert the >> conflicting patch from the repo and rebase that instead. It saves a day or >> two, plus stops conflicting new development (usage of buffers instead of >> events). >> >> >> >> - Petri >> >> >> >> *From:* ext Bill Fischofer [mailto:bill.fischofer@linaro.org] >> *Sent:* Tuesday, January 27, 2015 12:17 AM >> *To:* Mike Holmes >> *Cc:* Petri Savolainen; lng-odp >> *Subject:* Re: [lng-odp] [PATCH v5 07/17] api: packet: Removed >> odp_packet_to_buffer >> >> >> >> We need to halt merges until events are merged. That's why it's critical >> path. We should be able to fix this as a one-off but we can't keep >> rebasing it. Everything else should rebase on events. >> >> >> >> We'll have the same merge-barrier "all stop" issue with the API directory >> change. >> >> >> >> Bill >> >> >> >> On Mon, Jan 26, 2015 at 3:57 PM, Mike Holmes <mike.holmes@linaro.org> >> wrote: >> >> This no longer applies to tip >> >> >> >> classification/odp_classification_tests.c: In function >> ‘enqueue_loop_interface’: >> >> classification/odp_classification_tests.c:108:2: error: implicit >> declaration of function ‘odp_packet_to_buffer’ >> [-Werror=implicit-function-declaration] >> >> odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); >> >> ^ >> >> classification/odp_classification_tests.c:108:2: error: nested extern >> declaration of ‘odp_packet_to_buffer’ [-Werror=nested-externs] >> >> >> >> >> >> On 26 January 2015 at 08:05, Petri Savolainen <petri.savolainen@linaro.org> >> wrote: >> >> Removed packet to buffer conversion. >> >> packet -> event -> buffer conversions are temporary. >> >> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >> --- >> example/generator/odp_generator.c | 2 +- >> example/ipsec/odp_ipsec.c | 8 ++++---- >> platform/linux-generic/include/api/odp_packet.h | 9 --------- >> platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ >> platform/linux-generic/odp_crypto.c | 4 ++-- >> platform/linux-generic/odp_packet.c | 2 +- >> platform/linux-generic/odp_packet_io.c | 6 +++--- >> test/validation/buffer/odp_packet_test.c | 2 +- >> 8 files changed, 21 insertions(+), 21 deletions(-) >> >> diff --git a/example/generator/odp_generator.c >> b/example/generator/odp_generator.c >> index 547366a..5df8868 100644 >> --- a/example/generator/odp_generator.c >> +++ b/example/generator/odp_generator.c >> @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t >> pkt_tbl[], unsigned len) >> >> odp_atomic_inc_u64(&counters.ip); >> rlen += sprintf(msg, "receive Packet proto:IP "); >> - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); >> + buf = odp_packet_data(pkt); >> ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); >> rlen += sprintf(msg + rlen, "id %d ", >> odp_be_to_cpu_16(ip->id)); >> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >> index a59794a..9fdaeab 100644 >> --- a/example/ipsec/odp_ipsec.c >> +++ b/example/ipsec/odp_ipsec.c >> @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t >> pkt, >> *skip = FALSE; >> if (odp_crypto_operation(¶ms, >> &posted, >> - odp_packet_to_buffer(pkt))) { >> + >> odp_buffer_from_event(odp_packet_to_event(pkt)))) { >> abort(); >> } >> return (posted) ? PKT_POSTED : PKT_CONTINUE; >> @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, >> int trl_len = 0; >> >> /* Check crypto result */ >> - event = odp_packet_to_buffer(pkt); >> + event = odp_buffer_from_event(odp_packet_to_event(pkt)); >> odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); >> if (!is_crypto_compl_status_ok(&cipher_rc)) >> return PKT_DROP; >> @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, >> /* Issue crypto request */ >> if (odp_crypto_operation(&ctx->ipsec.params, >> &posted, >> - odp_packet_to_buffer(pkt))) { >> + >> odp_buffer_from_event(odp_packet_to_event(pkt)))) { >> abort(); >> } >> return (posted) ? PKT_POSTED : PKT_CONTINUE; >> @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, >> odph_ipv4hdr_t *ip; >> >> /* Check crypto result */ >> - event = odp_packet_to_buffer(pkt); >> + event = odp_buffer_from_event(odp_packet_to_event(pkt)); >> odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); >> if (!is_crypto_compl_status_ok(&cipher_rc)) >> return PKT_DROP; >> diff --git a/platform/linux-generic/include/api/odp_packet.h >> b/platform/linux-generic/include/api/odp_packet.h >> index 92b6016..fa3e321 100644 >> --- a/platform/linux-generic/include/api/odp_packet.h >> +++ b/platform/linux-generic/include/api/odp_packet.h >> @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); >> odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); >> >> /** >> - * Convert a packet handle to a buffer handle >> - * >> - * @param pkt Packet handle >> - * >> - * @return Buffer handle >> - */ >> -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); >> - >> -/** >> * Get packet handle from event >> * >> * Converts an ODP_EVENT_PACKET type event to a packet. >> diff --git a/platform/linux-generic/include/odp_packet_internal.h >> b/platform/linux-generic/include/odp_packet_internal.h >> index 179330c..fe4a223 100644 >> --- a/platform/linux-generic/include/odp_packet_internal.h >> +++ b/platform/linux-generic/include/odp_packet_internal.h >> @@ -257,6 +257,15 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t >> pool_hdl); >> >> int _odp_packet_parse(odp_packet_t pkt); >> >> +/* >> + * Convert a packet handle to a buffer handle >> + * >> + * @param pkt Packet handle >> + * >> + * @return Buffer handle >> + */ >> +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/platform/linux-generic/odp_crypto.c >> b/platform/linux-generic/odp_crypto.c >> index bee6fe5..74fac5c 100644 >> --- a/platform/linux-generic/odp_crypto.c >> +++ b/platform/linux-generic/odp_crypto.c >> @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, >> ODP_ABORT(); >> _odp_packet_copy_to_packet(params->pkt, 0, >> params->out_pkt, 0, >> odp_packet_len(params->pkt)); >> - if (completion_event == odp_packet_to_buffer(params->pkt)) >> + if (completion_event == _odp_packet_to_buffer(params->pkt)) >> completion_event = >> - odp_packet_to_buffer(params->out_pkt); >> + _odp_packet_to_buffer(params->out_pkt); >> odp_packet_free(params->pkt); >> params->pkt = ODP_PACKET_INVALID; >> } >> diff --git a/platform/linux-generic/odp_packet.c >> b/platform/linux-generic/odp_packet.c >> index ebe3b55..bcbac79 100644 >> --- a/platform/linux-generic/odp_packet.c >> +++ b/platform/linux-generic/odp_packet.c >> @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) >> return (odp_packet_t)buf; >> } >> >> -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) >> +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) >> { >> return (odp_buffer_t)pkt; >> } >> diff --git a/platform/linux-generic/odp_packet_io.c >> b/platform/linux-generic/odp_packet_io.c >> index 0efa3d0..2de6335 100644 >> --- a/platform/linux-generic/odp_packet_io.c >> +++ b/platform/linux-generic/odp_packet_io.c >> @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t *pktio_entry, >> odp_packet_t pkt_tbl[], >> unsigned i; >> >> for (i = 0; i < len; ++i) >> - hdr_tbl[i] = >> odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); >> + hdr_tbl[i] = >> odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); >> >> qentry = queue_to_qentry(pktio_entry->s.loopq); >> return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; >> @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) >> return NULL; >> >> for (i = 0, j = 0; i < pkts; ++i) { >> - buf = odp_packet_to_buffer(pkt_tbl[i]); >> + buf = _odp_packet_to_buffer(pkt_tbl[i]); >> buf_hdr = odp_buf_to_hdr(buf); >> if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) >> tmp_hdr_tbl[j++] = buf_hdr; >> @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, >> odp_buffer_hdr_t *buf_hdr[], int num) >> return nbr; >> >> for (i = 0, j = 0; i < pkts; ++i) { >> - buf = odp_packet_to_buffer(pkt_tbl[i]); >> + buf = _odp_packet_to_buffer(pkt_tbl[i]); >> tmp_hdr = odp_buf_to_hdr(buf); >> if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) >> tmp_hdr_tbl[j++] = tmp_hdr; >> diff --git a/test/validation/buffer/odp_packet_test.c >> b/test/validation/buffer/odp_packet_test.c >> index 63caec6..6e44443 100644 >> --- a/test/validation/buffer/odp_packet_test.c >> +++ b/test/validation/buffer/odp_packet_test.c >> @@ -374,7 +374,7 @@ static void packet_segments(void) >> } >> >> CU_ASSERT(seg_index == num_segs); >> - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); >> + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); >> CU_ASSERT(data_len == odp_packet_len(pkt)); >> >> if (seg_index == num_segs) >> -- >> 2.2.2 >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> >> >> >> -- >> >> *Mike Holmes* >> >> Linaro Sr Technical Manager >> >> LNG - ODP >> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> >> >> > > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
It's simple merge conflict. I will resolve it as usual when applying. Bala already did patch and it looks good for me. Maxim. On 01/27/2015 11:20 AM, Mike Holmes wrote: > I agree, the intent was not to apply anything that interrupted Events, > maybe it is a simple conflict that can be solved as it is applied, but > if not I think we should revert classification. > > On 27 January 2015 at 03:08, Savolainen, Petri (NSN - FI/Espoo) > <petri.savolainen@nsn.com <mailto:petri.savolainen@nsn.com>> wrote: > > I don’t have time to rebase it today. I’d propose to revert the > conflicting patch from the repo and rebase that instead. It saves > a day or two, plus stops conflicting new development (usage of > buffers instead of events). > > - Petri > > *From:*ext Bill Fischofer [mailto:bill.fischofer@linaro.org > <mailto:bill.fischofer@linaro.org>] > *Sent:* Tuesday, January 27, 2015 12:17 AM > *To:* Mike Holmes > *Cc:* Petri Savolainen; lng-odp > *Subject:* Re: [lng-odp] [PATCH v5 07/17] api: packet: Removed > odp_packet_to_buffer > > We need to halt merges until events are merged. That's why it's > critical path. We should be able to fix this as a one-off but we > can't keep rebasing it. Everything else should rebase on events. > > We'll have the same merge-barrier "all stop" issue with the API > directory change. > > Bill > > On Mon, Jan 26, 2015 at 3:57 PM, Mike Holmes > <mike.holmes@linaro.org <mailto:mike.holmes@linaro.org>> wrote: > > This no longer applies to tip > > classification/odp_classification_tests.c: In function > ‘enqueue_loop_interface’: > > classification/odp_classification_tests.c:108:2: error: implicit > declaration of function ‘odp_packet_to_buffer’ > [-Werror=implicit-function-declaration] > > odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); > > ^ > > classification/odp_classification_tests.c:108:2: error: nested > extern declaration of ‘odp_packet_to_buffer’ [-Werror=nested-externs] > > On 26 January 2015 at 08:05, Petri Savolainen > <petri.savolainen@linaro.org <mailto:petri.savolainen@linaro.org>> > wrote: > > Removed packet to buffer conversion. > > packet -> event -> buffer conversions are temporary. > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org > <mailto:petri.savolainen@linaro.org>> > --- > example/generator/odp_generator.c | 2 +- > example/ipsec/odp_ipsec.c | 8 ++++---- > platform/linux-generic/include/api/odp_packet.h | 9 --------- > platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ > platform/linux-generic/odp_crypto.c | 4 ++-- > platform/linux-generic/odp_packet.c | 2 +- > platform/linux-generic/odp_packet_io.c | 6 +++--- > test/validation/buffer/odp_packet_test.c | 2 +- > 8 files changed, 21 insertions(+), 21 deletions(-) > > diff --git a/example/generator/odp_generator.c > b/example/generator/odp_generator.c > index 547366a..5df8868 100644 > --- a/example/generator/odp_generator.c > +++ b/example/generator/odp_generator.c > @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t > pkt_tbl[], unsigned len) > > odp_atomic_inc_u64(&counters.ip); > rlen += sprintf(msg, "receive Packet proto:IP "); > - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); > + buf = odp_packet_data(pkt); > ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); > rlen += sprintf(msg + rlen, "id %d ", > odp_be_to_cpu_16(ip->id)); > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index a59794a..9fdaeab 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -740,7 +740,7 @@ pkt_disposition_e > do_ipsec_in_classify(odp_packet_t pkt, > *skip = FALSE; > if (odp_crypto_operation(¶ms, > &posted, > - odp_packet_to_buffer(pkt))) { > + odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -766,7 +766,7 @@ pkt_disposition_e > do_ipsec_in_finish(odp_packet_t pkt, > int trl_len = 0; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > @@ -974,7 +974,7 @@ pkt_disposition_e > do_ipsec_out_seq(odp_packet_t pkt, > /* Issue crypto request */ > if (odp_crypto_operation(&ctx->ipsec.params, > &posted, > - odp_packet_to_buffer(pkt))) { > + odp_buffer_from_event(odp_packet_to_event(pkt)))) { > abort(); > } > return (posted) ? PKT_POSTED : PKT_CONTINUE; > @@ -998,7 +998,7 @@ pkt_disposition_e > do_ipsec_out_finish(odp_packet_t pkt, > odph_ipv4hdr_t *ip; > > /* Check crypto result */ > - event = odp_packet_to_buffer(pkt); > + event = odp_buffer_from_event(odp_packet_to_event(pkt)); > odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); > if (!is_crypto_compl_status_ok(&cipher_rc)) > return PKT_DROP; > diff --git a/platform/linux-generic/include/api/odp_packet.h > b/platform/linux-generic/include/api/odp_packet.h > index 92b6016..fa3e321 100644 > --- a/platform/linux-generic/include/api/odp_packet.h > +++ b/platform/linux-generic/include/api/odp_packet.h > @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, > uint32_t len); > odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); > > /** > - * Convert a packet handle to a buffer handle > - * > - * @param pkt Packet handle > - * > - * @return Buffer handle > - */ > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); > - > -/** > * Get packet handle from event > * > * Converts an ODP_EVENT_PACKET type event to a packet. > diff --git a/platform/linux-generic/include/odp_packet_internal.h > b/platform/linux-generic/include/odp_packet_internal.h > index 179330c..fe4a223 100644 > --- a/platform/linux-generic/include/odp_packet_internal.h > +++ b/platform/linux-generic/include/odp_packet_internal.h > @@ -257,6 +257,15 @@ odp_packet_t > _odp_packet_alloc(odp_buffer_pool_t pool_hdl); > > int _odp_packet_parse(odp_packet_t pkt); > > +/* > + * Convert a packet handle to a buffer handle > + * > + * @param pkt Packet handle > + * > + * @return Buffer handle > + */ > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); > + > #ifdef __cplusplus > } > #endif > diff --git a/platform/linux-generic/odp_crypto.c > b/platform/linux-generic/odp_crypto.c > index bee6fe5..74fac5c 100644 > --- a/platform/linux-generic/odp_crypto.c > +++ b/platform/linux-generic/odp_crypto.c > @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t > *params, > ODP_ABORT(); > _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0, > odp_packet_len(params->pkt)); > - if (completion_event == odp_packet_to_buffer(params->pkt)) > + if (completion_event == _odp_packet_to_buffer(params->pkt)) > completion_event = > - odp_packet_to_buffer(params->out_pkt); > + _odp_packet_to_buffer(params->out_pkt); > odp_packet_free(params->pkt); > params->pkt = ODP_PACKET_INVALID; > } > diff --git a/platform/linux-generic/odp_packet.c > b/platform/linux-generic/odp_packet.c > index ebe3b55..bcbac79 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t > buf) > return (odp_packet_t)buf; > } > > -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) > +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) > { > return (odp_buffer_t)pkt; > } > diff --git a/platform/linux-generic/odp_packet_io.c > b/platform/linux-generic/odp_packet_io.c > index 0efa3d0..2de6335 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t > *pktio_entry, odp_packet_t pkt_tbl[], > unsigned i; > > for (i = 0; i < len; ++i) > - hdr_tbl[i] = odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); > + hdr_tbl[i] = odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); > > qentry = queue_to_qentry(pktio_entry->s.loopq); > return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; > @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t > *qentry) > return NULL; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > buf_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = buf_hdr; > @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, > odp_buffer_hdr_t *buf_hdr[], int num) > return nbr; > > for (i = 0, j = 0; i < pkts; ++i) { > - buf = odp_packet_to_buffer(pkt_tbl[i]); > + buf = _odp_packet_to_buffer(pkt_tbl[i]); > tmp_hdr = odp_buf_to_hdr(buf); > if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) > tmp_hdr_tbl[j++] = tmp_hdr; > diff --git a/test/validation/buffer/odp_packet_test.c > b/test/validation/buffer/odp_packet_test.c > index 63caec6..6e44443 100644 > --- a/test/validation/buffer/odp_packet_test.c > +++ b/test/validation/buffer/odp_packet_test.c > @@ -374,7 +374,7 @@ static void packet_segments(void) > } > > CU_ASSERT(seg_index == num_segs); > - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); > + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); > CU_ASSERT(data_len == odp_packet_len(pkt)); > > if (seg_index == num_segs) > -- > 2.2.2 > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > -- > > *Mike Holmes* > > Linaro Sr Technical Manager > > LNG - ODP > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > http://lists.linaro.org/mailman/listinfo/lng-odp > > > > > -- > *Mike Holmes* > Linaro Sr Technical Manager > LNG - ODP > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 547366a..5df8868 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) odp_atomic_inc_u64(&counters.ip); rlen += sprintf(msg, "receive Packet proto:IP "); - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); + buf = odp_packet_data(pkt); ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); rlen += sprintf(msg + rlen, "id %d ", odp_be_to_cpu_16(ip->id)); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index a59794a..9fdaeab 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, *skip = FALSE; if (odp_crypto_operation(¶ms, &posted, - odp_packet_to_buffer(pkt))) { + odp_buffer_from_event(odp_packet_to_event(pkt)))) { abort(); } return (posted) ? PKT_POSTED : PKT_CONTINUE; @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, int trl_len = 0; /* Check crypto result */ - event = odp_packet_to_buffer(pkt); + event = odp_buffer_from_event(odp_packet_to_event(pkt)); odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, /* Issue crypto request */ if (odp_crypto_operation(&ctx->ipsec.params, &posted, - odp_packet_to_buffer(pkt))) { + odp_buffer_from_event(odp_packet_to_event(pkt)))) { abort(); } return (posted) ? PKT_POSTED : PKT_CONTINUE; @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, odph_ipv4hdr_t *ip; /* Check crypto result */ - event = odp_packet_to_buffer(pkt); + event = odp_buffer_from_event(odp_packet_to_event(pkt)); odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 92b6016..fa3e321 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); /** - * Convert a packet handle to a buffer handle - * - * @param pkt Packet handle - * - * @return Buffer handle - */ -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); - -/** * Get packet handle from event * * Converts an ODP_EVENT_PACKET type event to a packet. diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 179330c..fe4a223 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -257,6 +257,15 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t pool_hdl); int _odp_packet_parse(odp_packet_t pkt); +/* + * Convert a packet handle to a buffer handle + * + * @param pkt Packet handle + * + * @return Buffer handle + */ +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index bee6fe5..74fac5c 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, ODP_ABORT(); _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0, odp_packet_len(params->pkt)); - if (completion_event == odp_packet_to_buffer(params->pkt)) + if (completion_event == _odp_packet_to_buffer(params->pkt)) completion_event = - odp_packet_to_buffer(params->out_pkt); + _odp_packet_to_buffer(params->out_pkt); odp_packet_free(params->pkt); params->pkt = ODP_PACKET_INVALID; } diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index ebe3b55..bcbac79 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) return (odp_packet_t)buf; } -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) { return (odp_buffer_t)pkt; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 0efa3d0..2de6335 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -407,7 +407,7 @@ static int enq_loopback(pktio_entry_t *pktio_entry, odp_packet_t pkt_tbl[], unsigned i; for (i = 0; i < len; ++i) - hdr_tbl[i] = odp_buf_to_hdr(odp_packet_to_buffer(pkt_tbl[i])); + hdr_tbl[i] = odp_buf_to_hdr(_odp_packet_to_buffer(pkt_tbl[i])); qentry = queue_to_qentry(pktio_entry->s.loopq); return queue_enq_multi(qentry, hdr_tbl, len) == 0 ? len : 0; @@ -588,7 +588,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) return NULL; for (i = 0, j = 0; i < pkts; ++i) { - buf = odp_packet_to_buffer(pkt_tbl[i]); + buf = _odp_packet_to_buffer(pkt_tbl[i]); buf_hdr = odp_buf_to_hdr(buf); if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) tmp_hdr_tbl[j++] = buf_hdr; @@ -634,7 +634,7 @@ int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) return nbr; for (i = 0, j = 0; i < pkts; ++i) { - buf = odp_packet_to_buffer(pkt_tbl[i]); + buf = _odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr = odp_buf_to_hdr(buf); if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) tmp_hdr_tbl[j++] = tmp_hdr; diff --git a/test/validation/buffer/odp_packet_test.c b/test/validation/buffer/odp_packet_test.c index 63caec6..6e44443 100644 --- a/test/validation/buffer/odp_packet_test.c +++ b/test/validation/buffer/odp_packet_test.c @@ -374,7 +374,7 @@ static void packet_segments(void) } CU_ASSERT(seg_index == num_segs); - CU_ASSERT(buf_len == odp_buffer_size(odp_packet_to_buffer(pkt))); + CU_ASSERT(buf_len == odp_packet_buf_len(pkt)); CU_ASSERT(data_len == odp_packet_len(pkt)); if (seg_index == num_segs)
Removed packet to buffer conversion. packet -> event -> buffer conversions are temporary. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 8 ++++---- platform/linux-generic/include/api/odp_packet.h | 9 --------- platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ platform/linux-generic/odp_crypto.c | 4 ++-- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/odp_packet_io.c | 6 +++--- test/validation/buffer/odp_packet_test.c | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-)