Message ID | 1412331478-30433-1-git-send-email-petri.savolainen@linaro.org |
---|---|
State | Accepted |
Commit | 4f7a5cbb08297b83b795521d79a4d74115a619f9 |
Headers | show |
Merged both patches, thanks! Maxim. On 10/03/2014 02:17 PM, Petri Savolainen wrote: > - Unify function naming between packets and segment: xxx_addr(), xxx_data() > - Rename odp_packet_buf_addr() to odp_packet_addr() > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > --- > example/ipsec/odp_ipsec.c | 8 ++++---- > platform/linux-generic/include/api/odp_packet.h | 8 ++++---- > platform/linux-generic/odp_crypto.c | 8 ++++---- > platform/linux-generic/odp_packet.c | 10 +++++----- > platform/linux-generic/odp_packet_socket.c | 10 +++++----- > 5 files changed, 22 insertions(+), 22 deletions(-) > > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c > index cd94d9a..bca957f 100644 > --- a/example/ipsec/odp_ipsec.c > +++ b/example/ipsec/odp_ipsec.c > @@ -673,7 +673,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, > pkt_ctx_t *ctx, > bool *skip) > { > - uint8_t *buf = odp_packet_buf_addr(pkt); > + uint8_t *buf = odp_packet_addr(pkt); > odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); > int hdr_len; > odph_ahhdr_t *ah = NULL; > @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, > * Finish auth > */ > if (ctx->ipsec.ah_offset) { > - uint8_t *buf = odp_packet_buf_addr(pkt); > + uint8_t *buf = odp_packet_addr(pkt); > odph_ahhdr_t *ah; > > ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); > @@ -833,7 +833,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt, > pkt_ctx_t *ctx, > bool *skip) > { > - uint8_t *buf = odp_packet_buf_addr(pkt); > + uint8_t *buf = odp_packet_addr(pkt); > odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); > uint16_t ip_data_len = ipv4_data_len(ip); > uint8_t *ip_data = ipv4_data_p(ip); > @@ -953,7 +953,7 @@ static > pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, > pkt_ctx_t *ctx) > { > - uint8_t *buf = odp_packet_buf_addr(pkt); > + uint8_t *buf = odp_packet_addr(pkt); > bool posted = 0; > > /* We were dispatched from atomic queue, assign sequence numbers */ > diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h > index 4a089d1..83f345a 100644 > --- a/platform/linux-generic/include/api/odp_packet.h > +++ b/platform/linux-generic/include/api/odp_packet.h > @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); > * > * @see odp_packet_l2(), odp_packet_start() > */ > -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); > +uint8_t *odp_packet_addr(odp_packet_t pkt); > > /** > * Get pointer to the start of the received frame > @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); > * > * @return Pointer to the start of the received frame > * > - * @see odp_packet_l2(), odp_packet_buf_addr() > + * @see odp_packet_l2(), odp_packet_addr() > */ > uint8_t *odp_packet_start(odp_packet_t pkt); > > @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); > * Get pointer to the start of the L2 frame > * > * The L2 frame header address is not necessarily the same as the address of the > - * packet buffer, see odp_packet_buf_addr() > + * packet buffer, see odp_packet_addr() > * > * @param pkt Packet handle > * > * @return Pointer to L2 header or NULL if not found > * > - * @see odp_packet_buf_addr(), odp_packet_start() > + * @see odp_packet_addr(), odp_packet_start() > */ > uint8_t *odp_packet_l2(odp_packet_t pkt); > > diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c > index 12d0272..b37ad6b 100644 > --- a/platform/linux-generic/odp_crypto.c > +++ b/platform/linux-generic/odp_crypto.c > @@ -78,7 +78,7 @@ static > enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, > odp_crypto_generic_session_t *session) > { > - uint8_t *data = odp_packet_buf_addr(params->out_pkt); > + uint8_t *data = odp_packet_addr(params->out_pkt); > uint8_t *icv = data; > uint32_t len = params->auth_range.length; > uint8_t hash[EVP_MAX_MD_SIZE]; > @@ -106,7 +106,7 @@ static > enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, > odp_crypto_generic_session_t *session) > { > - uint8_t *data = odp_packet_buf_addr(params->out_pkt); > + uint8_t *data = odp_packet_addr(params->out_pkt); > uint8_t *icv = data; > uint32_t len = params->auth_range.length; > uint32_t bytes = session->auth.data.md5.bytes; > @@ -144,7 +144,7 @@ static > enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, > odp_crypto_generic_session_t *session) > { > - uint8_t *data = odp_packet_buf_addr(params->out_pkt); > + uint8_t *data = odp_packet_addr(params->out_pkt); > uint32_t len = params->cipher_range.length; > DES_cblock *iv; > DES_cblock iv_temp; > @@ -181,7 +181,7 @@ static > enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, > odp_crypto_generic_session_t *session) > { > - uint8_t *data = odp_packet_buf_addr(params->out_pkt); > + uint8_t *data = odp_packet_addr(params->out_pkt); > uint32_t len = params->cipher_range.length; > DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; > > diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c > index 64fd0f8..6cd6183 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) > return odp_packet_hdr(pkt)->frame_len; > } > > -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) > +uint8_t *odp_packet_addr(odp_packet_t pkt) > { > return odp_buffer_addr(odp_buffer_from_packet(pkt)); > } > > uint8_t *odp_packet_start(odp_packet_t pkt) > { > - return odp_packet_buf_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; > + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; > } > > > @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) > if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) > return NULL; > > - return odp_packet_buf_addr(pkt) + offset; > + return odp_packet_addr(pkt) + offset; > } > > size_t odp_packet_l2_offset(odp_packet_t pkt) > @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) > if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) > return NULL; > > - return odp_packet_buf_addr(pkt) + offset; > + return odp_packet_addr(pkt) + offset; > } > > size_t odp_packet_l3_offset(odp_packet_t pkt) > @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) > if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) > return NULL; > > - return odp_packet_buf_addr(pkt) + offset; > + return odp_packet_addr(pkt) + offset; > } > > size_t odp_packet_l4_offset(odp_packet_t pkt) > diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c > index e173c31..e3c2753 100644 > --- a/platform/linux-generic/odp_packet_socket.c > +++ b/platform/linux-generic/odp_packet_socket.c > @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, > if (!odph_packet_is_valid(pkt)) > return -1; > > - pkt_buf = odp_packet_buf_addr(pkt); > + pkt_buf = odp_packet_addr(pkt); > l2_hdr = ETHBUF_ALIGN(pkt_buf); > /* Store eth buffer offset for pkt buffers from this pool */ > pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; > @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, > break; > } > > - pkt_buf = odp_packet_buf_addr(pkt); > + pkt_buf = odp_packet_addr(pkt); > l2_hdr = pkt_buf + pkt_sock->frame_offset; > > recv_bytes = recvfrom(sockfd, l2_hdr, > @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, > if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) > break; > > - pkt_buf = odp_packet_buf_addr(pkt_table[i]); > + pkt_buf = odp_packet_addr(pkt_table[i]); > l2_hdr = pkt_buf + pkt_sock->frame_offset; > iovecs[i].iov_base = l2_hdr; > iovecs[i].iov_len = pkt_sock->max_frame_len; > @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, struct ring *ring, > if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) > break; > > - l2_hdr = odp_packet_buf_addr(pkt_table[i]) > + l2_hdr = odp_packet_addr(pkt_table[i]) > + frame_offset; > memcpy(l2_hdr, pkt_buf, pkt_len); > > @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, > if (!odph_packet_is_valid(pkt)) > return -1; > > - pkt_buf = odp_packet_buf_addr(pkt); > + pkt_buf = odp_packet_addr(pkt); > l2_hdr = ETHBUF_ALIGN(pkt_buf); > /* Store eth buffer offset for pkt buffers from this pool */ > pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf;
Looks like I missed patch time and did not survive 24 hour moratorium to let everyone review that patch. I'm sorry about that. If there are objections I can remove these 2 patches from top of git. Best regards, Maxim. On 10/03/2014 05:14 PM, Maxim Uvarov wrote: > Merged both patches, thanks! > > Maxim. > > On 10/03/2014 02:17 PM, Petri Savolainen wrote: >> - Unify function naming between packets and segment: xxx_addr(), >> xxx_data() >> - Rename odp_packet_buf_addr() to odp_packet_addr() >> >> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >> --- >> example/ipsec/odp_ipsec.c | 8 ++++---- >> platform/linux-generic/include/api/odp_packet.h | 8 ++++---- >> platform/linux-generic/odp_crypto.c | 8 ++++---- >> platform/linux-generic/odp_packet.c | 10 +++++----- >> platform/linux-generic/odp_packet_socket.c | 10 +++++----- >> 5 files changed, 22 insertions(+), 22 deletions(-) >> >> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >> index cd94d9a..bca957f 100644 >> --- a/example/ipsec/odp_ipsec.c >> +++ b/example/ipsec/odp_ipsec.c >> @@ -673,7 +673,7 @@ pkt_disposition_e >> do_ipsec_in_classify(odp_packet_t pkt, >> pkt_ctx_t *ctx, >> bool *skip) >> { >> - uint8_t *buf = odp_packet_buf_addr(pkt); >> + uint8_t *buf = odp_packet_addr(pkt); >> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >> int hdr_len; >> odph_ahhdr_t *ah = NULL; >> @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t >> pkt, >> * Finish auth >> */ >> if (ctx->ipsec.ah_offset) { >> - uint8_t *buf = odp_packet_buf_addr(pkt); >> + uint8_t *buf = odp_packet_addr(pkt); >> odph_ahhdr_t *ah; >> ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); >> @@ -833,7 +833,7 @@ pkt_disposition_e >> do_ipsec_out_classify(odp_packet_t pkt, >> pkt_ctx_t *ctx, >> bool *skip) >> { >> - uint8_t *buf = odp_packet_buf_addr(pkt); >> + uint8_t *buf = odp_packet_addr(pkt); >> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >> uint16_t ip_data_len = ipv4_data_len(ip); >> uint8_t *ip_data = ipv4_data_p(ip); >> @@ -953,7 +953,7 @@ static >> pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, >> pkt_ctx_t *ctx) >> { >> - uint8_t *buf = odp_packet_buf_addr(pkt); >> + uint8_t *buf = odp_packet_addr(pkt); >> bool posted = 0; >> /* We were dispatched from atomic queue, assign sequence >> numbers */ >> diff --git a/platform/linux-generic/include/api/odp_packet.h >> b/platform/linux-generic/include/api/odp_packet.h >> index 4a089d1..83f345a 100644 >> --- a/platform/linux-generic/include/api/odp_packet.h >> +++ b/platform/linux-generic/include/api/odp_packet.h >> @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); >> * >> * @see odp_packet_l2(), odp_packet_start() >> */ >> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >> +uint8_t *odp_packet_addr(odp_packet_t pkt); >> /** >> * Get pointer to the start of the received frame >> @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >> * >> * @return Pointer to the start of the received frame >> * >> - * @see odp_packet_l2(), odp_packet_buf_addr() >> + * @see odp_packet_l2(), odp_packet_addr() >> */ >> uint8_t *odp_packet_start(odp_packet_t pkt); >> @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); >> * Get pointer to the start of the L2 frame >> * >> * The L2 frame header address is not necessarily the same as the >> address of the >> - * packet buffer, see odp_packet_buf_addr() >> + * packet buffer, see odp_packet_addr() >> * >> * @param pkt Packet handle >> * >> * @return Pointer to L2 header or NULL if not found >> * >> - * @see odp_packet_buf_addr(), odp_packet_start() >> + * @see odp_packet_addr(), odp_packet_start() >> */ >> uint8_t *odp_packet_l2(odp_packet_t pkt); >> diff --git a/platform/linux-generic/odp_crypto.c >> b/platform/linux-generic/odp_crypto.c >> index 12d0272..b37ad6b 100644 >> --- a/platform/linux-generic/odp_crypto.c >> +++ b/platform/linux-generic/odp_crypto.c >> @@ -78,7 +78,7 @@ static >> enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, >> odp_crypto_generic_session_t *session) >> { >> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >> + uint8_t *data = odp_packet_addr(params->out_pkt); >> uint8_t *icv = data; >> uint32_t len = params->auth_range.length; >> uint8_t hash[EVP_MAX_MD_SIZE]; >> @@ -106,7 +106,7 @@ static >> enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, >> odp_crypto_generic_session_t *session) >> { >> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >> + uint8_t *data = odp_packet_addr(params->out_pkt); >> uint8_t *icv = data; >> uint32_t len = params->auth_range.length; >> uint32_t bytes = session->auth.data.md5.bytes; >> @@ -144,7 +144,7 @@ static >> enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, >> odp_crypto_generic_session_t *session) >> { >> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >> + uint8_t *data = odp_packet_addr(params->out_pkt); >> uint32_t len = params->cipher_range.length; >> DES_cblock *iv; >> DES_cblock iv_temp; >> @@ -181,7 +181,7 @@ static >> enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, >> odp_crypto_generic_session_t *session) >> { >> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >> + uint8_t *data = odp_packet_addr(params->out_pkt); >> uint32_t len = params->cipher_range.length; >> DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; >> diff --git a/platform/linux-generic/odp_packet.c >> b/platform/linux-generic/odp_packet.c >> index 64fd0f8..6cd6183 100644 >> --- a/platform/linux-generic/odp_packet.c >> +++ b/platform/linux-generic/odp_packet.c >> @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) >> return odp_packet_hdr(pkt)->frame_len; >> } >> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) >> +uint8_t *odp_packet_addr(odp_packet_t pkt) >> { >> return odp_buffer_addr(odp_buffer_from_packet(pkt)); >> } >> uint8_t *odp_packet_start(odp_packet_t pkt) >> { >> - return odp_packet_buf_addr(pkt) + >> odp_packet_hdr(pkt)->frame_offset; >> + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; >> } >> @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) >> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >> return NULL; >> - return odp_packet_buf_addr(pkt) + offset; >> + return odp_packet_addr(pkt) + offset; >> } >> size_t odp_packet_l2_offset(odp_packet_t pkt) >> @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) >> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >> return NULL; >> - return odp_packet_buf_addr(pkt) + offset; >> + return odp_packet_addr(pkt) + offset; >> } >> size_t odp_packet_l3_offset(odp_packet_t pkt) >> @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) >> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >> return NULL; >> - return odp_packet_buf_addr(pkt) + offset; >> + return odp_packet_addr(pkt) + offset; >> } >> size_t odp_packet_l4_offset(odp_packet_t pkt) >> diff --git a/platform/linux-generic/odp_packet_socket.c >> b/platform/linux-generic/odp_packet_socket.c >> index e173c31..e3c2753 100644 >> --- a/platform/linux-generic/odp_packet_socket.c >> +++ b/platform/linux-generic/odp_packet_socket.c >> @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, >> const char *netdev, >> if (!odph_packet_is_valid(pkt)) >> return -1; >> - pkt_buf = odp_packet_buf_addr(pkt); >> + pkt_buf = odp_packet_addr(pkt); >> l2_hdr = ETHBUF_ALIGN(pkt_buf); >> /* Store eth buffer offset for pkt buffers from this pool */ >> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >> @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, >> break; >> } >> - pkt_buf = odp_packet_buf_addr(pkt); >> + pkt_buf = odp_packet_addr(pkt); >> l2_hdr = pkt_buf + pkt_sock->frame_offset; >> recv_bytes = recvfrom(sockfd, l2_hdr, >> @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, >> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >> break; >> - pkt_buf = odp_packet_buf_addr(pkt_table[i]); >> + pkt_buf = odp_packet_addr(pkt_table[i]); >> l2_hdr = pkt_buf + pkt_sock->frame_offset; >> iovecs[i].iov_base = l2_hdr; >> iovecs[i].iov_len = pkt_sock->max_frame_len; >> @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, >> struct ring *ring, >> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >> break; >> - l2_hdr = odp_packet_buf_addr(pkt_table[i]) >> + l2_hdr = odp_packet_addr(pkt_table[i]) >> + frame_offset; >> memcpy(l2_hdr, pkt_buf, pkt_len); >> @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const >> pkt_sock, const char *netdev, >> if (!odph_packet_is_valid(pkt)) >> return -1; >> - pkt_buf = odp_packet_buf_addr(pkt); >> + pkt_buf = odp_packet_addr(pkt); >> l2_hdr = ETHBUF_ALIGN(pkt_buf); >> /* Store eth buffer offset for pkt buffers from this pool */ >> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >
These were some of the more harmless patches, merely renaming some functions. If it builds and runs, fine. Now if someone would like to approve v4 of the Timer patch... -- Ola On 3 October 2014 16:46, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > Looks like I missed patch time and did not survive 24 hour moratorium to > let everyone review that patch. > I'm sorry about that. If there are objections I can remove these 2 patches > from top of git. > > Best regards, > Maxim. > > On 10/03/2014 05:14 PM, Maxim Uvarov wrote: > >> Merged both patches, thanks! >> >> Maxim. >> >> On 10/03/2014 02:17 PM, Petri Savolainen wrote: >> >>> - Unify function naming between packets and segment: xxx_addr(), >>> xxx_data() >>> - Rename odp_packet_buf_addr() to odp_packet_addr() >>> >>> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >>> --- >>> example/ipsec/odp_ipsec.c | 8 ++++---- >>> platform/linux-generic/include/api/odp_packet.h | 8 ++++---- >>> platform/linux-generic/odp_crypto.c | 8 ++++---- >>> platform/linux-generic/odp_packet.c | 10 +++++----- >>> platform/linux-generic/odp_packet_socket.c | 10 +++++----- >>> 5 files changed, 22 insertions(+), 22 deletions(-) >>> >>> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >>> index cd94d9a..bca957f 100644 >>> --- a/example/ipsec/odp_ipsec.c >>> +++ b/example/ipsec/odp_ipsec.c >>> @@ -673,7 +673,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t >>> pkt, >>> pkt_ctx_t *ctx, >>> bool *skip) >>> { >>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>> + uint8_t *buf = odp_packet_addr(pkt); >>> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >>> int hdr_len; >>> odph_ahhdr_t *ah = NULL; >>> @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t >>> pkt, >>> * Finish auth >>> */ >>> if (ctx->ipsec.ah_offset) { >>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>> + uint8_t *buf = odp_packet_addr(pkt); >>> odph_ahhdr_t *ah; >>> ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); >>> @@ -833,7 +833,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t >>> pkt, >>> pkt_ctx_t *ctx, >>> bool *skip) >>> { >>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>> + uint8_t *buf = odp_packet_addr(pkt); >>> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >>> uint16_t ip_data_len = ipv4_data_len(ip); >>> uint8_t *ip_data = ipv4_data_p(ip); >>> @@ -953,7 +953,7 @@ static >>> pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, >>> pkt_ctx_t *ctx) >>> { >>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>> + uint8_t *buf = odp_packet_addr(pkt); >>> bool posted = 0; >>> /* We were dispatched from atomic queue, assign sequence numbers >>> */ >>> diff --git a/platform/linux-generic/include/api/odp_packet.h >>> b/platform/linux-generic/include/api/odp_packet.h >>> index 4a089d1..83f345a 100644 >>> --- a/platform/linux-generic/include/api/odp_packet.h >>> +++ b/platform/linux-generic/include/api/odp_packet.h >>> @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); >>> * >>> * @see odp_packet_l2(), odp_packet_start() >>> */ >>> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >>> +uint8_t *odp_packet_addr(odp_packet_t pkt); >>> /** >>> * Get pointer to the start of the received frame >>> @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >>> * >>> * @return Pointer to the start of the received frame >>> * >>> - * @see odp_packet_l2(), odp_packet_buf_addr() >>> + * @see odp_packet_l2(), odp_packet_addr() >>> */ >>> uint8_t *odp_packet_start(odp_packet_t pkt); >>> @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); >>> * Get pointer to the start of the L2 frame >>> * >>> * The L2 frame header address is not necessarily the same as the >>> address of the >>> - * packet buffer, see odp_packet_buf_addr() >>> + * packet buffer, see odp_packet_addr() >>> * >>> * @param pkt Packet handle >>> * >>> * @return Pointer to L2 header or NULL if not found >>> * >>> - * @see odp_packet_buf_addr(), odp_packet_start() >>> + * @see odp_packet_addr(), odp_packet_start() >>> */ >>> uint8_t *odp_packet_l2(odp_packet_t pkt); >>> diff --git a/platform/linux-generic/odp_crypto.c >>> b/platform/linux-generic/odp_crypto.c >>> index 12d0272..b37ad6b 100644 >>> --- a/platform/linux-generic/odp_crypto.c >>> +++ b/platform/linux-generic/odp_crypto.c >>> @@ -78,7 +78,7 @@ static >>> enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, >>> odp_crypto_generic_session_t *session) >>> { >>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>> uint8_t *icv = data; >>> uint32_t len = params->auth_range.length; >>> uint8_t hash[EVP_MAX_MD_SIZE]; >>> @@ -106,7 +106,7 @@ static >>> enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, >>> odp_crypto_generic_session_t *session) >>> { >>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>> uint8_t *icv = data; >>> uint32_t len = params->auth_range.length; >>> uint32_t bytes = session->auth.data.md5.bytes; >>> @@ -144,7 +144,7 @@ static >>> enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, >>> odp_crypto_generic_session_t *session) >>> { >>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>> uint32_t len = params->cipher_range.length; >>> DES_cblock *iv; >>> DES_cblock iv_temp; >>> @@ -181,7 +181,7 @@ static >>> enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, >>> odp_crypto_generic_session_t *session) >>> { >>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>> uint32_t len = params->cipher_range.length; >>> DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; >>> diff --git a/platform/linux-generic/odp_packet.c >>> b/platform/linux-generic/odp_packet.c >>> index 64fd0f8..6cd6183 100644 >>> --- a/platform/linux-generic/odp_packet.c >>> +++ b/platform/linux-generic/odp_packet.c >>> @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) >>> return odp_packet_hdr(pkt)->frame_len; >>> } >>> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) >>> +uint8_t *odp_packet_addr(odp_packet_t pkt) >>> { >>> return odp_buffer_addr(odp_buffer_from_packet(pkt)); >>> } >>> uint8_t *odp_packet_start(odp_packet_t pkt) >>> { >>> - return odp_packet_buf_addr(pkt) + odp_packet_hdr(pkt)->frame_ >>> offset; >>> + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; >>> } >>> @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) >>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>> return NULL; >>> - return odp_packet_buf_addr(pkt) + offset; >>> + return odp_packet_addr(pkt) + offset; >>> } >>> size_t odp_packet_l2_offset(odp_packet_t pkt) >>> @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) >>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>> return NULL; >>> - return odp_packet_buf_addr(pkt) + offset; >>> + return odp_packet_addr(pkt) + offset; >>> } >>> size_t odp_packet_l3_offset(odp_packet_t pkt) >>> @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) >>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>> return NULL; >>> - return odp_packet_buf_addr(pkt) + offset; >>> + return odp_packet_addr(pkt) + offset; >>> } >>> size_t odp_packet_l4_offset(odp_packet_t pkt) >>> diff --git a/platform/linux-generic/odp_packet_socket.c >>> b/platform/linux-generic/odp_packet_socket.c >>> index e173c31..e3c2753 100644 >>> --- a/platform/linux-generic/odp_packet_socket.c >>> +++ b/platform/linux-generic/odp_packet_socket.c >>> @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const >>> char *netdev, >>> if (!odph_packet_is_valid(pkt)) >>> return -1; >>> - pkt_buf = odp_packet_buf_addr(pkt); >>> + pkt_buf = odp_packet_addr(pkt); >>> l2_hdr = ETHBUF_ALIGN(pkt_buf); >>> /* Store eth buffer offset for pkt buffers from this pool */ >>> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >>> @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, >>> break; >>> } >>> - pkt_buf = odp_packet_buf_addr(pkt); >>> + pkt_buf = odp_packet_addr(pkt); >>> l2_hdr = pkt_buf + pkt_sock->frame_offset; >>> recv_bytes = recvfrom(sockfd, l2_hdr, >>> @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, >>> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >>> break; >>> - pkt_buf = odp_packet_buf_addr(pkt_table[i]); >>> + pkt_buf = odp_packet_addr(pkt_table[i]); >>> l2_hdr = pkt_buf + pkt_sock->frame_offset; >>> iovecs[i].iov_base = l2_hdr; >>> iovecs[i].iov_len = pkt_sock->max_frame_len; >>> @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, >>> struct ring *ring, >>> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >>> break; >>> - l2_hdr = odp_packet_buf_addr(pkt_table[i]) >>> + l2_hdr = odp_packet_addr(pkt_table[i]) >>> + frame_offset; >>> memcpy(l2_hdr, pkt_buf, pkt_len); >>> @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const >>> pkt_sock, const char *netdev, >>> if (!odph_packet_is_valid(pkt)) >>> return -1; >>> - pkt_buf = odp_packet_buf_addr(pkt); >>> + pkt_buf = odp_packet_addr(pkt); >>> l2_hdr = ETHBUF_ALIGN(pkt_buf); >>> /* Store eth buffer offset for pkt buffers from this pool */ >>> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >>> >> >> > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp >
On 3 October 2014 19:00, Ola Liljedahl <ola.liljedahl@linaro.org> wrote: > These were some of the more harmless patches, merely renaming some > functions. If it builds and runs, fine. > > Now if someone would like to approve v4 of the Timer patch... > git am -3 will not resolve that automatically? > > -- Ola > > > On 3 October 2014 16:46, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > >> Looks like I missed patch time and did not survive 24 hour moratorium to >> let everyone review that patch. >> I'm sorry about that. If there are objections I can remove these 2 >> patches from top of git. >> >> Best regards, >> Maxim. >> >> On 10/03/2014 05:14 PM, Maxim Uvarov wrote: >> >>> Merged both patches, thanks! >>> >>> Maxim. >>> >>> On 10/03/2014 02:17 PM, Petri Savolainen wrote: >>> >>>> - Unify function naming between packets and segment: xxx_addr(), >>>> xxx_data() >>>> - Rename odp_packet_buf_addr() to odp_packet_addr() >>>> >>>> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >>>> --- >>>> example/ipsec/odp_ipsec.c | 8 ++++---- >>>> platform/linux-generic/include/api/odp_packet.h | 8 ++++---- >>>> platform/linux-generic/odp_crypto.c | 8 ++++---- >>>> platform/linux-generic/odp_packet.c | 10 +++++----- >>>> platform/linux-generic/odp_packet_socket.c | 10 +++++----- >>>> 5 files changed, 22 insertions(+), 22 deletions(-) >>>> >>>> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c >>>> index cd94d9a..bca957f 100644 >>>> --- a/example/ipsec/odp_ipsec.c >>>> +++ b/example/ipsec/odp_ipsec.c >>>> @@ -673,7 +673,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t >>>> pkt, >>>> pkt_ctx_t *ctx, >>>> bool *skip) >>>> { >>>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>>> + uint8_t *buf = odp_packet_addr(pkt); >>>> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >>>> int hdr_len; >>>> odph_ahhdr_t *ah = NULL; >>>> @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t >>>> pkt, >>>> * Finish auth >>>> */ >>>> if (ctx->ipsec.ah_offset) { >>>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>>> + uint8_t *buf = odp_packet_addr(pkt); >>>> odph_ahhdr_t *ah; >>>> ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); >>>> @@ -833,7 +833,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t >>>> pkt, >>>> pkt_ctx_t *ctx, >>>> bool *skip) >>>> { >>>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>>> + uint8_t *buf = odp_packet_addr(pkt); >>>> odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); >>>> uint16_t ip_data_len = ipv4_data_len(ip); >>>> uint8_t *ip_data = ipv4_data_p(ip); >>>> @@ -953,7 +953,7 @@ static >>>> pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, >>>> pkt_ctx_t *ctx) >>>> { >>>> - uint8_t *buf = odp_packet_buf_addr(pkt); >>>> + uint8_t *buf = odp_packet_addr(pkt); >>>> bool posted = 0; >>>> /* We were dispatched from atomic queue, assign sequence >>>> numbers */ >>>> diff --git a/platform/linux-generic/include/api/odp_packet.h >>>> b/platform/linux-generic/include/api/odp_packet.h >>>> index 4a089d1..83f345a 100644 >>>> --- a/platform/linux-generic/include/api/odp_packet.h >>>> +++ b/platform/linux-generic/include/api/odp_packet.h >>>> @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); >>>> * >>>> * @see odp_packet_l2(), odp_packet_start() >>>> */ >>>> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >>>> +uint8_t *odp_packet_addr(odp_packet_t pkt); >>>> /** >>>> * Get pointer to the start of the received frame >>>> @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); >>>> * >>>> * @return Pointer to the start of the received frame >>>> * >>>> - * @see odp_packet_l2(), odp_packet_buf_addr() >>>> + * @see odp_packet_l2(), odp_packet_addr() >>>> */ >>>> uint8_t *odp_packet_start(odp_packet_t pkt); >>>> @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); >>>> * Get pointer to the start of the L2 frame >>>> * >>>> * The L2 frame header address is not necessarily the same as the >>>> address of the >>>> - * packet buffer, see odp_packet_buf_addr() >>>> + * packet buffer, see odp_packet_addr() >>>> * >>>> * @param pkt Packet handle >>>> * >>>> * @return Pointer to L2 header or NULL if not found >>>> * >>>> - * @see odp_packet_buf_addr(), odp_packet_start() >>>> + * @see odp_packet_addr(), odp_packet_start() >>>> */ >>>> uint8_t *odp_packet_l2(odp_packet_t pkt); >>>> diff --git a/platform/linux-generic/odp_crypto.c >>>> b/platform/linux-generic/odp_crypto.c >>>> index 12d0272..b37ad6b 100644 >>>> --- a/platform/linux-generic/odp_crypto.c >>>> +++ b/platform/linux-generic/odp_crypto.c >>>> @@ -78,7 +78,7 @@ static >>>> enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, >>>> odp_crypto_generic_session_t *session) >>>> { >>>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>>> uint8_t *icv = data; >>>> uint32_t len = params->auth_range.length; >>>> uint8_t hash[EVP_MAX_MD_SIZE]; >>>> @@ -106,7 +106,7 @@ static >>>> enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, >>>> odp_crypto_generic_session_t *session) >>>> { >>>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>>> uint8_t *icv = data; >>>> uint32_t len = params->auth_range.length; >>>> uint32_t bytes = session->auth.data.md5.bytes; >>>> @@ -144,7 +144,7 @@ static >>>> enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, >>>> odp_crypto_generic_session_t *session) >>>> { >>>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>>> uint32_t len = params->cipher_range.length; >>>> DES_cblock *iv; >>>> DES_cblock iv_temp; >>>> @@ -181,7 +181,7 @@ static >>>> enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, >>>> odp_crypto_generic_session_t *session) >>>> { >>>> - uint8_t *data = odp_packet_buf_addr(params->out_pkt); >>>> + uint8_t *data = odp_packet_addr(params->out_pkt); >>>> uint32_t len = params->cipher_range.length; >>>> DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; >>>> diff --git a/platform/linux-generic/odp_packet.c >>>> b/platform/linux-generic/odp_packet.c >>>> index 64fd0f8..6cd6183 100644 >>>> --- a/platform/linux-generic/odp_packet.c >>>> +++ b/platform/linux-generic/odp_packet.c >>>> @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) >>>> return odp_packet_hdr(pkt)->frame_len; >>>> } >>>> -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) >>>> +uint8_t *odp_packet_addr(odp_packet_t pkt) >>>> { >>>> return odp_buffer_addr(odp_buffer_from_packet(pkt)); >>>> } >>>> uint8_t *odp_packet_start(odp_packet_t pkt) >>>> { >>>> - return odp_packet_buf_addr(pkt) + odp_packet_hdr(pkt)->frame_ >>>> offset; >>>> + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; >>>> } >>>> @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) >>>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>>> return NULL; >>>> - return odp_packet_buf_addr(pkt) + offset; >>>> + return odp_packet_addr(pkt) + offset; >>>> } >>>> size_t odp_packet_l2_offset(odp_packet_t pkt) >>>> @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) >>>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>>> return NULL; >>>> - return odp_packet_buf_addr(pkt) + offset; >>>> + return odp_packet_addr(pkt) + offset; >>>> } >>>> size_t odp_packet_l3_offset(odp_packet_t pkt) >>>> @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) >>>> if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) >>>> return NULL; >>>> - return odp_packet_buf_addr(pkt) + offset; >>>> + return odp_packet_addr(pkt) + offset; >>>> } >>>> size_t odp_packet_l4_offset(odp_packet_t pkt) >>>> diff --git a/platform/linux-generic/odp_packet_socket.c >>>> b/platform/linux-generic/odp_packet_socket.c >>>> index e173c31..e3c2753 100644 >>>> --- a/platform/linux-generic/odp_packet_socket.c >>>> +++ b/platform/linux-generic/odp_packet_socket.c >>>> @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, >>>> const char *netdev, >>>> if (!odph_packet_is_valid(pkt)) >>>> return -1; >>>> - pkt_buf = odp_packet_buf_addr(pkt); >>>> + pkt_buf = odp_packet_addr(pkt); >>>> l2_hdr = ETHBUF_ALIGN(pkt_buf); >>>> /* Store eth buffer offset for pkt buffers from this pool */ >>>> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >>>> @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, >>>> break; >>>> } >>>> - pkt_buf = odp_packet_buf_addr(pkt); >>>> + pkt_buf = odp_packet_addr(pkt); >>>> l2_hdr = pkt_buf + pkt_sock->frame_offset; >>>> recv_bytes = recvfrom(sockfd, l2_hdr, >>>> @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, >>>> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >>>> break; >>>> - pkt_buf = odp_packet_buf_addr(pkt_table[i]); >>>> + pkt_buf = odp_packet_addr(pkt_table[i]); >>>> l2_hdr = pkt_buf + pkt_sock->frame_offset; >>>> iovecs[i].iov_base = l2_hdr; >>>> iovecs[i].iov_len = pkt_sock->max_frame_len; >>>> @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, >>>> struct ring *ring, >>>> if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) >>>> break; >>>> - l2_hdr = odp_packet_buf_addr(pkt_table[i]) >>>> + l2_hdr = odp_packet_addr(pkt_table[i]) >>>> + frame_offset; >>>> memcpy(l2_hdr, pkt_buf, pkt_len); >>>> @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const >>>> pkt_sock, const char *netdev, >>>> if (!odph_packet_is_valid(pkt)) >>>> return -1; >>>> - pkt_buf = odp_packet_buf_addr(pkt); >>>> + pkt_buf = odp_packet_addr(pkt); >>>> l2_hdr = ETHBUF_ALIGN(pkt_buf); >>>> /* Store eth buffer offset for pkt buffers from this pool */ >>>> pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; >>>> >>> >>> >> >> _______________________________________________ >> lng-odp mailing list >> lng-odp@lists.linaro.org >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > >
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index cd94d9a..bca957f 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -673,7 +673,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, pkt_ctx_t *ctx, bool *skip) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); int hdr_len; odph_ahhdr_t *ah = NULL; @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, * Finish auth */ if (ctx->ipsec.ah_offset) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ahhdr_t *ah; ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); @@ -833,7 +833,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt, pkt_ctx_t *ctx, bool *skip) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); uint16_t ip_data_len = ipv4_data_len(ip); uint8_t *ip_data = ipv4_data_p(ip); @@ -953,7 +953,7 @@ static pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, pkt_ctx_t *ctx) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); bool posted = 0; /* We were dispatched from atomic queue, assign sequence numbers */ diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 4a089d1..83f345a 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); * * @see odp_packet_l2(), odp_packet_start() */ -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); +uint8_t *odp_packet_addr(odp_packet_t pkt); /** * Get pointer to the start of the received frame @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); * * @return Pointer to the start of the received frame * - * @see odp_packet_l2(), odp_packet_buf_addr() + * @see odp_packet_l2(), odp_packet_addr() */ uint8_t *odp_packet_start(odp_packet_t pkt); @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); * Get pointer to the start of the L2 frame * * The L2 frame header address is not necessarily the same as the address of the - * packet buffer, see odp_packet_buf_addr() + * packet buffer, see odp_packet_addr() * * @param pkt Packet handle * * @return Pointer to L2 header or NULL if not found * - * @see odp_packet_buf_addr(), odp_packet_start() + * @see odp_packet_addr(), odp_packet_start() */ uint8_t *odp_packet_l2(odp_packet_t pkt); diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 12d0272..b37ad6b 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -78,7 +78,7 @@ static enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint8_t *icv = data; uint32_t len = params->auth_range.length; uint8_t hash[EVP_MAX_MD_SIZE]; @@ -106,7 +106,7 @@ static enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint8_t *icv = data; uint32_t len = params->auth_range.length; uint32_t bytes = session->auth.data.md5.bytes; @@ -144,7 +144,7 @@ static enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint32_t len = params->cipher_range.length; DES_cblock *iv; DES_cblock iv_temp; @@ -181,7 +181,7 @@ static enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint32_t len = params->cipher_range.length; DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 64fd0f8..6cd6183 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) return odp_packet_hdr(pkt)->frame_len; } -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) +uint8_t *odp_packet_addr(odp_packet_t pkt) { return odp_buffer_addr(odp_buffer_from_packet(pkt)); } uint8_t *odp_packet_start(odp_packet_t pkt) { - return odp_packet_buf_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; } @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l2_offset(odp_packet_t pkt) @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l3_offset(odp_packet_t pkt) @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l4_offset(odp_packet_t pkt) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index e173c31..e3c2753 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, if (!odph_packet_is_valid(pkt)) return -1; - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = ETHBUF_ALIGN(pkt_buf); /* Store eth buffer offset for pkt buffers from this pool */ pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, break; } - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = pkt_buf + pkt_sock->frame_offset; recv_bytes = recvfrom(sockfd, l2_hdr, @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) break; - pkt_buf = odp_packet_buf_addr(pkt_table[i]); + pkt_buf = odp_packet_addr(pkt_table[i]); l2_hdr = pkt_buf + pkt_sock->frame_offset; iovecs[i].iov_base = l2_hdr; iovecs[i].iov_len = pkt_sock->max_frame_len; @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, struct ring *ring, if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) break; - l2_hdr = odp_packet_buf_addr(pkt_table[i]) + l2_hdr = odp_packet_addr(pkt_table[i]) + frame_offset; memcpy(l2_hdr, pkt_buf, pkt_len); @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, if (!odph_packet_is_valid(pkt)) return -1; - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = ETHBUF_ALIGN(pkt_buf); /* Store eth buffer offset for pkt buffers from this pool */ pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf;
- Unify function naming between packets and segment: xxx_addr(), xxx_data() - Rename odp_packet_buf_addr() to odp_packet_addr() Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- example/ipsec/odp_ipsec.c | 8 ++++---- platform/linux-generic/include/api/odp_packet.h | 8 ++++---- platform/linux-generic/odp_crypto.c | 8 ++++---- platform/linux-generic/odp_packet.c | 10 +++++----- platform/linux-generic/odp_packet_socket.c | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-)