DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] KNI hw Address.
@ 2014-07-02 15:57 Alex Markuze
  2014-07-03  4:56 ` Zhang, Helin
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Markuze @ 2014-07-02 15:57 UTC (permalink / raw)
  To: dev

Hi, I'm playing with KNI on a VM (kvm), the Interface that is created has
no MAC address until the IP is set via ifconfig  - then a random mac is
created.
The VF has a mac address that is easily retrieved with rte_eth_macaddr_get.

What I did not find is a way to create the KNI with that specific mac
address enabled.
What are the ways to set the KNI mac address?

Thanks
Alex

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

* Re: [dpdk-dev] KNI hw Address.
  2014-07-02 15:57 [dpdk-dev] KNI hw Address Alex Markuze
@ 2014-07-03  4:56 ` Zhang, Helin
  2014-07-03  5:05   ` Padam J. Singh
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Helin @ 2014-07-03  4:56 UTC (permalink / raw)
  To: Alex Markuze, dev


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Alex Markuze
> Sent: Wednesday, July 2, 2014 11:57 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] KNI hw Address.
> 
> Hi, I'm playing with KNI on a VM (kvm), the Interface that is created has no
> MAC address until the IP is set via ifconfig  - then a random mac is created.
> The VF has a mac address that is easily retrieved with rte_eth_macaddr_get.
> 
> What I did not find is a way to create the KNI with that specific mac address
> enabled.
> What are the ways to set the KNI mac address?
> 
> Thanks
> Alex

Hi Alex

No way without modifying the code. Two ways can be taken into account as below.

1. Implement ndo_set_mac in KNI kernel module to set the MAC address.
2. Add mac address as one more parameters in user space KNI interface, to tell the kernel module the mac during kni device creation.

Regards,
Helin

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

* Re: [dpdk-dev] KNI hw Address.
  2014-07-03  4:56 ` Zhang, Helin
@ 2014-07-03  5:05   ` Padam J. Singh
  2014-07-03  6:22     ` Zhang, Helin
  0 siblings, 1 reply; 5+ messages in thread
From: Padam J. Singh @ 2014-07-03  5:05 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

Zhang, Alex,

Please see the patch I had submitted a few days back which allows setting the MAC address using 

ifconfig ... hw ether MAC-ADDRESS

An "ifconfig DEV up" , followed by this sets the MAC address.

Thanks,
Padam

On 03-Jul-2014, at 10:26 am, Zhang, Helin <helin.zhang@intel.com> wrote:

> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Alex Markuze
>> Sent: Wednesday, July 2, 2014 11:57 PM
>> To: dev@dpdk.org
>> Subject: [dpdk-dev] KNI hw Address.
>> 
>> Hi, I'm playing with KNI on a VM (kvm), the Interface that is created has no
>> MAC address until the IP is set via ifconfig  - then a random mac is created.
>> The VF has a mac address that is easily retrieved with rte_eth_macaddr_get.
>> 
>> What I did not find is a way to create the KNI with that specific mac address
>> enabled.
>> What are the ways to set the KNI mac address?
>> 
>> Thanks
>> Alex
> 
> Hi Alex
> 
> No way without modifying the code. Two ways can be taken into account as below.
> 
> 1. Implement ndo_set_mac in KNI kernel module to set the MAC address.
> 2. Add mac address as one more parameters in user space KNI interface, to tell the kernel module the mac during kni device creation.
> 
> Regards,
> Helin

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

* Re: [dpdk-dev] KNI hw Address.
  2014-07-03  5:05   ` Padam J. Singh
@ 2014-07-03  6:22     ` Zhang, Helin
  2014-07-03  7:06       ` Alex Markuze
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Helin @ 2014-07-03  6:22 UTC (permalink / raw)
  To: Padam J. Singh; +Cc: dev



> -----Original Message-----
> From: Padam J. Singh [mailto:padam.singh@inventum.net]
> Sent: Thursday, July 3, 2014 1:06 PM
> To: Zhang, Helin
> Cc: Alex Markuze; dev@dpdk.org
> Subject: Re: [dpdk-dev] KNI hw Address.
> 
> Zhang, Alex,
> 
> Please see the patch I had submitted a few days back which allows setting the
> MAC address using
> 
> ifconfig ... hw ether MAC-ADDRESS
> 
> An "ifconfig DEV up" , followed by this sets the MAC address.
> 
> Thanks,
> Padam
> 
> On 03-Jul-2014, at 10:26 am, Zhang, Helin <helin.zhang@intel.com> wrote:
> 
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Alex Markuze
> >> Sent: Wednesday, July 2, 2014 11:57 PM
> >> To: dev@dpdk.org
> >> Subject: [dpdk-dev] KNI hw Address.
> >>
> >> Hi, I'm playing with KNI on a VM (kvm), the Interface that is created
> >> has no MAC address until the IP is set via ifconfig  - then a random mac is
> created.
> >> The VF has a mac address that is easily retrieved with
> rte_eth_macaddr_get.
> >>
> >> What I did not find is a way to create the KNI with that specific mac
> >> address enabled.
> >> What are the ways to set the KNI mac address?
> >>
> >> Thanks
> >> Alex
> >
> > Hi Alex
> >
> > No way without modifying the code. Two ways can be taken into account as
> below.
> >
> > 1. Implement ndo_set_mac in KNI kernel module to set the MAC address.
> > 2. Add mac address as one more parameters in user space KNI interface, to
> tell the kernel module the mac during kni device creation.
> >
> > Regards,
> > Helin

Hi Padam

Great! I think you have implemented the first way I listed. It is good for VM environments. I remember that might be adopted by some projects based on DPDK. Thank you!
I will review your patch, and possibly add reviewed-by: to your patch.

Regards,
Helin

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

* Re: [dpdk-dev] KNI hw Address.
  2014-07-03  6:22     ` Zhang, Helin
@ 2014-07-03  7:06       ` Alex Markuze
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Markuze @ 2014-07-03  7:06 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

Thanks, guys.
I think I will modify the alloc KNI API, as in the way things are
implemented today the KNI interface can't transmit because of intc MAC
spoofing (w/o hacking the data path, similar to the l2fw example). The
other issue because the interface is created with initial mac address of
0's Im pretty sure DHCP is also out of a question.

Thanks, for the detailed info.


On Thu, Jul 3, 2014 at 9:22 AM, Zhang, Helin <helin.zhang@intel.com> wrote:

>
>
> > -----Original Message-----
> > From: Padam J. Singh [mailto:padam.singh@inventum.net]
> > Sent: Thursday, July 3, 2014 1:06 PM
> > To: Zhang, Helin
> > Cc: Alex Markuze; dev@dpdk.org
> > Subject: Re: [dpdk-dev] KNI hw Address.
> >
> > Zhang, Alex,
> >
> > Please see the patch I had submitted a few days back which allows
> setting the
> > MAC address using
> >
> > ifconfig ... hw ether MAC-ADDRESS
> >
> > An "ifconfig DEV up" , followed by this sets the MAC address.
> >
> > Thanks,
> > Padam
> >
> > On 03-Jul-2014, at 10:26 am, Zhang, Helin <helin.zhang@intel.com> wrote:
> >
> > >
> > >> -----Original Message-----
> > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Alex Markuze
> > >> Sent: Wednesday, July 2, 2014 11:57 PM
> > >> To: dev@dpdk.org
> > >> Subject: [dpdk-dev] KNI hw Address.
> > >>
> > >> Hi, I'm playing with KNI on a VM (kvm), the Interface that is created
> > >> has no MAC address until the IP is set via ifconfig  - then a random
> mac is
> > created.
> > >> The VF has a mac address that is easily retrieved with
> > rte_eth_macaddr_get.
> > >>
> > >> What I did not find is a way to create the KNI with that specific mac
> > >> address enabled.
> > >> What are the ways to set the KNI mac address?
> > >>
> > >> Thanks
> > >> Alex
> > >
> > > Hi Alex
> > >
> > > No way without modifying the code. Two ways can be taken into account
> as
> > below.
> > >
> > > 1. Implement ndo_set_mac in KNI kernel module to set the MAC address.
> > > 2. Add mac address as one more parameters in user space KNI interface,
> to
> > tell the kernel module the mac during kni device creation.
> > >
> > > Regards,
> > > Helin
>
> Hi Padam
>
> Great! I think you have implemented the first way I listed. It is good for
> VM environments. I remember that might be adopted by some projects based on
> DPDK. Thank you!
> I will review your patch, and possibly add reviewed-by: to your patch.
>
> Regards,
> Helin
>

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

end of thread, other threads:[~2014-07-03  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 15:57 [dpdk-dev] KNI hw Address Alex Markuze
2014-07-03  4:56 ` Zhang, Helin
2014-07-03  5:05   ` Padam J. Singh
2014-07-03  6:22     ` Zhang, Helin
2014-07-03  7:06       ` Alex Markuze

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