VirtualBox

Changeset 12731 in vbox


Ignore:
Timestamp:
Sep 25, 2008 1:35:55 PM (16 years ago)
Author:
vboxsync
Message:

Solaris/vboxnetflt: Workaround for hanging problem; will solve properly later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c

    r12683 r12731  
    294294typedef struct VBOXNETFLTPACKETID *PVBOXNETFLTPACKETID;
    295295
    296 
    297296/**
    298297 * vboxnetflt_stream_t: per-stream data (multiple streams per interface)
     
    316315    bool fRawMode;                        /* whether raw mode request was successful */
    317316    uint32_t ModeReqId;                   /* track MIOCTLs for swallowing our fake request acknowledgements */
     317    size_t cLoopback;                     /* loopback queue size list */
    318318    PVBOXNETFLTPACKETID pHead;            /* loopback packet identifier head */
    319319    PVBOXNETFLTPACKETID pTail;            /* loopback packet identifier tail */
    320     size_t cLoopback;                     /* loopback queue size list */
    321320} vboxnetflt_promisc_stream_t;
    322321
     
    710709        default:    /* Heh. */
    711710        {
    712                 RTSpinlockRelease(pThis->hSpinlock, &Tmp);
    713                 AssertRelease(pStream->Type);
    714                 break;
     711            RTSpinlockRelease(pThis->hSpinlock, &Tmp);
     712            AssertRelease(pStream->Type);
     713            break;
    715714        }
    716715    }
     
    856855static int VBoxNetFltSolarisModReadPut(queue_t *pQueue, mblk_t *pMsg)
    857856{
    858     /*
    859      * Yes, I'm paranoid.
    860      */
    861     if (!pMsg)
    862     {
    863         LogRel((DEVICE_NAME ":VBoxNetFltSolarisModReadPut huh?? Invalid parameters.\n"));
    864         return 0;
    865     }
    866 
    867857    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModReadPut pQueue=%p pMsg=%p\n", pQueue, pMsg));
    868858
     
    877867     * is somehow still in the host stream we must try not to panic the host.
    878868     */
    879     if (   pStream
     869    if (   pMsg
     870        && pStream
    880871        && pStream->Type == kPromiscStream)
    881872    {
     
    906897                        && pPromiscStream->fRawMode)
    907898                    {
    908                         RTSpinlockAcquire(pThis->hSpinlock, &Tmp);
    909899                        vboxNetFltSolarisRecv(pThis, pStream, pQueue, pMsg);
    910                         RTSpinlockRelease(pThis->hSpinlock, &Tmp);
    911900                        fSendUpstream = false;
    912901                    }
     
    1004993    }
    1005994
    1006     if (   fSendUpstream
    1007         && pMsg)
     995    if (fSendUpstream)
    1008996    {
    1009997        /*
     
    10171005        }
    10181006        else
    1019             putq(pQueue, pMsg);
     1007            putbq(pQueue, pMsg);
    10201008    }
    10211009
     
    12251213        }
    12261214        else
    1227             putq(pQueue, pMsg);
     1215            putbq(pQueue, pMsg);
    12281216    }
    12291217
     
    23892377        return VERR_NET_MSG_SIZE;
    23902378
    2391     PCRTNETETHERHDR pEthHdr = (PCRTNETETHERHDR)pMsg->b_rptr;
    23922379    PVBOXNETFLTPACKETID pCur = NULL;
    23932380    int rc = VINF_SUCCESS;
     
    24262413                break;
    24272414            }
    2428             else
     2415            else if (pPromiscStream->pTail)
    24292416            {
    2430                 Assert(pPromiscStream->pTail);
    24312417                pCur = RTMemAlloc(sizeof(VBOXNETFLTPACKETID));
    24322418                if (RT_UNLIKELY(!pCur))
     
    25802566     * Don't loopback packets we transmit to the wire.
    25812567     */
    2582     if (vboxNetFltSolarisIsOurMBlk(pThis, pPromiscStream, pMsg))
     2568#if 0
     2569    RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;
     2570    RTSpinlockAcquire(pThis->hSpinlock, &Tmp);
     2571    bool fOurPacket = vboxNetFltSolarisIsOurMBlk(pThis, pPromiscStream, pMsg);
     2572    RTSpinlockRelease(pThis->hSpinlock, &Tmp);
     2573
     2574    if (fOurPacket)
    25832575    {
    25842576        LogFlow((DEVICE_NAME ":Avoiding packet loopback.\n"));
     2577        freemsg(pMsg);
     2578        return VINF_SUCCESS;
     2579    }
     2580#endif
     2581    if (pMsg->b_flag & MSGNOLOOP)
     2582    {
    25852583        freemsg(pMsg);
    25862584        return VINF_SUCCESS;
     
    26092607    }
    26102608    vboxNetFltSolarisAnalyzeMBlk(pMsg);
    2611 
    26122609#endif
    26132610
     
    29572954    LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit pThis=%p pSG=%p fDst=%d\n", pThis, pSG, fDst));
    29582955
    2959     /*
    2960      * Create a message block and send it down the wire (downstream).
    2961      */
    29622956    int rc = VINF_SUCCESS;
    2963     RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;
    29642957    if (fDst & INTNETTRUNKDIR_WIRE)
    29652958    {
    2966         mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst);
    2967         if (RT_LIKELY(pMsg))
    2968         {
    2969             LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_WIRE\n"));
    2970 
    2971             RTSpinlockAcquire(pThis->hSpinlock, &Tmp);
    2972 
    2973             vboxnetflt_promisc_stream_t *pPromiscStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvPromiscStream);
    2974             queue_t *pPromiscWriteQueue = WR(pPromiscStream->Stream.pReadQueue);
    2975 
    2976             rc = vboxNetFltSolarisQueueLoopback(pThis, pPromiscStream, pMsg);
    2977 
    2978             RTSpinlockRelease(pThis->hSpinlock, &Tmp);
    2979 
    2980             putnext(pPromiscWriteQueue, pMsg);
    2981         }
    2982         else
    2983             rc = VERR_NO_MEMORY;
     2959        vboxnetflt_promisc_stream_t *pPromiscStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvPromiscStream);
     2960        if (RT_LIKELY(pPromiscStream))
     2961        {
     2962            mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst);
     2963            if (RT_LIKELY(pMsg))
     2964            {
     2965                LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_WIRE\n"));
     2966
     2967#if 0
     2968                RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;
     2969                RTSpinlockAcquire(pThis->hSpinlock, &Tmp);
     2970
     2971                vboxNetFltSolarisQueueLoopback(pThis, pPromiscStream, pMsg);
     2972
     2973                RTSpinlockRelease(pThis->hSpinlock, &Tmp);
     2974#endif
     2975
     2976                pMsg->b_flag |= MSGNOLOOP;
     2977                putnext(WR(pPromiscStream->Stream.pReadQueue), pMsg);
     2978            }
     2979        }
    29842980    }
    29852981
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette