#1277 Fix for incorrect reporting of ifSpeed value in Solaris zones

backport-needed
accepted
None
5
2014-05-22
2014-04-02
lijo
No

In Solaris zones, the value of ifSpeed for network interfaces is displayed as 0.
This happens because the correct parameters are not being used in the kstat function call used to retrieve the ifSpeed value. This patch fixes the issue by invoking the kstat functions with the correct parameters.

1 Attachments

Related

Patches: #1277

Discussion

  • Niels Baggesen

    Niels Baggesen - 2014-04-22

    Not having any zones, I am a bit confused by this patch.

    What Solaris version is this?

    Could you give the output from "kstat -s 'if[Ss]peed'"?

     
  • Niels Baggesen

    Niels Baggesen - 2014-04-22
    • assigned_to: Niels Baggesen
     
    • lijo

      lijo - 2014-04-23

      Hi,

      Here's the requested kstat output.

      root@testzone:~# kstat -s "ifspeed"
      module: e1000g instance: 0
      name: phys class: net
      ifspeed 1000000000

      module: e1000g instance: 1
      name: phys class: net
      ifspeed 0

      module: e1000g instance: 2
      name: phys class: net
      ifspeed 0

      module: e1000g instance: 3
      name: phys class: net
      ifspeed 0

      module: link instance: 0
      name: net0 class: net
      ifspeed 1000000000

      module: vnic instance: 1005
      name: phys class: net
      ifspeed 1000000000

      The right kstat value is the 4th one, i.e link:0:net0:ifspeed.

      The issue here looks like the kstat_lookup function being called

      kstat_lookup(ksc, NULL, -1, "net0") eq to ::net0: has more than 1 match.
      unix:0:net0: class = flow and
      link:0:net0: class = net

      The first one is being matched and this does not have a value for ifspeed
      as

      the kstat output shows

      root@testzone:~# kstat -p unix::net0:
      unix:0:net0:class flow
      unix:0:net0:crtime 251.572283068
      unix:0:net0:idropbytes 0
      unix:0:net0:idrops 0
      unix:0:net0:ierrors 0
      unix:0:net0:ipackets 0
      unix:0:net0:obytes 0
      unix:0:net0:odropbytes 0
      unix:0:net0:odrops 0
      unix:0:net0:oerrors 0
      unix:0:net0:opackets 0
      unix:0:net0:rbytes 0
      unix:0:net0:snaptime 1374900.4878022

      Hence the issue can be fixed by invoking the kstat lookup functions with
      the right parameters.

      Thanks,

      Lijo

      On Wed, Apr 23, 2014 at 3:11 AM, Niels Baggesen nba@users.sf.net wrote:

      • assigned_to: Niels Baggesen
      • Comment:

      Not having any zones, I am a bit confused by this patch.

      What Solaris version is this?

      Could you give the output from "kstat -s 'if[Ss]peed'"?

      Status: open
      Group: backport-needed
      Created: Wed Apr 02, 2014 07:42 PM UTC by lijo
      Last Updated: Wed Apr 02, 2014 07:42 PM UTC
      Owner: Niels Baggesen

      In Solaris zones, the value of ifSpeed for network interfaces is displayed
      as 0.
      This happens because the correct parameters are not being used in the
      kstat function call used to retrieve the ifSpeed value. This patch fixes
      the issue by invoking the kstat functions with the correct parameters.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/net-snmp/patches/1277/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Patches: #1277

  • Niels Baggesen

    Niels Baggesen - 2014-04-26

    OK, this makes sense. I just wonder then why you added a test for ifSpeed in addition to ifspeed?

     
    • lijo

      lijo - 2014-05-22

      I just added that following the existing code where there was a test for "ifSpeed" if the test for "ifspeed" fails as given below.

      if ((getKstatInt(NULL, name, "ifspeed", &ifp->ifSpeed) == 0)) {

      } else if (getKstatInt(NULL, name, "ifSpeed", &ifp->ifSpeed) == 0) {

      }
      I guess it won't be required now.

       
  • Niels Baggesen

    Niels Baggesen - 2014-05-22

    Thanks. I have applied it for all active branches.

     
  • Niels Baggesen

    Niels Baggesen - 2014-05-22
    • status: open --> accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks