DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: satyavalli rama <satyavalli.rama@gmail.com>
Cc: dev@dpdk.org, users@dpdk.org
Subject: Re: [dpdk-users] Unable to Forward the Packet after UDP Payload Modification
Date: Fri, 28 Jun 2019 08:38:20 -0700	[thread overview]
Message-ID: <20190628083820.66680042@hermes.lan> (raw)
In-Reply-To: <CAECt3bNHqUkk2U3oQby=-PFpbkh40APptuRZasfN8nN9Qj4Dqw@mail.gmail.com>

On Thu, 27 Jun 2019 23:00:35 +0530
satyavalli rama <satyavalli.rama@gmail.com> wrote:

> Hi
> 
> 
> With Scapy we are sending UDP Packets to ‘P0’ of DPDK - VM -1 as below
> 
> >>>sendp(Ether(src="52:00:00:00:00:4a",dst="50:00:00:00:00:8F")/IP(dst="20.20.20.20",proto=17)/UDP(sport=4009,dport=4019)/Raw(load=('Helllo Basha')), iface="ens9", loop=1, count=10, inter=1.0002)  
> 
> 
> I'm modifying MAC address in l2fwd_simple_forward (52:00:00:00:AB:CD)
> and calling the below API after mac updation, in the ‘l2fwd’ DPDK
> Sample application.
> 
> But I'm unable to receive the ‘Appended Data’ on the Destination Port.
> P0 itself is dropping our packets...
> 
> Without Appending the Payload/Data we are able to see our packets on
> the Destination Port.
> 
> Please let me know whether this issue is with respect to appending or
> buffering or checksum related...
> 
> static void
> 
> pkt_modify(struct rte_mbuf *m, unsigned dest_portid)
> 
> {
> 
> struct ether_hdr *eth;
> 
> struct ipv4_hdr *ipv4;
> 
> struct udp_hdr *udp;
> 
> char *udpData;
> 
> int len = 0;
> 
> const char *mess = "Eureka";
> 
> char *newData = NULL;
> 
> eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
> 
> ipv4 = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,sizeof(struct ether_hdr));
> 
> udp = rte_pktmbuf_mtod_offset(m, struct udp_hdr *, sizeof(struct
> ether_hdr)+sizeof(struct ipv4_hdr));
> 
> len = m->data_len;
> 
> udpData = rte_pktmbuf_mtod_offset(m, char *, len);
> 
> newData = rte_pktmbuf_append(m, 6);
> 
> if (newData != NULL)
> 
> rte_memcpy(newData, mess, 6);
> 
> 
> len = m->data_len;
> 
> udpData = rte_pktmbuf_mtod_offset(m, char *, sizeof(struct
> ether_hdr)+sizeof(struct ipv4_hdr)+
> 
> sizeof(struct udp_hdr));
> 
> return ;
> 
> }
> 
> 
> Please help me on figuring out this....
> 
> Thanks,
> 
> Satya Valli.

You aren't changing the ip header length or checksum.
So your message at the end just looks like additional L2 trailer.

  reply	other threads:[~2019-06-28 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAECt3bNi5=1f7NkQdswFJuGpJaO8pyAPUZJDxQnU8--0ZtYQEQ@mail.gmail.com>
2019-06-27 17:30 ` satyavalli rama
2019-06-28 15:38   ` Stephen Hemminger [this message]
     [not found]     ` <CAECt3bN8-5iWrHkKq7HehA4rutQNtNYrMBeZ6NH9Prnwx9kMKg@mail.gmail.com>
     [not found]       ` <CAECt3bMgGdj9gFUjdEishJZrmsUJZNMY6sZqWmQ0xwCwuFMTtw@mail.gmail.com>
     [not found]         ` <CAECt3bNPGePU-p0=Wf5gZk7DTibhccx8bryNLVn3o2XqoZjSrw@mail.gmail.com>
     [not found]           ` <CAECt3bO-PH3HGw6t8GWghri0hUpvZb-=eXEBZC7m6TY2W8r0+g@mail.gmail.com>
2019-07-02  7:48             ` satyavalli rama

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190628083820.66680042@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=satyavalli.rama@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).