Is there any limit on number of modules one io-net instance?

Is there any limit on number of modules one io-net instance?

In My system I have three ethrenet ports, I have two different ethrenet drivers for these three port as two of them are FE and one is GE so I have executed following commands to get many modules loaded on the same io-net instance during startup of my system.

[b]io-net -p tcpip forward
waitfor /dev/io-net
mount -Tio-net -o dramcpp,mac0=000000000815,mac1=907020018900 devn-ixp2351.so
waitfor /dev/io-net/en0
ifconfig en0 192.168.253.254/24 up
echo “QNX IP Stack Started on interface en0”
waitfor /dev/io-net/en1
ifconfig en1 10.118.209.244/24 up
echo “QNX IP Stack Started on interface en1”

mount -Tio-net -o mac=0040431503c8 devn-ethIf.so
waitfor /dev/io-net/en2
echo “QNX IP Stack MOUNTED on GE0 Port”

ifconfig en2 192.168.255.129/25 up[/b]

Now I am trying to load my new filter module then I get error as shown below:

# mount -vvvv -Tio-net nfm_filter.so
Parsed: mount from [nfm_filter.so] mount on [NULL] type [io-net]
exec: mount_io-net -o implied -o nostat nfm_filter.so /
Using internal mount (mount_io-net not found)
Type [io-net] Flags 0x80080000
Device [nfm_filter.so] Directory [/]
Options []
mount: Can’t mount / (type io-net)
mount: Possible reason: No such device or address

I do not want to have new instance of io-net for this module as I need packets coming from existing drivers loaded in the same io-net.

Kindly help me…

Regards
Ashish

Don’t think io-net have a limit on module number. You should be able to check by just load you module
before load driver. The error is just saying io-net can’t load your module.

Things to check:

  1. is the module in LD_LIBRARY_PATH (or getconf CS_LIBPATH) ?
  2. does io-net said anything in sloginfo?
  3. does your module properly wrote? does it’s entry function get called?

Hi,

Thanks for your reply.
You have suggested following:

  1. is the module in LD_LIBRARY_PATH (or getconf CS_LIBPATH) ?
    Ashish:-> This I have checked and It is perfectly there.
  2. does io-net said anything in sloginfo?
    Ashish:-> When i run sloginfo It gives following output:

May 21 10:53:16 2 10 0 ixEthMiiLinkStatus failed on PHY0.
Can’t determine the status of the link.
Using default values.

  1. does your module properly wrote? does it’s entry function get called?
    Ashish:-> How can I check whether entry function get called or not? Please see the code. I have written the code to best of my understanding.

#include <stdio.h>
#include <errno.h>
#include <sys/io-net.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *n, char *options);
int filter_destroy(void *dll_hdl);
int filter_rx_up(npkt_t *npkt, void *func_hdl, int off, int len_sub, uint16_t cell, uint16_t endpoint, uint16_t iface);
int filter_rx_down(npkt_t *npkt, void *rx_down_hdl);
int filter_tx_done(npkt_t *npkt, void *done_hdl, void *func_hdl);
int filter_shutdown1(int registrant_hdl, void *func_hdl);
int filter_shutdown2(int registrant_hdl, void *func_hdl);

int counter_UP = 0;
int counter_DOWN = 0;

io_net_dll_entry_t io_net_dll_entry = {
2,
(void *)filter_init,
(void *)filter_destroy
};

io_net_registrant_funcs_t filter_funcs = {
8,
&filter_rx_up,
&filter_rx_down,
&filter_tx_done,
&filter_shutdown1,
&filter_shutdown2,
NULL,
NULL,
NULL,
NULL
};

io_net_registrant_t filter_reg = {
_REG_FILTER_ABOVE,
“nfm_filter”,
“en”,
“en”,
NULL,
&filter_funcs,
0
};

void * filter_dll_hdl;
dispatch_t * filter_dpp;
io_net_self_t * filter_ion;
int filter_reg_hdl;

///

int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char *options)
{
filter_dll_hdl = dll_hdl;
filter_ion = ion;
filter_dpp = dpp;
fprintf(stderr, “\nInside filter_init\n”);
if(filter_ion->reg(filter_dll_hdl, &filter_reg, &filter_reg_hdl, NULL, NULL) == -1)
{
fprintf(stderr, "\nreg-ERROR ");
return (-1);
}

fprintf(stderr, "\ninit-OK reg_hdl=%d ",filter_reg_hdl);
return EOK;
}

///

int filter_destroy(void *dll_hdl)
{
fprintf(stderr, "\ndestroy ");
return EOK;
}

///

int filter_rx_up(npkt_t *npkt, void *func_hdl, int off, int len_sub, uint16_t cell, uint16_t endpoint, uint16_t iface)
{
counter_UP += 1;
fprintf(stderr, "\npkt_UP reg_hdl=%d (%d), framelen = %d ",filter_reg_hdl,counter_UP, npkt->framelen);

if( filter_ion->tx_up(filter_reg_hdl, npkt, off, len_sub, cell, endpoint, iface) <= 0 )
filter_ion->tx_done(filter_reg_hdl, npkt);

return 0;
}

///

int filter_rx_down(npkt_t *npkt, void *rx_down_hdl)
{
counter_DOWN += 1;
fprintf(stderr, "\npkt_DOWN reg_hdl=%d (%d) ",filter_reg_hdl,counter_DOWN);

return filter_ion->tx_down(filter_reg_hdl, npkt);
}

///

int filter_tx_done(npkt_t *npkt, void *done_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_tx_done”);
return 0;
}

///

int filter_shutdown1(int registrant_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_shutdown1”);
return EOK;
}

///

int filter_shutdown2(int registrant_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_shutdown2”);
return 0;
}