Quantcast

MAC and PHY loopback tests entrypoint for NIC controller

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MAC and PHY loopback tests entrypoint for NIC controller

Naresh

Hi All,

I am writing a 10Gb Ethernet driver. We have a requirement to support Mac and PHY loopback test for the network controller. In Linux there is a ethtool entrypoint which calls this feature.

I wondering what will be the equivalent entry point in FreeBSD. I tried looking in to other drivers, but not lucky enough to find one.

It is much appreciated if some one could point me to MAC and PHY loopback test entry point in FreeBSD.

Thanks & Regards,
Naresh.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC and PHY loopback tests entrypoint for NIC controller

Marius Strobl
On Sat, 6 Aug 2011 23:39:38 +0530
Naresh <[hidden email]> wrote:

>
> Hi All,
>
> I am writing a 10Gb Ethernet driver. We have a requirement to support
> Mac and PHY loopback test for the network controller. In Linux there
> is a ethtool entrypoint which calls this feature.
>
> I wondering what will be the equivalent entry point in FreeBSD. I
> tried looking in to other drivers, but not lucky enough to find one.
>
> It is much appreciated if some one could point me to MAC and PHY
> loopback test entry point in FreeBSD.
>

I don't know what API Linux provides but I think the question is how to
activate loopback mode from userland. Somewhere in your driver you'll
add the supported media similar to the following:
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
If there you also add media variants with option IFM_LOOP f.e. like so:
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_1000_T | IFM_LOOP, 0, NULL);
etc then from userland you can activate loopback mode via ifconfig(8)
like so:
ifconfig youdrv0 1000baseT mediaopt hw-loopback
and deactivate if via:
ifconfig youdrv0 1000baseT -mediaopt hw-loopback
Current versions of FreeBSD also take "loopback" or even just "loop" as
an alias for "hw-loopback".
The media change handler of your driver of course needs to check
whether the selected media has IFM_LOOP set and (de)activate loopback
mode in the hardware as appropriate.

Marius
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC and PHY loopback tests entrypoint for NIC controller

Ben Hutchings
On Wed, 2011-08-17 at 17:42 +0200, Marius Strobl wrote:
> On Sat, 6 Aug 2011 23:39:38 +0530
> Naresh <[hidden email]> wrote:
>
> >
> > Hi All,
> >
> > I am writing a 10Gb Ethernet driver. We have a requirement to support
> > Mac and PHY loopback test for the network controller. In Linux there
> > is a ethtool entrypoint which calls this feature.

Me too!

> > I wondering what will be the equivalent entry point in FreeBSD. I
> > tried looking in to other drivers, but not lucky enough to find one.
> >
> > It is much appreciated if some one could point me to MAC and PHY
> > loopback test entry point in FreeBSD.
> >
>
> I don't know what API Linux provides but I think the question is how to
> activate loopback mode from userland.
[...]

This is a very different thing.

On Linux, ethtool invokes a driver function that runs a set of driver-
specific self-tests (synchronously).  There is a flag for whether the
driver should run offline tests, in which case it will temporarily
disconnect from the network stack and then (normally) select loopback
mode, generate and validate packets.

What you're talking about is configuring loopback mode but leaving the
network stack connected.  This can be useful for directed testing by
developers and QA, but it is not at all useful for an automated
self-test.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC and PHY loopback tests entrypoint for NIC controller

Marius Strobl
On Wed, Aug 17, 2011 at 05:13:39PM +0100, Ben Hutchings wrote:

> On Wed, 2011-08-17 at 17:42 +0200, Marius Strobl wrote:
> > On Sat, 6 Aug 2011 23:39:38 +0530
> > Naresh <[hidden email]> wrote:
> >
> > >
> > > Hi All,
> > >
> > > I am writing a 10Gb Ethernet driver. We have a requirement to support
> > > Mac and PHY loopback test for the network controller. In Linux there
> > > is a ethtool entrypoint which calls this feature.
>
> Me too!
>
> > > I wondering what will be the equivalent entry point in FreeBSD. I
> > > tried looking in to other drivers, but not lucky enough to find one.
> > >
> > > It is much appreciated if some one could point me to MAC and PHY
> > > loopback test entry point in FreeBSD.
> > >
> >
> > I don't know what API Linux provides but I think the question is how to
> > activate loopback mode from userland.
> [...]
>
> This is a very different thing.
>
> On Linux, ethtool invokes a driver function that runs a set of driver-
> specific self-tests (synchronously).  There is a flag for whether the
> driver should run offline tests, in which case it will temporarily
> disconnect from the network stack and then (normally) select loopback
> mode, generate and validate packets.
>

Ah, okay, unfortunately FreeBSD provides no standard interface for that.

Marius

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MAC and PHY loopback tests entrypoint for NIC controller

Naresh
Thanks a lot Marius and Ben.

Sent from my iPhone

On 17-Aug-2011, at 10:19 PM, Marius Strobl <[hidden email]> wrote:

> On Wed, Aug 17, 2011 at 05:13:39PM +0100, Ben Hutchings wrote:
>> On Wed, 2011-08-17 at 17:42 +0200, Marius Strobl wrote:
>>> On Sat, 6 Aug 2011 23:39:38 +0530
>>> Naresh <[hidden email]> wrote:
>>>
>>>>
>>>> Hi All,
>>>>
>>>> I am writing a 10Gb Ethernet driver. We have a requirement to support
>>>> Mac and PHY loopback test for the network controller. In Linux there
>>>> is a ethtool entrypoint which calls this feature.
>>
>> Me too!
>>
>>>> I wondering what will be the equivalent entry point in FreeBSD. I
>>>> tried looking in to other drivers, but not lucky enough to find one.
>>>>
>>>> It is much appreciated if some one could point me to MAC and PHY
>>>> loopback test entry point in FreeBSD.
>>>>
>>>
>>> I don't know what API Linux provides but I think the question is how to
>>> activate loopback mode from userland.
>> [...]
>>
>> This is a very different thing.
>>
>> On Linux, ethtool invokes a driver function that runs a set of driver-
>> specific self-tests (synchronously).  There is a flag for whether the
>> driver should run offline tests, in which case it will temporarily
>> disconnect from the network stack and then (normally) select loopback
>> mode, generate and validate packets.
>>
>
> Ah, okay, unfortunately FreeBSD provides no standard interface for that.
>
> Marius
>
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
To unsubscribe, send any mail to "[hidden email]"
Loading...