summaryrefslogtreecommitdiff
path: root/lib/librte_gso
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:10 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:46 +0200
commita7c528e5d71ff3f569898d268f9de129fdfc152b (patch)
treeead7c352fb1a817707a3ffbe471e6484850607d4 /lib/librte_gso
parentecaeed4f1d042b4317f756ad49ab4d918d0e4f76 (diff)
downloaddpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.zip
dpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.tar.gz
dpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.tar.xz
net: add rte prefix to IP structure
Add 'rte_' prefix to structures: - rename struct ipv4_hdr as struct rte_ipv4_hdr. - rename struct ipv6_hdr as struct rte_ipv6_hdr. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'lib/librte_gso')
-rw-r--r--lib/librte_gso/gso_common.h4
-rw-r--r--lib/librte_gso/gso_tcp4.c8
-rw-r--r--lib/librte_gso/gso_tunnel_tcp4.c10
-rw-r--r--lib/librte_gso/gso_udp4.c10
-rw-r--r--lib/librte_gso/rte_gso.h4
5 files changed, 18 insertions, 18 deletions
diff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h
index b6ff1b8..5f2adc8 100644
--- a/lib/librte_gso/gso_common.h
+++ b/lib/librte_gso/gso_common.h
@@ -98,9 +98,9 @@ update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
static inline void
update_ipv4_header(struct rte_mbuf *pkt, uint16_t l3_offset, uint16_t id)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+ ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
l3_offset);
ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - l3_offset);
ipv4_hdr->packet_id = rte_cpu_to_be_16(id);
diff --git a/lib/librte_gso/gso_tcp4.c b/lib/librte_gso/gso_tcp4.c
index fbd95f8..ad0cce6 100644
--- a/lib/librte_gso/gso_tcp4.c
+++ b/lib/librte_gso/gso_tcp4.c
@@ -9,14 +9,14 @@ static void
update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
struct rte_mbuf **segs, uint16_t nb_segs)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
struct tcp_hdr *tcp_hdr;
uint32_t sent_seq;
uint16_t id, tail_idx, i;
uint16_t l3_offset = pkt->l2_len;
uint16_t l4_offset = l3_offset + pkt->l3_len;
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) +
+ ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) +
l3_offset);
tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
@@ -40,13 +40,13 @@ gso_tcp4_segment(struct rte_mbuf *pkt,
struct rte_mbuf **pkts_out,
uint16_t nb_pkts_out)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
uint16_t pyld_unit_size, hdr_offset;
uint16_t frag_off;
int ret;
/* Don't process the fragmented packet */
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+ ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
pkt->l2_len);
frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
if (unlikely(IS_FRAGMENTED(frag_off))) {
diff --git a/lib/librte_gso/gso_tunnel_tcp4.c b/lib/librte_gso/gso_tunnel_tcp4.c
index d39b468..f5a19bc 100644
--- a/lib/librte_gso/gso_tunnel_tcp4.c
+++ b/lib/librte_gso/gso_tunnel_tcp4.c
@@ -9,7 +9,7 @@ static void
update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
struct rte_mbuf **segs, uint16_t nb_segs)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
struct tcp_hdr *tcp_hdr;
uint32_t sent_seq;
uint16_t outer_id, inner_id, tail_idx, i;
@@ -23,12 +23,12 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
tcp_offset = inner_ipv4_offset + pkt->l3_len;
/* Outer IPv4 header. */
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+ ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
outer_ipv4_offset);
outer_id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
/* Inner IPv4 header. */
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+ ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
inner_ipv4_offset);
inner_id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
@@ -60,12 +60,12 @@ gso_tunnel_tcp4_segment(struct rte_mbuf *pkt,
struct rte_mbuf **pkts_out,
uint16_t nb_pkts_out)
{
- struct ipv4_hdr *inner_ipv4_hdr;
+ struct rte_ipv4_hdr *inner_ipv4_hdr;
uint16_t pyld_unit_size, hdr_offset, frag_off;
int ret = 1;
hdr_offset = pkt->outer_l2_len + pkt->outer_l3_len + pkt->l2_len;
- inner_ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+ inner_ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
hdr_offset);
/*
* Don't process the packet whose MF bit or offset in the inner
diff --git a/lib/librte_gso/gso_udp4.c b/lib/librte_gso/gso_udp4.c
index 927dee1..21fea09 100644
--- a/lib/librte_gso/gso_udp4.c
+++ b/lib/librte_gso/gso_udp4.c
@@ -11,7 +11,7 @@ static inline void
update_ipv4_udp_headers(struct rte_mbuf *pkt, struct rte_mbuf **segs,
uint16_t nb_segs)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
uint16_t frag_offset = 0, is_mf;
uint16_t l2_hdrlen = pkt->l2_len, l3_hdrlen = pkt->l3_len;
uint16_t tail_idx = nb_segs - 1, length, i;
@@ -22,8 +22,8 @@ update_ipv4_udp_headers(struct rte_mbuf *pkt, struct rte_mbuf **segs,
* length.
*/
for (i = 0; i < nb_segs; i++) {
- ipv4_hdr = rte_pktmbuf_mtod_offset(segs[i], struct ipv4_hdr *,
- l2_hdrlen);
+ ipv4_hdr = rte_pktmbuf_mtod_offset(segs[i],
+ struct rte_ipv4_hdr *, l2_hdrlen);
length = segs[i]->pkt_len - l2_hdrlen;
ipv4_hdr->total_length = rte_cpu_to_be_16(length);
@@ -42,13 +42,13 @@ gso_udp4_segment(struct rte_mbuf *pkt,
struct rte_mbuf **pkts_out,
uint16_t nb_pkts_out)
{
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
uint16_t pyld_unit_size, hdr_offset;
uint16_t frag_off;
int ret;
/* Don't process the fragmented packet */
- ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
+ ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,
pkt->l2_len);
frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
if (unlikely(IS_FRAGMENTED(frag_off))) {
diff --git a/lib/librte_gso/rte_gso.h b/lib/librte_gso/rte_gso.h
index 433f2c8..ee87996 100644
--- a/lib/librte_gso/rte_gso.h
+++ b/lib/librte_gso/rte_gso.h
@@ -19,11 +19,11 @@ extern "C" {
/* Minimum GSO segment size for TCP based packets. */
#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
- sizeof(struct ipv4_hdr) + sizeof(struct tcp_hdr) + 1)
+ sizeof(struct rte_ipv4_hdr) + sizeof(struct tcp_hdr) + 1)
/* Minimum GSO segment size for UDP based packets. */
#define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
- sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr) + 1)
+ sizeof(struct rte_ipv4_hdr) + sizeof(struct udp_hdr) + 1)
/* GSO flags for rte_gso_ctx. */
#define RTE_GSO_FLAG_IPID_FIXED (1ULL << 0)