Lines Matching defs:pSgBuf
146 PPDMSCATTERGATHER pSgBuf = (PPDMSCATTERGATHER)RTMemAlloc( RT_ALIGN_Z(sizeof(*pSgBuf), 16)
149 if (!pSgBuf)
155 pSgBuf->fFlags = PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1;
156 pSgBuf->cbUsed = 0;
157 pSgBuf->cbAvailable = RT_ALIGN_Z(cbMin, 16);
158 pSgBuf->pvAllocator = NULL;
160 pSgBuf->pvUser = NULL;
163 pSgBuf->pvUser = (uint8_t *)(pSgBuf + 1) + pSgBuf->cbAvailable;
164 *(PPDMNETWORKGSO)pSgBuf->pvUser = *pGso;
166 pSgBuf->cSegs = 1;
167 pSgBuf->aSegs[0].cbSeg = pSgBuf->cbAvailable;
168 pSgBuf->aSegs[0].pvSeg = pSgBuf + 1;
171 memset(pSgBuf->aSegs[0].pvSeg, 'F', pSgBuf->aSegs[0].cbSeg);
173 *ppSgBuf = pSgBuf;
181 static DECLCALLBACK(int) drvVDENetworkUp_FreeBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf)
185 if (pSgBuf)
187 Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
188 pSgBuf->fFlags = 0;
189 RTMemFree(pSgBuf);
198 static DECLCALLBACK(int) drvVDENetworkUp_SendBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf, bool fOnWorkerThread)
202 STAM_COUNTER_ADD(&pThis->StatPktSentBytes, pSgBuf->cbUsed);
205 AssertPtr(pSgBuf);
206 Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
213 if (!pSgBuf->pvUser)
218 pSgBuf->cbUsed, u64Now, u64Now - pThis->u64LastReceiveTS, u64Now - pThis->u64LastTransferTS));
221 Log2(("drvVDESend: pSgBuf->aSegs[0].pvSeg=%p pSgBuf->cbUsed=%#x\n"
223 pSgBuf->aSegs[0].pvSeg, pSgBuf->cbUsed, pSgBuf->cbUsed, pSgBuf->aSegs[0].pvSeg));
226 cbSent = vde_send(pThis->pVdeConn, pSgBuf->aSegs[0].pvSeg, pSgBuf->cbUsed, 0);
232 uint8_t const *pbFrame = (uint8_t const *)pSgBuf->aSegs[0].pvSeg;
233 PCPDMNETWORKGSO pGso = (PCPDMNETWORKGSO)pSgBuf->pvUser;
234 uint32_t const cSegs = PDMNetGsoCalcSegmentCount(pGso, pSgBuf->cbUsed); Assert(cSegs > 1);
239 void *pvSegFrame = PDMNetGsoCarveSegmentQD(pGso, (uint8_t *)pbFrame, pSgBuf->cbUsed, abHdrScratch,
249 pSgBuf->fFlags = 0;
250 RTMemFree(pSgBuf);