DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Unable to change source MAC address of packet
@ 2016-10-27 13:33 Padam Jeet Singh
  2016-10-27 14:07 ` Wiles, Keith
  0 siblings, 1 reply; 4+ messages in thread
From: Padam Jeet Singh @ 2016-10-27 13:33 UTC (permalink / raw)
  To: dev

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?

Thanks,
Padam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] Unable to change source MAC address of packet
  2016-10-27 13:33 [dpdk-dev] Unable to change source MAC address of packet Padam Jeet Singh
@ 2016-10-27 14:07 ` Wiles, Keith
  2016-10-27 14:45   ` Padam Jeet Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Wiles, Keith @ 2016-10-27 14:07 UTC (permalink / raw)
  To: Padam Jeet Singh; +Cc: dev


> 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. 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.

Is this what you are doing.

> 
> Thanks,
> Padam

Regards,
Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] Unable to change source MAC address of packet
  2016-10-27 14:07 ` Wiles, Keith
@ 2016-10-27 14:45   ` Padam Jeet Singh
  2016-10-28  5:57     ` Lu, Wenzhuo
  0 siblings, 1 reply; 4+ messages in thread
From: Padam Jeet Singh @ 2016-10-27 14:45 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev


> 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).

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] Unable to change source MAC address of packet
  2016-10-27 14:45   ` Padam Jeet Singh
@ 2016-10-28  5:57     ` Lu, Wenzhuo
  0 siblings, 0 replies; 4+ messages in thread
From: Lu, Wenzhuo @ 2016-10-28  5:57 UTC (permalink / raw)
  To: Padam Jeet Singh, Wiles, Keith; +Cc: dev

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
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-28  5:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-27 13:33 [dpdk-dev] Unable to change source MAC address of packet 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 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).