Skip to content

Commit

Permalink
fix maxpacket of kdp
Browse files Browse the repository at this point in the history
  • Loading branch information
dany authored and dany committed Dec 1, 2018
1 parent f12b424 commit e0fa47e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 3 deletions.
Binary file not shown.
14 changes: 11 additions & 3 deletions IntelMausiEthernet/IntelMausiEthernet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
#include <libkern/version.h>
#include "IntelMausiEthernet.h"


//#define ETHERMTU 1500
#define ETHERHDRSIZE 14
#define ETHERCRC 4
#define KDP_MAXPACKET (ETHERHDRSIZE + ETHERMTU + ETHERCRC)



#pragma mark --- function prototypes ---

static inline void prepareTSO4(mbuf_t m, UInt32 *mssHeaderSize, UInt32 *payloadSize);
Expand Down Expand Up @@ -602,7 +610,7 @@ void IntelMausi::receivePacket(void * pkt, UInt32 * pktSizeOUt, UInt32 timeout)


//interface->enqueueInputPacket(rxPacketHead, pollQueue);
if( rxPacketSize < 1454)
if( rxPacketSize <= KDP_MAXPACKET)
{
isReceived = true;
* pktSizeOUt =rxPacketSize;
Expand Down Expand Up @@ -674,7 +682,7 @@ void IntelMausi::sendPacket(void * pkt, UInt32 pktSize)
struct e1000_data_desc *desc;
struct e1000_context_desc *contDesc;
mbuf_t m;
IOReturn result = kIOReturnNoResources;
// IOReturn result = kIOReturnNoResources;
UInt32 numDescs;
UInt32 cmd;
UInt32 opts;
Expand All @@ -701,7 +709,7 @@ void IntelMausi::sendPacket(void * pkt, UInt32 pktSize)
}


if(pktSize > 1454)
if(pktSize > KDP_MAXPACKET)
{
DebugLog("Ethernet [IntelMausi]:sendPacket pktSize is too big.\n");
goto done;
Expand Down
Binary file modified build/Products/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit e0fa47e

Please sign in to comment.