DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: Padam Jeet Singh <padam.singh@inventum.net>,
	"Wiles, Keith" <keith.wiles@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Unable to change source MAC address of packet
Date: Fri, 28 Oct 2016 05:57:45 +0000	[thread overview]
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093933F65A@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <24C3E15F-108D-4812-985B-61B10FDDF69E@inventum.net>

Hi Padam,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Padam Jeet Singh
> Sent: Thursday, October 27, 2016 10:45 PM
> To: Wiles, Keith
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] Unable to change source MAC address of packet
> 
> 
> > On 27-Oct-2016, at 7:37 pm, Wiles, Keith <keith.wiles@intel.com> wrote:
> >
> >
> >> On Oct 27, 2016, at 6:33 AM, Padam Jeet Singh <padam.singh@inventum.net>
> wrote:
> >>
> >> Hi,
> >>
> >> I am crafting a packet in which the source MAC address as set in the Ethernet
> header is different than the transmit port’s default MAC address. A packet
> capture of the packets coming out of this port however comes with source MAC
> address of the port’s default MAC address.
> >>
> >> Altering the destination MAC address works fine and shows up correctly in
> packet capture.
> >>
> >> The underlying network interface is an i210 and some logs added to the
> eth_igb_xmit_pkts function show that the packets I have crafted indeed are
> reaching the driver with the source MAC address set in the packet code of the
> application.
> >>
> >> How can I disable this automatic source MAC address setting?
> >
> > The packets sent with rte_eth_tx_burst() are not forced to a give MAC address.
> If you are using something on top of DPDK like Pktgen or OVS or something,
> then it may try to force a source MAC address.
> 
> No… not using pktgen or OVS. Plain simple code to take a packets from a KNI,
> change source mac address on all received packets,  and then tx_burst them to a
> port.
> 
> > Maybe the hardware does it, but we need to know the NIC being used and
> then someone maybe able to answer. I do not know of any Intel NICs do that.
> 
> Intel i210 NIC (gigabit Ethernet) is being used. I have gone through the i210
> documentation and can’t see anything specific to setting of MAC address in
> hardware for TX side. For RX side there are validations like MAC filtering, but
> nothing over TX.
> 
> >
> > Is this what you are doing.
> 
> I agree that rte_eth_tx_burst does not overwrite the source MAC as I was able
> to trace all the way to the IGB driver that source mac makes it intact. There is no
> offload flags enabled in the mbuf. Yet the packets to the other side comes out
> as with source mac address of the port.
> 
> Is there any standard DPDK app which crafts packets with different source MAC
> than the port’s physical mac? (I checked the l2fwd example loads the port mac
> before transmitting and then uses the same in TX function).
I don’t have a i210 on hand, so I checked the datasheet of i210. I don't find any description about HW will change the MAC address in the frame. I believe HW should send the frame provided by SW except doing some offload like checksum...
May I suggest to use testpmd forwarding a packet which has a different src MAC than the port's?

> 
> >
> >>
> >> Thanks,
> >> Padam
> >
> > Regards,
> > Keith
> >

      reply	other threads:[~2016-10-28  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 13:33 Padam Jeet Singh
2016-10-27 14:07 ` Wiles, Keith
2016-10-27 14:45   ` Padam Jeet Singh
2016-10-28  5:57     ` Lu, Wenzhuo [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=6A0DE07E22DDAD4C9103DF62FEBC09093933F65A@shsmsx102.ccr.corp.intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=padam.singh@inventum.net \
    /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).