Skip to content

Commit

Permalink
Explicitly rejecting packets when transmit queue is busy (before that…
Browse files Browse the repository at this point in the history
… it was kind of silent);Increased default queue capacity from 256 to 1024;Added options to (un)select EEE mode (there are notes that disabling it could fix spontaneous link problems)
  • Loading branch information
donatengit committed Feb 22, 2022
1 parent d2d5bd4 commit 7edb889
Show file tree
Hide file tree
Showing 13 changed files with 366 additions and 149 deletions.
Binary file added AppleIGB/.DS_Store
Binary file not shown.
426 changes: 300 additions & 126 deletions AppleIGB/AppleIGB.cpp

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions AppleIGB/AppleIGB.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ enum
MEDIUM_INDEX_100FDFC,
MEDIUM_INDEX_1000FD,
MEDIUM_INDEX_1000FDFC,
MEDIUM_INDEX_1000FDEEE,
MEDIUM_INDEX_1000FDFCEEE,
MEDIUM_INDEX_100FDEEE,
MEDIUM_INDEX_100FDFCEEE,
MEDIUM_INDEX_COUNT
};

Expand All @@ -43,14 +47,6 @@ enum {
kEEETypeCount
};

enum
{
kActivationLevelNone = 0, /* adapter shut off */
kActivationLevelKDP, /* adapter partially up to support KDP */
kActivationLevelBSD /* adapter fully up to support KDP and BSD */
};


#define super IOEthernetController

class AppleIGB: public super
Expand Down Expand Up @@ -139,12 +135,18 @@ class AppleIGB: public super
bool useTSO;

bool linkUp;
bool stalled;

UInt16 eeeMode;

UInt32 iff_flags;
UInt32 _features;
UInt32 preLinkStatus;
UInt32 powerState;
UInt32 _mtu;
SInt32 txNumFreeDesc;

UInt32 chip_idx;

struct igb_adapter priv_adapter;
public:
Expand Down Expand Up @@ -179,6 +181,8 @@ class AppleIGB: public super
void setLinkDown();
void checkLinkStatus();


UInt16 intelSupportsEEE(struct igb_adapter *adapter);
bool setupMediumDict();

void intelSetupAdvForMedium(const IONetworkMedium *medium);
Expand Down
10 changes: 5 additions & 5 deletions AppleIGB/igb.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ struct igb_adapter;
#define IGB_INT_MODE_MSIX 2

/* TX/RX descriptor defines */
#define IGB_DEFAULT_TXD 256
#define IGB_DEFAULT_TX_WORK 128
#define IGB_DEFAULT_TXD 1024
#define IGB_DEFAULT_TX_WORK 512
#define IGB_MIN_TXD 80
#define IGB_MAX_TXD 4096

#define IGB_DEFAULT_RXD 256
#define IGB_DEFAULT_RXD 1024
#define IGB_MIN_RXD 80
#define IGB_MAX_RXD 4096

Expand All @@ -128,10 +128,10 @@ struct igb_adapter;
#define MAX_Q_VECTORS 10

/* Transmit and receive queues */
#define IGB_MAX_RX_QUEUES 16
#define IGB_MAX_RX_QUEUES 8
#define IGB_MAX_RX_QUEUES_82575 4
#define IGB_MAX_RX_QUEUES_I211 2
#define IGB_MAX_TX_QUEUES 16
#define IGB_MAX_TX_QUEUES 8

#define IGB_MAX_VF_MC_ENTRIES 30
#define IGB_MAX_VF_FUNCTIONS 8
Expand Down
9 changes: 5 additions & 4 deletions AppleIGB/kcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,11 @@ typedef void AppleIGB;
#define unlikely(x) (x)
#define likely(x) (x)
#define BUG()
#define wmb()
#define rmb()
#define mmiowb()
#define smp_mb() mb()

#define wmb() mb()
#define rmb() mb()
#define mmiowb()
#define smp_mb() mb()
#define mb()

#define __MODULE_STRING(s) "x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = "$(SRCROOT)/AppleIGB/Info.plist";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 5.7.2;
MODULE_NAME = com.amdosx.driver.AppleIGB;
MODULE_VERSION = 1.0.0d1;
Expand All @@ -320,7 +320,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = "$(SRCROOT)/AppleIGB/Info.plist";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 5.7.2;
MODULE_NAME = com.amdosx.driver.AppleIGB;
MODULE_VERSION = 1.0.0d1;
Expand Down Expand Up @@ -366,7 +366,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SKIP_INSTALL = NO;
Expand Down Expand Up @@ -408,7 +408,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SKIP_INSTALL = NO;
Expand Down Expand Up @@ -451,7 +451,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
SDKROOT = macosx;
SKIP_INSTALL = NO;
VALID_ARCHS = i386;
Expand All @@ -469,7 +469,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = "$(SRCROOT)/AppleIGB/Info.plist";
MACOSX_DEPLOYMENT_TARGET = 12.1;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 5.7.2;
MODULE_NAME = com.amdosx.driver.AppleIGB;
MODULE_VERSION = 1.0.0d1;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "33F73013-29E5-4C17-9F8D-B8AF769811DD"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "01DA64F4-BF9D-48BE-8565-C22F78A1EC02"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "AppleIGB/igb.h"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "329"
endingLineNumber = "329"
landmarkName = "igb_rx_buffer"
landmarkType = "14">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>AppleIGB.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

0 comments on commit 7edb889

Please sign in to comment.