VirtualBox

Changeset 12123 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Sep 5, 2008 11:05:31 AM (16 years ago)
Author:
vboxsync
Message:

Solaris/vboxnetflt: fixed & enabled checksumming. Enabeld fast path ack's.

File:
1 edited

Legend:

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

    r12089 r12123  
    520520static int VBoxNetFltSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pvArg, void **ppResult)
    521521{
    522     LogFlow((DEVICE_NAME ":VBoxNetFltSolarisGetInfo pDip=%p enmCmd=%d pArg=%p instance=%d\n", pDip, enmCmd, getminor((dev_t)pvArg)));
     522    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisGetInfo pDip=%p enmCmd=%d pArg=%p instance=%d\n", pDip, enmCmd,
     523                getminor((dev_t)pvArg)));
    523524
    524525    switch (enmCmd)
     
    557558    Assert(pQueue);
    558559
    559     LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen pQueue=%p pDev=%p fOpenMode=%d fStreamMode=%d\n", pQueue, pDev, fOpenMode, fStreamMode));
     560    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen pQueue=%p pDev=%p fOpenMode=%d fStreamMode=%d\n", pQueue, pDev,
     561            fOpenMode, fStreamMode));
    560562
    561563    /*
     
    638640    WR(pQueue)->q_ptr = pStream;
    639641
    640     /** @todo Get rid of linked list maintenance; we're not a virtual DLPI device slaving for ring-3 consumers. */
    641642    /*
    642643     * Link it to the list of streams.
     
    985986                             * Since we are evil, let's acknowledge the request ourselves!
    986987                             */
    987                             miocnak(pQueue, pMsg, 0, EINVAL);
     988                            miocack(pQueue, pMsg, 0, EINVAL);
    988989                            fSendDownstream = false;
    989990                            LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Fast path request when we need raw mode!\n"));
     
    12511252        bcopy(pMsg->b_rptr + pPhysAddrAck->dl_addr_offset, &pThis->u.s.Mac, sizeof(pThis->u.s.Mac));
    12521253
    1253         LogFlow((DEVICE_NAME ":vboxNetFltSolarisCachePhysAddr: DL_PHYS_ADDR_ACK: Mac=%.*Rhxs\n", sizeof(pThis->u.s.Mac), &pThis->u.s.Mac));
     1254        LogFlow((DEVICE_NAME ":vboxNetFltSolarisCachePhysAddr: DL_PHYS_ADDR_ACK: Mac=%.*Rhxs\n", sizeof(pThis->u.s.Mac),
     1255                    &pThis->u.s.Mac));
    12541256    }
    12551257}
     
    13821384static int vboxNetFltSolarisRelink(vnode_t *pVNode, struct lifreq *pInterface, int IpMuxFd, int ArpMuxFd)
    13831385{
    1384     LogFlow((DEVICE_NAME ":vboxNetFltSolarisRelink: pVNode=%p pInterface=%p IpMuxFd=%d ArpMuxFd=%d\n", pVNode, pInterface, IpMuxFd, ArpMuxFd));
     1386    LogFlow((DEVICE_NAME ":vboxNetFltSolarisRelink: pVNode=%p pInterface=%p IpMuxFd=%d ArpMuxFd=%d\n", pVNode,
     1387            pInterface, IpMuxFd, ArpMuxFd));
    13851388
    13861389    int NewIpMuxId;
     
    16231626                                 * Inject/Eject from the host IP stack.
    16241627                                 */
    1625                                 rc = strioctl(pVNodeIp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K, kcred, &ret);
     1628                                rc = strioctl(pVNodeIp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K,
     1629                                            kcred, &ret);
    16261630                                if (!rc)
    16271631                                {
     
    16301634                                     */
    16311635                                    g_VBoxNetFltSolarisState.CurType = kArpStream;
    1632                                     rc = strioctl(pVNodeArp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&ArpStrMod, 0, K_TO_K, kcred, &ret);
     1636                                    rc = strioctl(pVNodeArp, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&ArpStrMod, 0, K_TO_K,
     1637                                                kcred, &ret);
    16331638                                    if (!rc)
    16341639                                    {
     
    16431648                                        if (VBOX_SUCCESS(rc))
    16441649                                        {
    1645                                             bool fRawModeOk = !fAttach;         /* Raw mode check is always ok during the detach case */
     1650                                            bool fRawModeOk = !fAttach;   /* Raw mode check is always ok during the detach case */
    16461651                                            if (fAttach)
    16471652                                            {
     
    16711676                                                ldi_close(IPDevHandle, FREAD | FWRITE, kcred);
    16721677
    1673                                                 LogFlow((DEVICE_NAME ":vboxNetFltSolarisModSetup: Success! %s %s@(Ip:%d Arp:%d) %s interface %s\n",
    1674                                                         fAttach ? "Injected" : "Ejected", StrMod.mod_name, StrMod.pos, ArpStrMod.pos,
    1675                                                         fAttach ? "to" : "from", pThis->szName));
     1678                                                LogFlow((DEVICE_NAME ":vboxNetFltSolarisModSetup: Success! %s %s@(Ip:%d Arp:%d) "
     1679                                                        "%s interface %s\n", fAttach ? "Injected" : "Ejected", StrMod.mod_name,
     1680                                                        StrMod.pos, ArpStrMod.pos, fAttach ? "to" : "from", pThis->szName));
    16761681                                                return VINF_SUCCESS;
    16771682                                            }
     
    16811686                                        else
    16821687                                        {
    1683                                             LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: module relinking failed. Mode=%s rc=%d.\n",
     1688                                            LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: Relinking failed. Mode=%s rc=%d.\n",
    16841689                                                    fAttach ? "inject" : "eject", rc));
    16851690                                        }
     
    17091714                            }
    17101715                            else
    1711                                 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: vboxNetFltSolarisDetermineModPos failed. rc=%d rc2=%d\n", rc, rc2));
     1716                                LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: failed to find position. rc=%d rc2=%d\n", rc, rc2));
    17121717                        }
    17131718                        else
     
    20992104
    21002105    bool fChecksumAdjusted = false;
    2101 #if 0
     2106#if 1
    21022107    if (fSrc & INTNETTRUNKDIR_HOST)
    21032108    {
     
    22002205 *                  This must not be DLPI linked messages, must be M_DATA.
    22012206 *
    2202  * @remarks This function expects raw mblk_t (chained is acceptible) and if it
    2203  *          returns a corrected message, the passed in input message has been
    2204  *          freed and should not be referenced anymore.
     2207 * @remarks If this function returns a checksum adjusted message, the
     2208 *          passed in input message has been freed and should not be
     2209 *          referenced anymore by the caller.
    22052210 */
    22062211static mblk_t *vboxNetFltSolarisFixChecksums(mblk_t *pMsg)
     
    22232228         */
    22242229        size_t cbIpPacket = 0;
     2230        mblk_t *pFullMsg = NULL;
    22252231        if (pMsg->b_cont)
    22262232        {
     
    22522258            }
    22532259
    2254             freemsg(pMsg);
    2255             pMsg = pFullMsg;
    2256             DB_TYPE(pMsg) = M_DATA;
    2257             pEthHdr = (PRTNETETHERHDR)pMsg->b_rptr;
    2258         }
    2259 
    2260         cbIpPacket = MBLKL(pMsg) - sizeof(RTNETETHERHDR);
     2260            DB_TYPE(pFullMsg) = M_DATA;
     2261            pEthHdr = (PRTNETETHERHDR)pFullMsg->b_rptr;
     2262            cbIpPacket = MBLKL(pFullMsg) - sizeof(RTNETETHERHDR);
     2263        }
     2264        else
     2265            cbIpPacket = MBLKL(pMsg) - sizeof(RTNETETHERHDR);
    22612266
    22622267        /*
     
    23012306            LogFlow((DEVICE_NAME ":fixed IP checkum.\n"));
    23022307
     2308            /*
     2309             * If we made a copy and the checksum is corrected on the copy,
     2310             * free the original, return the checksum fixed copy.
     2311             */
     2312            if (pFullMsg)
     2313            {
     2314                freemsg(pMsg);
     2315                return pFullMsg;
     2316            }
     2317
    23032318            return pMsg;
    23042319        }
     2320
     2321        /*
     2322         * If we made a copy and the checksum is NOT corrected, free the copy,
     2323         * and return NULL.
     2324         */
     2325        if (pFullMsg)
     2326            freemsg(pFullMsg);
    23052327    }
    23062328
     
    23412363    else
    23422364    {
    2343         LogFlow((DEVICE_NAME ":Unknown EtherType=%x D=%.6Rhxs S=%.6Rhxs\n", RT_H2BE_U16(pEthHdr->EtherType), &pEthHdr->DstMac, &pEthHdr->SrcMac));
     2365        LogFlow((DEVICE_NAME ":Unknown EtherType=%x D=%.6Rhxs S=%.6Rhxs\n", RT_H2BE_U16(pEthHdr->EtherType), &pEthHdr->DstMac,
     2366                    &pEthHdr->SrcMac));
    23442367        /* LogFlow((DEVICE_NAME ":%.*Vhxd\n", MBLKL(pMsg), pMsg->b_rptr)); */
    23452368    }
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