# HG changeset patch # User hgs # Date 1274723359 -3600 # Node ID 8fc8de15e664766b9f86539ac44f1df9f0a24bdb # Parent d2396c80c3449659828d194c35c5550b5eb22c33 201019_04 diff -r d2396c80c344 -r 8fc8de15e664 commsfwsupport/commselements/commsfw/inc/cftransport.h --- a/commsfwsupport/commselements/commsfw/inc/cftransport.h Mon May 24 18:44:15 2010 +0100 +++ b/commsfwsupport/commselements/commsfw/inc/cftransport.h Mon May 24 18:49:19 2010 +0100 @@ -262,9 +262,6 @@ IMPORT_C void RegisterAddress(Messages::TRuntimeCtxId& aCookie); IMPORT_C void DeregisterAddress(Messages::TRuntimeCtxId& aCookie); - // From MTransportSender - IMPORT_C void PostMessage(const Messages::TRuntimeCtxId& aPostFrom, const Messages::TRuntimeCtxId& aPostTo, const Meta::SMetaData& aMessage); - // TCFMessage + legacy IMPORT_C void RegisterLegacyInterface(MLegacyMessageReceiver* aLegacyInterface); IMPORT_C void PostMessage(const TCFMessage& aMessage); diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/Test06SplitL.cpp --- a/commsfwutils/commsbufs/TS_mbufmgr/Test06SplitL.cpp Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/TS_mbufmgr/Test06SplitL.cpp Mon May 24 18:49:19 2010 +0100 @@ -61,6 +61,8 @@ { return EFail; } + TBool forceSmallBuf = EFalse; + bRet = GetIntFromConfig(_L("MBufMgrTest06"), _L("ForceSmallBuf"), forceSmallBuf); Log(_L(" ------- Chain & Desc LENGTH = %d --"), aLength); Log(_L(" ------- OFFSET where to Split = %d --"), aOffset); if ( (aLength > 1000) ||(aLength <0) || @@ -79,7 +81,36 @@ Log(_L(" 01 Creating CMBufManager and installing active scheduler:")); CleanupStack::PushL( iActSch = new(ELeave) CActiveScheduler ); CActiveScheduler::Install(iActSch); - CreateInstanceMBufMgrL(KMBufDefaultHeapSize); + + enum { KBigBuf = 256, KSmallBuf = 128 }; + if(forceSmallBuf) + { + RArray createInfoArray; + + TCommsBufPoolCreateInfo createInfo; + createInfo.iBufSize = KSmallBuf; + createInfo.iInitialBufs = 128; + createInfo.iGrowByBufs = 64; + createInfo.iMinFreeBufs = 40; + createInfo.iCeiling = 410; + createInfoArray.AppendL(createInfo); + + createInfo.iBufSize = KBigBuf; + createInfo.iInitialBufs = 3; + createInfo.iGrowByBufs = 1; + createInfo.iMinFreeBufs = 1; + createInfo.iCeiling = 3; + createInfoArray.AppendL(createInfo); + + CreateInstanceMBufMgrL(createInfoArray); + + createInfoArray.Close(); + } + else + { + CreateInstanceMBufMgrL(KMBufDefaultHeapSize); + } + CleanupClosePushL(iBufPond); //-------------- substep 2 -------------------- @@ -111,6 +142,18 @@ #endif User::Leave(EFail); } + + if(forceSmallBuf) + { + for(RMBuf* buf = aChain1.First(); buf; buf = buf->Next()) + { + if(buf->Size() != KBigBuf) + { + Log(_L("-- initial chain should be composed of %d buf, found %d buf"), KBigBuf, buf->Size()); + User::Leave(EFail); + } + } + } //-------------- substep 6 -------------------- Log(_L(" 06 Copy in Des1 into Chain1:")); @@ -158,6 +201,16 @@ #endif User::Leave(EFail); } + + if(forceSmallBuf) + { + if(!aChain2.First() || aChain2.First()->Size() != KSmallBuf || + !aChain2.First()->Next() || aChain2.First()->Next()->Size() != KSmallBuf) + { + Log(_L("-- split chain should start with two %d buf"), KSmallBuf); + User::Leave(EFail); + } + } //-------------- substep 9 -------------------- Log(_L(" 09 Copy out Chain1 into Des2:")); @@ -184,7 +237,7 @@ //-------------- substep 12 -------------------- Log(_L(" 12 Copy out the whole Chain2 into Des2 at offset = OFFSET")); TPtr8 dest((TUint8*)aDes2->Ptr() + aOffset, aLength-aOffset, aLength - aOffset); - aChain1.CopyOut(dest); + aChain2.CopyOut(dest); //-------------- substep 13 -------------------- Log(_L(" 13 Compare the content of Des1 & Des2:")); diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-1st.ini --- a/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-1st.ini Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-1st.ini Mon May 24 18:49:19 2010 +0100 @@ -1,3 +1,4 @@ [MBufMgrTest06] Length=100 Offset=60 +ForceSmallBuf=0 diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini --- a/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini Mon May 24 18:49:19 2010 +0100 @@ -1,3 +1,4 @@ [MBufMgrTest06] Length=200 Offset=129 +ForceSmallBuf=0 diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini --- a/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini Mon May 24 18:49:19 2010 +0100 @@ -1,3 +1,4 @@ [MBufMgrTest06] Length=300 Offset=160 +ForceSmallBuf=0 diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-4th.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/MBufTest06-4th.ini Mon May 24 18:49:19 2010 +0100 @@ -0,0 +1,4 @@ +[MBufMgrTest06] +Length=700 +Offset=260 +ForceSmallBuf=1 diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/mbuftest.script --- a/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/mbuftest.script Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/TS_mbufmgr/scriptfiles/mbuftest.script Mon May 24 18:49:19 2010 +0100 @@ -125,6 +125,17 @@ PRINT END_TESTCASE COMINF-MBUFMGR-0602 +START_TESTCASE COMINF-MBUFMGR-0603 +//! @SYMTestCaseID COMINF-MBUFMGR-0603 +PRINT Test 06: Split a chain of big bufs when only small reamaining +HANDLES_MARK +RUN_TEST_STEP 10000, TS_CTMBufMgr, MBufMgrTest06 ,z:\testdata\configs\MBufTest06-4th.ini +TEST_COMPLETE +HANDLES_CHECK +PRINT ------------------------------ +PRINT +END_TESTCASE COMINF-MBUFMGR-0603 + START_TESTCASE COMINF-MBUFMGR-0700 //! @SYMTestCaseID COMINF-MBUFMGR-0700 PRINT Test 07: TrimStart the chain on the first and only RMBuf diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/group/bld.inf --- a/commsfwutils/commsbufs/group/bld.inf Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/group/bld.inf Mon May 24 18:49:19 2010 +0100 @@ -51,52 +51,34 @@ ../mbufmgr/inc/mbufpktq.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/mbufpktq.h) ../mbufmgr/inc/mbufpktq.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/mbufpktq.inl) ../mbufmgr/inc/mbufasyncrequest.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/mbufasyncrequest.h) -../mbufmgr/inc/mbufpanic.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/mbufpanic.h) +../mbufmgr/inc/MBufPanic.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(comms-infras/mbufpanic.h) ../mbufmgr/inc/nifmbuf.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(nifmbuf.h) ../mbufmgr/inc/mb_thread.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(mb_thread.h) -../mbufmgrimpl/inc/es_mbman.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(es_mbman.h) +../mbufmgrimpl/inc/ES_MBMAN.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(es_mbman.h) PRJ_TESTEXPORTS //MBuf ComponentTest scripts & configs -../TS_mbufmgr/scriptfiles/mbuftest.script /epoc32/release/wins/udeb/z/testdata/scripts/mbuftest.script -../TS_mbufmgr/scriptfiles/mbuftest.script /epoc32/release/winscw/udeb/z/testdata/scripts/mbuftest.script -../TS_mbufmgr/scriptfiles/MBufTest05-CopyIn.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest05-copyin.ini -../TS_mbufmgr/scriptfiles/MBufTest05-CopyIn.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest05-copyin.ini -../TS_mbufmgr/scriptfiles/MBufTest05-CopyOut.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest05-copyout.ini -../TS_mbufmgr/scriptfiles/MBufTest05-CopyOut.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest05-copyout.ini -../TS_mbufmgr/scriptfiles/MBufTest06-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest06-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest06-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest06-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest06-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest06-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest06-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest06-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest07-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest07-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest07-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest07-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest07-2nd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest07-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest07-2nd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest07-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest07-3rd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest07-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest07-3rd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest07-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest08-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest08-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest08-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest08-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest08-2nd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest08-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest08-2nd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest08-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest08-3rd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest08-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest08-3rd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest08-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest09-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest09-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest09-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest09-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest09-2nd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest09-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest09-2nd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest09-2nd.ini -../TS_mbufmgr/scriptfiles/MBufTest09-3rd.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest09-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest09-3rd.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest09-3rd.ini -../TS_mbufmgr/scriptfiles/MBufTest09-4th.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest09-4th.ini -../TS_mbufmgr/scriptfiles/MBufTest09-4th.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest09-4th.ini -../TS_mbufmgr/scriptfiles/MBufTest09-5th.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest09-5th.ini -../TS_mbufmgr/scriptfiles/MBufTest09-5th.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest09-5th.ini -../TS_mbufmgr/scriptfiles/MBufTest10-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest10-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest10-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest10-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest13-1st.ini /epoc32/release/wins/udeb/z/testdata/configs/mbuftest13-1st.ini -../TS_mbufmgr/scriptfiles/MBufTest13-1st.ini /epoc32/release/winscw/udeb/z/testdata/configs/mbuftest13-1st.ini +../TS_mbufmgr/scriptfiles/mbuftest.script z:/testdata/scripts/mbuftest.script +../TS_mbufmgr/scriptfiles/MBufTest05-CopyIn.ini z:/testdata/configs/mbuftest05-copyin.ini +../TS_mbufmgr/scriptfiles/MBufTest05-CopyOut.ini z:/testdata/configs/mbuftest05-copyout.ini +../TS_mbufmgr/scriptfiles/MBufTest06-1st.ini z:/testdata/configs/mbuftest06-1st.ini +../TS_mbufmgr/scriptfiles/MBufTest06-2nd.ini z:/testdata/configs/mbuftest06-2nd.ini +../TS_mbufmgr/scriptfiles/MBufTest06-3rd.ini z:/testdata/configs/mbuftest06-3rd.ini +../TS_mbufmgr/scriptfiles/MBufTest06-4th.ini z:/testdata/configs/mbuftest06-4th.ini +../TS_mbufmgr/scriptfiles/MBufTest07-1st.ini z:/testdata/configs/mbuftest07-1st.ini +../TS_mbufmgr/scriptfiles/MBufTest07-2nd.ini z:/testdata/configs/mbuftest07-2nd.ini +../TS_mbufmgr/scriptfiles/MBufTest07-3rd.ini z:/testdata/configs/mbuftest07-3rd.ini +../TS_mbufmgr/scriptfiles/MBufTest08-1st.ini z:/testdata/configs/mbuftest08-1st.ini +../TS_mbufmgr/scriptfiles/MBufTest08-2nd.ini z:/testdata/configs/mbuftest08-2nd.ini +../TS_mbufmgr/scriptfiles/MBufTest08-3rd.ini z:/testdata/configs/mbuftest08-3rd.ini +../TS_mbufmgr/scriptfiles/MBufTest09-1st.ini z:/testdata/configs/mbuftest09-1st.ini +../TS_mbufmgr/scriptfiles/MBufTest09-2nd.ini z:/testdata/configs/mbuftest09-2nd.ini +../TS_mbufmgr/scriptfiles/MBufTest09-3rd.ini z:/testdata/configs/mbuftest09-3rd.ini +../TS_mbufmgr/scriptfiles/MBufTest09-4th.ini z:/testdata/configs/mbuftest09-4th.ini +../TS_mbufmgr/scriptfiles/MBufTest09-5th.ini z:/testdata/configs/mbuftest09-5th.ini +../TS_mbufmgr/scriptfiles/MBufTest10-1st.ini z:/testdata/configs/mbuftest10-1st.ini +../TS_mbufmgr/scriptfiles/MBufTest13-1st.ini z:/testdata/configs/mbuftest13-1st.ini testmbuf.iby /epoc32/rom/include/testmbuf.iby PRJ_MMPFILES diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/group/testmbuf.iby --- a/commsfwutils/commsbufs/group/testmbuf.iby Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/group/testmbuf.iby Mon May 24 18:49:19 2010 +0100 @@ -22,25 +22,26 @@ #include file=ABI_DIR\DEBUG_DIR\TS_CTMBUFMGR.DLL \System\libs\TS_CTMBUFMGR.DLL -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\scripts\mbuftest.script \testdata\scripts\mbuftest.script -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\scripts\mbuftest.script \testdata\scripts\mbuftest_zc.script -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest05-CopyIn.ini \testdata\configs\MBufTest05-CopyIn.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest05-CopyOut.ini \testdata\configs\MBufTest05-CopyOut.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest06-1st.ini \testdata\configs\MBufTest06-1st.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest06-2nd.ini \testdata\configs\MBufTest06-2nd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest06-3rd.ini \testdata\configs\MBufTest06-3rd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest07-1st.ini \testdata\configs\MBufTest07-1st.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest07-2nd.ini \testdata\configs\MBufTest07-2nd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest07-3rd.ini \testdata\configs\MBufTest07-3rd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest08-1st.ini \testdata\configs\MBufTest08-1st.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest08-2nd.ini \testdata\configs\MBufTest08-2nd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest08-3rd.ini \testdata\configs\MBufTest08-3rd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest09-1st.ini \testdata\configs\MBufTest09-1st.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest09-2nd.ini \testdata\configs\MBufTest09-2nd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest09-3rd.ini \testdata\configs\MBufTest09-3rd.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest09-4th.ini \testdata\configs\MBufTest09-4th.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest09-5th.ini \testdata\configs\MBufTest09-5th.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest10-1st.ini \testdata\configs\MBufTest10-1st.ini -data=EPOCROOT##EPOC32\release\wins\udeb\z\TestData\configs\MBufTest13-1st.ini \testdata\configs\MBufTest13-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\scripts\mbuftest.script \testdata\scripts\mbuftest.script +data=EPOCROOT##epoc32\data\z\TestData\scripts\mbuftest.script \testdata\scripts\mbuftest_zc.script +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest05-CopyIn.ini \testdata\configs\MBufTest05-CopyIn.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest05-CopyOut.ini \testdata\configs\MBufTest05-CopyOut.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest06-1st.ini \testdata\configs\MBufTest06-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest06-2nd.ini \testdata\configs\MBufTest06-2nd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest06-3rd.ini \testdata\configs\MBufTest06-3rd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest06-4th.ini \testdata\configs\MBufTest06-4th.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest07-1st.ini \testdata\configs\MBufTest07-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest07-2nd.ini \testdata\configs\MBufTest07-2nd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest07-3rd.ini \testdata\configs\MBufTest07-3rd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest08-1st.ini \testdata\configs\MBufTest08-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest08-2nd.ini \testdata\configs\MBufTest08-2nd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest08-3rd.ini \testdata\configs\MBufTest08-3rd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest09-1st.ini \testdata\configs\MBufTest09-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest09-2nd.ini \testdata\configs\MBufTest09-2nd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest09-3rd.ini \testdata\configs\MBufTest09-3rd.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest09-4th.ini \testdata\configs\MBufTest09-4th.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest09-5th.ini \testdata\configs\MBufTest09-5th.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest10-1st.ini \testdata\configs\MBufTest10-1st.ini +data=EPOCROOT##epoc32\data\z\TestData\configs\MBufTest13-1st.ini \testdata\configs\MBufTest13-1st.ini #endif diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/mbufmgr/inc/nifmbuf.h --- a/commsfwutils/commsbufs/mbufmgr/inc/nifmbuf.h Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/mbufmgr/inc/nifmbuf.h Mon May 24 18:49:19 2010 +0100 @@ -46,7 +46,6 @@ */ { public: - IMPORT_C RMBufCell(RMBufCell* aPktHdr); IMPORT_C static TAny* operator new(TUint aSize, TLeave aLeave, TUint aExtra); IMPORT_C static TAny* operator new(TUint aSize, TUint aExtra) __NO_THROW; IMPORT_C static void operator delete(TAny*); diff -r d2396c80c344 -r 8fc8de15e664 commsfwutils/commsbufs/mbufmgr/src/mb_chn.cpp --- a/commsfwutils/commsbufs/mbufmgr/src/mb_chn.cpp Mon May 24 18:44:15 2010 +0100 +++ b/commsfwutils/commsbufs/mbufmgr/src/mb_chn.cpp Mon May 24 18:49:19 2010 +0100 @@ -272,7 +272,23 @@ len = Min(aLen, len); } - TInt err = newChain.Alloc(len + aHdrReserve, *this); +// Suppress the "follow-the-leader" behaviour of preserving the buffer sizing of the +// existing chain. The goal of preserving buffer characteristics remains desirable but +// not at the cost of having TCP use unnecessarily small buffers - this area needs +// rework once the Comms stack really adopts buffer pools and zero copy +// TInt err = newChain.Alloc(len + aHdrReserve, *this); + TInt err; + if(First()) + { + newChain.iNext = First()->Pool()->Pond().Alloc(len + aHdrReserve, 0, KMaxTInt); + err = iNext ? KErrNone : KErrNoMBufs; + } + else + { + RMBufAllocator allocator; + err = newChain.Alloc(aLen + aHdrReserve, allocator); + } + if(err != KErrNone) { return err; @@ -532,10 +548,10 @@ @param newChain The result chain */ { - User::LeaveIfError(RCommsBufChain::Split(anOffset, newChain)); + User::LeaveIfError(Split(anOffset, newChain)); } -EXPORT_C TInt RMBufChain::Split(TInt anOffset, RMBufChain& newChain) +EXPORT_C TInt RMBufChain::Split(TInt aOffset, RMBufChain& aNewChain) /** Split a chain into two new chains Original chain gets the 1st half newChain gets the other half. @@ -544,8 +560,63 @@ @param newChain The result chain */ { - return RCommsBufChain::Split(anOffset, newChain); - } + // RCommsBuf::Split() will not allocate a smaller buffer size than the current, as part of its approach of (trying to) + // support zero-copy transfer by respecting the buffer pool in use. This work is incomplete (needs support throughout + // the stack and probably a cleverer idea of what constitutes an acceptable buffer than simply size), so in the meantime + // having MBufMgr reflect this behaviour by refusing to Split() a big buf into smaller bufs is unnecessarily purist. + // Hence the functionality is implemented directly here + + __ASSERT_ALWAYS(iNext!=NULL, CommsBuf::Panic(EMBuf_EmptyChain)); + __ASSERT_ALWAYS(aOffset>=0, CommsBuf::Panic(EMBuf_NegativeOffset)); + + // For testing post-conditions +#ifdef _DEBUG + TInt origLen = Length(); +#endif + TInt splitBufOffset; + TInt splitBufRemainder; + RMBuf* splitBuf; + RMBuf* splitBufPrev; + + if(!Goto(aOffset, splitBuf, splitBufOffset, splitBufRemainder, splitBufPrev)) + { + aNewChain.Init(); + return KErrNone; + } + + if(splitBufOffset != splitBuf->Offset()) // Not on an mbuf boundary + { + // Copy tail of splitBuf out to a new chain (hopefully a single buf, but needn't be) + TInt splitDataOffset = splitBufOffset - splitBuf->Offset(); + TInt err = RMBufChain(splitBuf).Copy(aNewChain, splitDataOffset, splitBufRemainder); + if(err != KErrNone) + { + return err; + } + splitBuf->AdjustDataEnd(-splitBufRemainder); + RMBufChain splitTail(splitBuf->Next()); + aNewChain.Append(splitTail); + splitBuf->SetNext(NULL); + } + else + { + // Split cleaves chain between bufs + aNewChain = splitBuf; + if(splitBufPrev) + { + splitBufPrev->Unlink(); + } + } + + // Check post-conditions +#ifdef _DEBUG + TInt frag1Len = Length(); + TInt frag2Len = aNewChain.Length(); + ASSERT(origLen == frag1Len + frag2Len); + ASSERT(frag1Len == aOffset); +#endif + return KErrNone; + } // overloading for TLS EXPORT_C TInt RMBufChain::Split(TInt anOffset, RMBufChain& newChain, RMBufAllocator& /* aRMBufAllocator */) diff -r d2396c80c344 -r 8fc8de15e664 datacommsserver/esockserver/test/TE_DummyProvider/group/bld.inf --- a/datacommsserver/esockserver/test/TE_DummyProvider/group/bld.inf Mon May 24 18:44:15 2010 +0100 +++ b/datacommsserver/esockserver/test/TE_DummyProvider/group/bld.inf Mon May 24 18:49:19 2010 +0100 @@ -28,6 +28,8 @@ ../scripts/te_dummyprovider_004.script z:/testdata/scripts/te_dummyprovider_004.script ../scripts/te_dummyprovider_005.script z:/testdata/scripts/te_dummyprovider_005.script ../scripts/te_dummyprovider_006.script z:/testdata/scripts/te_dummyprovider_006.script +../scripts/te_dummyprovider_009.script z:/testdata/scripts/te_dummyprovider_009.script + ../scripts/te_dummyprovider_008.script z:/testdata/scripts/te_dummyprovider_008.script @@ -39,6 +41,8 @@ ../configs/te_dummyprovider_004.ini z:/testdata/configs/te_dummyprovider_004.ini ../configs/te_dummyprovider_005.ini z:/testdata/configs/te_dummyprovider_005.ini ../configs/te_dummyprovider_006.ini z:/testdata/configs/te_dummyprovider_006.ini +../configs/te_dummyprovider_009.ini z:/testdata/configs/te_dummyprovider_009.ini +../configs/TE_DummyProvider_ip.tcpip.esk z:/testdata/configs/TE_DummyProvider_ip.tcpip.esk ../configs/te_dummyprovider_008.ini z:/testdata/configs/te_dummyprovider_008.ini