DPDK usage discussions
 help / color / mirror / Atom feed
From: satyavalli rama <satyavalli.rama@gmail.com>
To: dev-request@dpdk.org, users-request@dpdk.org, dev@dpdk.org,
	users@dpdk.org
Subject: Re: [dpdk-users] Unable to Forward the Packet after UDP Payload Modification
Date: Tue, 2 Jul 2019 13:18:46 +0530	[thread overview]
Message-ID: <CAECt3bMFhmWNup7-n-0nEFeBnbwgySzeqpBxH0GybYLuyqv8vQ@mail.gmail.com> (raw)
In-Reply-To: <CAECt3bO-PH3HGw6t8GWghri0hUpvZb-=eXEBZC7m6TY2W8r0+g@mail.gmail.com>

>
> I tried to create a completely new packet with my received mbuf, but still
>> I'm unable to forward packets with the appended payload, (Im able to
>> replace the RX payload but I'm unable to add or append additional payload
>> to the RX pkts)..
>>
>> If I'm changing IP Header Total Length or Checksum, the packets are not
>> getting transmitted..
>>
>> Kindly help me...
>>
>> Thanks
>> Satya
>>
>> On Mon, Jul 1, 2019, 11:08 satyavalli rama <satyavalli.rama@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Sat, Jun 29, 2019, 14:07 satyavalli rama <satyavalli.rama@gmail.com>
>>> wrote:
>>>
>>>> I've modified a data of 12 bytes to the udp  payload, and the same ive
>>>> triednto add to the the IP header total length and udp dgram length, but
>>>> still packets are dropping or Not getting forwaded...
>>>> Plz help me..
>>>>
>>>> On Fri, Jun 28, 2019, 21:08 Stephen Hemminger <
>>>> stephen@networkplumber.org> wrote:
>>>>
>>>>> 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.
>>>>>
>>>>

      parent reply	other threads:[~2019-07-02  7:49 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
     [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 [this message]

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=CAECt3bMFhmWNup7-n-0nEFeBnbwgySzeqpBxH0GybYLuyqv8vQ@mail.gmail.com \
    --to=satyavalli.rama@gmail.com \
    --cc=dev-request@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=users-request@dpdk.org \
    --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).