0 Replies Latest reply: Aug 25, 2009 4:07 AM by 807567 RSS

    System crash attempting to use the packet filtering on Solaris 10, MU7

    807567
      I have been attempting to port my kernel module to run on Solaris 10, MU7 (from MU6). Some changes to the packet filtering hooks interface requires me to make code changes and linker option changes i.e -Nmisc/neti -Nmisc/hook

      I now have my module loading successfully and "hooking" packets. However, I am seeing instability and after processing in the order of 100-200 packets the system crashes. See stack dump beow for details.

      Also note that initially my callback hook function is very simple i.e returns 0.

      I require assistance on identifying the root cause. The key code fragements are as follows:

      int _init()
      {
      ...
      // allocated a control block using net_instance_alloc

      // populated the nin_name, nin_create, nin_destroy, and nin_shutdown fields with valid callback functions

      // registered the control block using net_instance_register

      ...
      }

      static int _attach(dip, cmd)
      dev_info_t *dip;
      ddi_attach_cmd_t cmd;
      {
      ...

      // initialised a hook control block using HOOK_INIT

      // performed a protocol lookup (using net_protocol_lookup) on the net_id provided by the nin_create function callback

      // registered the hook with the net_id protocol using net_hook_register

      ...
      }

      static int
      myipf_hook4_in (hook_event_token_t tok, hook_data_t info, void *arg) {

      // simple callback function for test purposes
      return 0;
      }


      System Stack trace:

      Boot device: /virtual-devices@100/channel-devices@200/disk@0:a File and args:
      SunOS Release 5.10 Version Generic_139555-08 64-bit
      Copyright 1983-2009 Sun Microsystems, Inc. All rights reserved.
      Use is subject to license terms.
      Hostname: bfs-t5440-03-ldm12
      NIS domain name is bfs.nis
      Reading ZFS config: done.

      bfs-t5440-03-ldm12 console login:
      panic[cpu9]/thread=2a100a67ca0: BAD TRAP: type=9 rp=2a100a67630 addr=7b6e8d48 mmu_fsr=0

      sched: trap type = 0x9
      addr=0x7b6e8d48
      pid=0, pc=0x7b6e8d48, sp=0x2a100a66ed1, tstate=0x1606, context=0x0
      g1-g7: 1910, 18b0, 2a100a678f0, 60010776b14, 1910, 0, 2a100a67ca0

      000002a100a67350 unix:die+9c (9, 2a100a67630, 7b6e8d48, 0, 2a100a67410, 182b400)
      %l0-3: 000000000100954c 0000000000000009 0000060020ac1620 00000000010523ac
      %l4-7: 00000000018a3c78 0000060020ac1848 000003000481dbe0 00000000010ac400
      000002a100a67430 unix:trap+6cc (2a100a67630, 10000, 0, 0, 30004028000, 2a100a67ca0)
      %l0-3: 0000000000000000 000000000185b480 0000000000000009 0000000000000000
      %l4-7: 0000000000000000 0000000000000000 0000000000001606 0000000000010200
      000002a100a67580 unix:ktl0+64 (300014c8e40, 2a100a67890, 600114fb428, 3, 1, 0)
      %l0-3: 0000030004028000 0000000000000048 0000000000001606 0000000001021604
      %l4-7: 00000000003c0000 0000000000000001 0000000000000000 000002a100a67630
      000002a100a676d0 hook:hook_run+7c (30001b039c0, 300014c8e40, 2a100a67890, 60012566ea8, 7b6e8d48, 1)
      %l0-3: 0000030001b039c8 00000600117df3c0 0000000001878888 0000000000000000
      %l4-7: 0000000000000000 000000000000003c 0000000000000000 0000000000000000
      000002a100a67780 ip:ip_input+3b4 (0, 600135ca040, 0, 6001359bc28, 0, 0)
      %l0-3: 0000000000000000 0000000000000000 0000000000000000 0000060011562000
      %l4-7: 00000000e0000000 0000000000000001 0000000000000000 0000000000000000
      000002a100a67910 dls:soft_ring_drain+78 (600135d1f00, 60011dfa940, 2, 2000000, 2, 0)
      %l0-3: 0000000000000000 0000000000000000 0000000000000004 0000000000000005
      %l4-7: 000006001359bc28 00000600135ca040 000000007be1c238 000000000000fffe
      000002a100a679c0 dls:soft_ring_worker+64 (600135d1f00, 0, 2, 600135d1f4c, 0, 2a100a67a8a)
      %l0-3: 000002a100a67a88 0000000000000000 000002a10001fca0 000002a10001fca0
      %l4-7: 0000000000000002 0000000000000000 0000000000000002 00000000018f1000

      syncing file systems... [1] 104 [1] 95 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 [1] 4 done (not all i/o completed)
      dumping to /dev/dsk/c0d0s1, offset 644284416, content: kernel
      100% done: 118970 pages dumped, compression ratio 10.00, dump succeeded
      rebooting...
      Resetting...

      -eugene

      Edited by: emonagh on Aug 25, 2009 1:54 AM

      Edited by: emonagh on Aug 25, 2009 1:56 AM