VirtualBox

Changeset 10075

Show
Ignore:
Timestamp:
07/01/08 17:37:13 (6 months ago)
Author:
vboxsync
Message:

Simplified it a bit by introducing a out-bound lock on the trunk port.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/intnet.h

    r10038 r10075  
    391391 * 
    392392 * This is only used for the in-kernel trunk connections. 
     393 * 
     394 * @remarks The internal network side is responsible for serializing all calls 
     395 *          to this interface. This is (assumed) to be implemented using a lock 
     396 *          that is only ever taken before a call to this interface. The lock 
     397 *          is referred to as the out-bound trunk port lock. 
    393398 */ 
    394399typedef struct INTNETTRUNKIFPORT 
     
    404409     * @param   pIfPort     Pointer to this structure. 
    405410     * 
    406      * @remarks The caller may own any locks
     411     * @remarks The caller may own any locks or none at all, we don't care
    407412     */ 
    408413    DECLR0CALLBACKMEMBER(void, pfnRetain,(PINTNETTRUNKIFPORT pIfPort)); 
     
    416421     * @param   pIfPort     Pointer to this structure. 
    417422     * 
    418      * @remarks Where possible, it should be executed without holding any locks 
    419      *          unless the caller is certain it is not going to trigger the destructor
     423     * @remarks Only the out-bound trunk port lock, unless the caller is certain the 
     424     *          call is not going to cause destruction (wont happen)
    420425     */ 
    421426    DECLR0CALLBACKMEMBER(void, pfnRelease,(PINTNETTRUNKIFPORT pIfPort)); 
     
    429434     * @param   pIfPort     Pointer to this structure. 
    430435     * 
    431      * @remarks Called without holding any locks
     436     * @remarks Called holding the out-bound trunk port lock
    432437     */ 
    433438    DECLR0CALLBACKMEMBER(void, pfnDisconnectAndRelease,(PINTNETTRUNKIFPORT pIfPort)); 
     
    453458     * @param   fActive     True if the new state is 'active', false if the new state is 'suspended'. 
    454459     * 
    455      * @remarks Called while *not* owning any semaphores. Will not grab anything
     460     * @remarks Called holding the out-bound trunk port lock
    456461     */ 
    457462    DECLR0CALLBACKMEMBER(bool, pfnSetActive,(PINTNETTRUNKIFPORT pIfPort, bool fActive)); 
     
    469474     *                      an indefinite wait. 
    470475     * 
    471      * @remarks Called while *not* owning any semaphores. Will not grab anything
     476     * @remarks Called holding the out-bound trunk port lock
    472477     */ 
    473478    DECLR0CALLBACKMEMBER(bool, pfnWaitForIdle,(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies)); 
     
    482487     * @param   pMac        Pointer to the mac address. 
    483488     * 
    484      * @remarks Called while owning the network semaphore
     489     * @remarks Called while owning the network and the out-bound trunk port semaphores
    485490     * 
    486491     * @remarks TAP and NAT will compare with their own MAC address and let all their 
     
    504509     * @param   pIfPort     Pointer to this structure. 
    505510     * 
    506      * @remarks Called while owning the network semaphore
     511     * @remarks Called while owning the network and the out-bound trunk port semaphores
    507512     */ 
    508513    DECLR0CALLBACKMEMBER(bool, pfnIsPromiscuous,(PINTNETTRUNKIFPORT pIfPort)); 
     
    523528     *                      allocating and copying. 
    524529     * 
    525      * @remarks Called while owning the network semaphore. 
    526      *          (Works on darwin, but may have to be relaxed later on other hosts.) 
     530     * @remarks Called holding the out-bound trunk port lock. 
    527531     * 
    528532     * @remarks TAP and NAT will use this interface for all their traffic, see pfnIsHostMac. 
     
    545549     *                      allocating and copying. 
    546550     * 
    547      * @remarks Called while owning the network semaphore. 
    548      *          (Works on darwin, but may have to be relaxed later on other hosts.) 
     551     * @remarks Called holding the out-bound trunk port lock. 
    549552     * 
    550553     * @remarks TAP and NAT will call pfnSGRelease and return successfully. 
     
    567570{ 
    568571    /** 
    569      * Create an instance for the specfied host interface. 
     572     * Create an instance for the specfied host interface and connects it 
     573     * to the internal network trunk port. 
    570574     * 
    571575     * The initial interface active state is false (suspended). 
     
    585589     *                              on success. 
    586590     * 
    587      * @remarks Called while owning the network semaphore
    588      */ 
    589     DECLR0CALLBACKMEMBER(int, pfnCreate,(struct INTNETTRUNKNETFLTFACTORY *pIfFactory, const char *pszName, 
    590                                          PINTNETTRUNKSWPORT pSwitchPort, PINTNETTRUNKIFPORT *ppIfPort)); 
     591     * @remarks Called while owning the network and the out-bound trunk semaphores
     592     */ 
     593    DECLR0CALLBACKMEMBER(int, pfnCreateAndConnect,(struct INTNETTRUNKNETFLTFACTORY *pIfFactory, const char *pszName, 
     594                                                   PINTNETTRUNKSWPORT pSwitchPort, PINTNETTRUNKIFPORT *ppIfPort)); 
    591595} INTNETTRUNKNETFLTFACTORY; 
    592596/** Pointer to the trunk factory. */ 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy