Re: Unable to change source MAC address of packet
From: Lu, Wenzhuo <hidden>
Date: 2016-10-28 05:57:50
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 packetquoted
On 27-Oct-2016, at 7:37 pm, Wiles, Keith [off-list ref] wrote:quoted
On Oct 27, 2016, at 6:33 AM, Padam Jeet Singh [off-list ref]wrote:quoted
quoted
Hi, I am crafting a packet in which the source MAC address as set in the Ethernetheader 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.quoted
quoted
Altering the destination MAC address works fine and shows up correctly inpacket capture.quoted
quoted
The underlying network interface is an i210 and some logs added to theeth_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.quoted
quoted
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.quoted
Maybe the hardware does it, but we need to know the NIC being used andthen 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.quoted
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?
quoted
quoted
Thanks, PadamRegards, Keith