free mblks - VxWorks

This is a discussion on free mblks - VxWorks ; Hi, Does anyone know of a way for me to check the number of MBLKS that i have available during run time. Here is my situation I have my NUM_NET_MBLKS set to 800 but my network keeps growing so I ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: free mblks

  1. free mblks

    Hi,
    Does anyone know of a way for me to check the number of MBLKS that i
    have available during run time. Here is my situation I have my
    NUM_NET_MBLKS set to 800 but my network keeps growing so I dont want
    to have to keep adjusting this value everytime i think I am running
    out of MBLKS, so what I want to do is find a way to check when I am
    almost out of mblks and if i am, i will send a pause frame to the
    application that is sending me data so i can do my processing, free up
    some mblks, then let them start sending again.

    here is what I want effectively:

    1. check if i have less than 20% mblks left
    2. if true send pause frame (stop sending me data)
    3. do my processing......free up some mblks
    4. check if i have more than 25% mblks
    5. if true send pause frame with zero (u can start sendin me data
    again)

    i know how to do all the above except for checking number of mblks i
    have left in the pool.

    thanks,
    chris

  2. Re: free mblks

    On Mar 27, 5:13*am, mactonio wrote:
    > Hi,
    > Does anyone know of a way for me to check the number of MBLKS that i
    > have available during run time. Here is my situation I have my
    > NUM_NET_MBLKS set to 800 but my network keeps growing so I dont want
    > to have to keep adjusting this value everytime i think I am running
    > out of MBLKS, so what I want to do is find a way to check when I am
    > almost out of mblks and if i am, i will send a pause frame to the
    > application that is sending me data so i can do my processing, free up
    > some mblks, then let them start sending again.
    >
    > here is what I want effectively:
    >
    > 1. check if i have less than 20% mblks left
    > 2. if true send pause frame (stop sending me data)
    > 3. do my processing......free up some mblks
    > 4. check if i have more than 25% mblks
    > 5. if true send pause frame with zero (u can start sendin me data
    > again)
    >
    > i know how to do all the above except for checking number of mblks i
    > have left in the pool.
    >
    > thanks,
    > chris


    Hi, Chris.

    I guess you are interesting of amount of free clusters and not the
    M_BLKs (mbufs), since a single mbuf can be associated with more than
    one memory cluster.
    Anyway, you should be able to use the same mechanism of discovery of
    netPoolShow.

    Hope it helps.
    maximb

  3. Re: free mblks

    On Mar 27, 3:54*am, "comp.soft-sys.ace"
    wrote:
    > On Mar 27, 5:13*am, mactonio wrote:
    >
    >
    >
    >
    >
    > > Hi,
    > > Does anyone know of a way for me to check the number of MBLKS that i
    > > have available during run time. Here is my situation I have my
    > > NUM_NET_MBLKS set to 800 but my network keeps growing so I dont want
    > > to have to keep adjusting this value everytime i think I am running
    > > out of MBLKS, so what I want to do is find a way to check when I am
    > > almost out of mblks and if i am, i will send a pause frame to the
    > > application that is sending me data so i can do my processing, free up
    > > some mblks, then let them start sending again.

    >
    > > here is what I want effectively:

    >
    > > 1. check if i have less than 20% mblks left
    > > 2. if true send pause frame (stop sending me data)
    > > 3. do my processing......free up some mblks
    > > 4. check if i have more than 25% mblks
    > > 5. if true send pause frame with zero (u can start sendin me data
    > > again)

    >
    > > i know how to do all the above except for checking number of mblks i
    > > have left in the pool.

    >
    > > thanks,
    > > chris

    >
    > Hi, Chris.
    >
    > I guess you are interesting of amount of free clusters and not the
    > M_BLKs (mbufs), since a single mbuf can be associated with more than
    > one memory cluster.
    > Anyway, you should be able to use the same mechanism of discovery of
    > netPoolShow.
    >
    > Hope it helps.
    > maximb- Hide quoted text -
    >
    > - Show quoted text -


    hey,
    thanks for the feedback, but that is what i was doing before, I was
    checking the free clusters but for some reason I am running out of
    mblks before I run out of clusters, is that possible?
    I was checking for 60% used clusters to send my pause frame but it
    never got there however nettupgeget() call fails saying no mblk, so
    that why I was wondering how to also check the mblks.

    thanks again for responding
    Chris

  4. Re: free mblks

    On Mar 27, 5:58*pm, mactonio wrote:
    > On Mar 27, 3:54*am, "comp.soft-sys.ace"
    > wrote:
    >
    >
    >
    >
    >
    > > On Mar 27, 5:13*am, mactonio wrote:

    >
    > > > Hi,
    > > > Does anyone know of a way for me to check the number of MBLKS that i
    > > > have available during run time. Here is my situation I have my
    > > > NUM_NET_MBLKS set to 800 but my network keeps growing so I dont want
    > > > to have to keep adjusting this value everytime i think I am running
    > > > out of MBLKS, so what I want to do is find a way to check when I am
    > > > almost out of mblks and if i am, i will send a pause frame to the
    > > > application that is sending me data so i can do my processing, free up
    > > > some mblks, then let them start sending again.

    >
    > > > here is what I want effectively:

    >
    > > > 1. check if i have less than 20% mblks left
    > > > 2. if true send pause frame (stop sending me data)
    > > > 3. do my processing......free up some mblks
    > > > 4. check if i have more than 25% mblks
    > > > 5. if true send pause frame with zero (u can start sendin me data
    > > > again)

    >
    > > > i know how to do all the above except for checking number of mblks i
    > > > have left in the pool.

    >
    > > > thanks,
    > > > chris

    >
    > > Hi, Chris.

    >
    > > I guess you are interesting of amount of free clusters and not the
    > > M_BLKs (mbufs), since a single mbuf can be associated with more than
    > > one memory cluster.
    > > Anyway, you should be able to use the same mechanism of discovery of
    > > netPoolShow.

    >
    > > Hope it helps.
    > > maximb- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > hey,
    > thanks for the feedback, but that is what i was doing before, I was
    > checking the free clusters but for some reason I am running out of
    > mblks before I run out of clusters, is that possible?
    > I was checking for 60% used clusters to send my pause frame but it
    > never got there however nettupgeget() call fails saying no mblk, so
    > that why I was wondering how to also check the mblks.
    >
    > thanks again for responding
    > Chris- Hide quoted text -
    >
    > - Show quoted text -


    Chris,

    In order to determine amount of free mbufs in a netPool given an
    allocated M_BLK_ID mBlk you should be able to read value of the
    following field:

    mBlk->pClBlk->pNetPool->mBlkFree; //plain integer

    However, WR deprecates use of this field, so the alternative is to
    use:

    mBlk->pClBlk->pNetPool->pPoolStat->mTypes [MT_FREE]; // ULONG

    Hope it helps.
    maximb

  5. Re: free mblks

    On Mar 31, 3:11*am, "comp.soft-sys.ace"
    wrote:
    > On Mar 27, 5:58*pm, mactonio wrote:
    >
    >
    >
    >
    >
    > > On Mar 27, 3:54*am, "comp.soft-sys.ace"
    > > wrote:

    >
    > > > On Mar 27, 5:13*am, mactonio wrote:

    >
    > > > > Hi,
    > > > > Does anyone know of a way for me to check the number of MBLKS that i
    > > > > have available during run time. Here is my situation I have my
    > > > > NUM_NET_MBLKS set to 800 but my network keeps growing so I dont want
    > > > > to have to keep adjusting this value everytime i think I am running
    > > > > out of MBLKS, so what I want to do is find a way to check when I am
    > > > > almost out of mblks and if i am, i will send a pause frame to the
    > > > > application that is sending me data so i can do my processing, free up
    > > > > some mblks, then let them start sending again.

    >
    > > > > here is what I want effectively:

    >
    > > > > 1. check if i have less than 20% mblks left
    > > > > 2. if true send pause frame (stop sending me data)
    > > > > 3. do my processing......free up some mblks
    > > > > 4. check if i have more than 25% mblks
    > > > > 5. if true send pause frame with zero (u can start sendin me data
    > > > > again)

    >
    > > > > i know how to do all the above except for checking number of mblks i
    > > > > have left in the pool.

    >
    > > > > thanks,
    > > > > chris

    >
    > > > Hi, Chris.

    >
    > > > I guess you are interesting of amount of free clusters and not the
    > > > M_BLKs (mbufs), since a single mbuf can be associated with more than
    > > > one memory cluster.
    > > > Anyway, you should be able to use the same mechanism of discovery of
    > > > netPoolShow.

    >
    > > > Hope it helps.
    > > > maximb- Hide quoted text -

    >
    > > > - Show quoted text -

    >
    > > hey,
    > > thanks for the feedback, but that is what i was doing before, I was
    > > checking the free clusters but for some reason I am running out of
    > > mblks before I run out of clusters, is that possible?
    > > I was checking for 60% used clusters to send my pause frame but it
    > > never got there however nettupgeget() call fails saying no mblk, so
    > > that why I was wondering how to also check the mblks.

    >
    > > thanks again for responding
    > > Chris- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Chris,
    >
    > In order to determine amount of free mbufs in a netPool given an
    > allocated M_BLK_ID mBlk you should be able to read value of the
    > following field:
    >
    > mBlk->pClBlk->pNetPool->mBlkFree; //plain integer
    >
    > However, WR deprecates use of this field, so the alternative is to
    > use:
    >
    > mBlk->pClBlk->pNetPool->pPoolStat->mTypes [MT_FREE]; // ULONG
    >
    > Hope it helps.
    > maximb- Hide quoted text -
    >
    > - Show quoted text -


    thanks maximb, thats exactly what I was looking for.

+ Reply to Thread