aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2008-02-21 18:11:02 -0500
committerJeff Garzik <jeff@garzik.org>2008-02-24 00:07:49 -0500
commitde92d84ec2305c490aa1db33f6e40680f8c236a8 (patch)
tree78298ae28581b04642313f1d78c968d1e53573e5 /drivers/net/e1000e
parent4a5694e66428607585c9f4dd14bcf4158d2de191 (diff)
e1000e: fix flow control denial of service possibility
this patch avoids a denial of service from an evildoer sending a continuous stream of flow control at our adapter that is plugged into a non-flow control enabled switch. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/lib.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 0860b5fb3471..341d74e81fb0 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -1104,34 +1104,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1104 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 1104 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
1105 mac->fc = e1000_fc_rx_pause; 1105 mac->fc = e1000_fc_rx_pause;
1106 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); 1106 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
1107 } 1107 } else {
1108 /* Per the IEEE spec, at this point flow control should be 1108 /*
1109 * disabled. However, we want to consider that we could 1109 * Per the IEEE spec, at this point flow control
1110 * be connected to a legacy switch that doesn't advertise 1110 * should be disabled.
1111 * desired flow control, but can be forced on the link 1111 */
1112 * partner. So if we advertised no flow control, that is
1113 * what we will resolve to. If we advertised some kind of
1114 * receive capability (Rx Pause Only or Full Flow Control)
1115 * and the link partner advertised none, we will configure
1116 * ourselves to enable Rx Flow Control only. We can do
1117 * this safely for two reasons: If the link partner really
1118 * didn't want flow control enabled, and we enable Rx, no
1119 * harm done since we won't be receiving any PAUSE frames
1120 * anyway. If the intent on the link partner was to have
1121 * flow control enabled, then by us enabling RX only, we
1122 * can at least receive pause frames and process them.
1123 * This is a good idea because in most cases, since we are
1124 * predominantly a server NIC, more times than not we will
1125 * be asked to delay transmission of packets than asking
1126 * our link partner to pause transmission of frames.
1127 */
1128 else if ((mac->original_fc == e1000_fc_none) ||
1129 (mac->original_fc == e1000_fc_tx_pause)) {
1130 mac->fc = e1000_fc_none; 1112 mac->fc = e1000_fc_none;
1131 hw_dbg(hw, "Flow Control = NONE.\r\n"); 1113 hw_dbg(hw, "Flow Control = NONE.\r\n");
1132 } else {
1133 mac->fc = e1000_fc_rx_pause;
1134 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
1135 } 1114 }
1136 1115
1137 /* Now we need to do one last check... If we auto- 1116 /* Now we need to do one last check... If we auto-