Skip to contentSkip to conversation

examples: fix for incomplete nb_segs type change

PATCH In review Ilya Matveychikov 3 participants 4 messages Nov 9, 2017 – Nov 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples: fix for incomplete nb_segs type change

Fixes 97cb466d ("mbuf: use 2 bytes for port and nb segments")
---
 doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +-
 examples/ipv4_multicast/main.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
index 49712a0..9f50e32 100644
@@ -364,7 +364,7 @@ It is the mcast_out_pkt() function that performs the packet duplication (either
         /* update header's fields */
 
         hdr->pkt.pkt_len = (uint16_t)(hdr->pkt.data_len + pkt->pkt.pkt_len);
-        hdr->pkt.nb_segs = (uint8_t)(pkt->pkt.nb_segs + 1);
+        hdr->pkt.nb_segs = (uint16_t)(pkt->pkt.nb_segs + 1);
 
         /* copy metadata from source packet */
 
examples/ipv4_multicast/main.c +1 -1
index 9a13d35..1a82bc0 100644
@@ -291,7 +291,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
 
 	/* update header's fields */
 	hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len);
-	hdr->nb_segs = (uint8_t)(pkt->nb_segs + 1);
+	hdr->nb_segs = (uint16_t)(pkt->nb_segs + 1);
 
 	/* copy metadata from source packet*/
 	hdr->port = pkt->port;

--
2.7.4

#1 lore raw
Quoted 1 line · Ilya Matveychikov
Fixes 97cb466d ("mbuf: use 2 bytes for port and nb segments")

Fixline format we are using is slightly different, there is an alias to use:
http://dpdk.org/doc/guides/contributing/patches.html

git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'"

Quoted 11 lines
---
 doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +-
 examples/ipv4_multicast/main.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/sample_app_ug/ipv4_multicast.rst +0 -0
index 49712a0..9f50e32 100644

doc/guides/sample_app_ug/ipv4_multicast.rst It is the mcast_out_pkt() function that performs the packet duplication (either · line 367

Quoted 5 lines
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
@@ -364,7 +364,7 @@ It is the mcast_out_pkt() function that performs the packet duplication (either
         /* update header's fields */
 
         hdr->pkt.pkt_len = (uint16_t)(hdr->pkt.data_len + pkt->pkt.pkt_len);
-        hdr->pkt.nb_segs = (uint8_t)(pkt->pkt.nb_segs + 1);
+        hdr->pkt.nb_segs = (uint16_t)(pkt->pkt.nb_segs + 1);

This is the side effect of putting code into document, code changes...

examples/ipv4_multicast/main.c mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) · line 294

Quoted 13 lines
doc/guides/sample_app_ug/ipv4_multicast.rst +0 -0
         /* copy metadata from source packet */
 
examples/ipv4_multicast/main.c +1 -1
index 9a13d35..1a82bc0 100644
@@ -291,7 +291,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
 
 	/* update header's fields */
 	hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len);
-	hdr->nb_segs = (uint8_t)(pkt->nb_segs + 1);
+	hdr->nb_segs = (uint16_t)(pkt->nb_segs + 1);

Do we need the cast at all?

Quoted 6 lines
examples/ipv4_multicast/main.c +0 -1
 	/* copy metadata from source packet*/
 	hdr->port = pkt->port;
--

2.7.4

#2 lore raw

PATCH 1/1 examples: fix for incomplete nb_segs type change

In reply to Ilya Matveychikov
Fixes 97cb466d65c9 ("mbuf: use 2 bytes for port and nb segments")
---
 doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +-
 examples/ipv4_multicast/main.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
index fd1af0066..7a8e7ebce 100644
@@ -339,7 +339,7 @@ It is the mcast_out_pkt() function that performs the packet duplication (either
         /* update header's fields */
 
         hdr->pkt.pkt_len = (uint16_t)(hdr->pkt.data_len + pkt->pkt.pkt_len);
-        hdr->pkt.nb_segs = (uint8_t)(pkt->pkt.nb_segs + 1);
+        hdr->pkt.nb_segs = pkt->pkt.nb_segs + 1;
 
         /* copy metadata from source packet */
 
examples/ipv4_multicast/main.c +1 -1
index 83ac0d808..1c5851654 100644
@@ -289,7 +289,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
 
 	/* update header's fields */
 	hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len);
-	hdr->nb_segs = (uint8_t)(pkt->nb_segs + 1);
+	hdr->nb_segs = pkt->nb_segs + 1;
 
 	/* copy metadata from source packet*/
 	hdr->port = pkt->port;
Signature · 1 line
2.14.2