| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/02 02:59 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"IGB",
"IGC"
],
"FocusSymbols": [
"igb_set_rxfh",
"igb_write_rss_key",
"igc_ethtool_set_rxfh",
"igc_write_rss_key",
"igc_ethtool_set_link_ksettings",
"igc_handle_autoneg_disabled",
"igc_handle_autoneg_enabled",
"igc_force_speed_duplex"
],
"Reasoning": "The patch implements RSS key configuration via ethtool for the igb and igc drivers, and adds support for forcing speed/duplex settings when autonegotiation is disabled in the igc driver. The igb driver is supported by QEMU and can be fuzzed.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/02 02:59 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 7fc3c1348ba04010da85bec2ea62723e1d3d585f\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Jul 2 02:59:03 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/intel/igb/e1000_82575.h b/drivers/net/ethernet/intel/igb/e1000_82575.h\nindex 63ec253ac7885b..9e696d55e51282 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_82575.h\n+++ b/drivers/net/ethernet/intel/igb/e1000_82575.h\n@@ -87,6 +87,27 @@ union e1000_adv_rx_desc {\n \t} wb; /* writeback */\n };\n \n+#define E1000_RSS_TYPE_NO_HASH\t\t 0\n+#define E1000_RSS_TYPE_HASH_TCP_IPV4\t 1\n+#define E1000_RSS_TYPE_HASH_IPV4\t 2\n+#define E1000_RSS_TYPE_HASH_TCP_IPV6\t 3\n+#define E1000_RSS_TYPE_HASH_IPV6_EX\t 4\n+#define E1000_RSS_TYPE_HASH_IPV6\t 5\n+#define E1000_RSS_TYPE_HASH_TCP_IPV6_EX\t 6\n+#define E1000_RSS_TYPE_HASH_UDP_IPV4\t 7\n+#define E1000_RSS_TYPE_HASH_UDP_IPV6\t 8\n+#define E1000_RSS_TYPE_HASH_UDP_IPV6_EX\t 9\n+\n+#define E1000_RSS_TYPE_MASK\t\tGENMASK(3, 0)\n+\n+#define E1000_RSS_L4_TYPES_MASK\t\\\n+\t(BIT(E1000_RSS_TYPE_HASH_TCP_IPV4)\t| \\\n+\t BIT(E1000_RSS_TYPE_HASH_TCP_IPV6)\t| \\\n+\t BIT(E1000_RSS_TYPE_HASH_TCP_IPV6_EX)\t| \\\n+\t BIT(E1000_RSS_TYPE_HASH_UDP_IPV4)\t| \\\n+\t BIT(E1000_RSS_TYPE_HASH_UDP_IPV6)\t| \\\n+\t BIT(E1000_RSS_TYPE_HASH_UDP_IPV6_EX))\n+\n #define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0\n #define E1000_RXDADV_HDRBUFLEN_SHIFT 5\n #define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */\ndiff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex 0fff1df81b7bd6..8c9b02058cecb0 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -495,6 +495,7 @@ struct hwmon_buff {\n #define IGB_N_PEROUT\t2\n #define IGB_N_SDP\t4\n #define IGB_RETA_SIZE\t128\n+#define IGB_RSS_KEY_SIZE\t40\n \n enum igb_filter_match_flags {\n \tIGB_FILTER_FLAG_ETHER_TYPE = 0x1,\n@@ -655,6 +656,7 @@ struct igb_adapter {\n \tstruct i2c_client *i2c_client;\n \tu32 rss_indir_tbl_init;\n \tu8 rss_indir_tbl[IGB_RETA_SIZE];\n+\tu8 rss_key[IGB_RSS_KEY_SIZE];\n \n \tunsigned long link_check_timeout;\n \tint copper_tries;\n@@ -735,6 +737,7 @@ void igb_down(struct igb_adapter *);\n void igb_reinit_locked(struct igb_adapter *);\n void igb_reset(struct igb_adapter *);\n int igb_reinit_queues(struct igb_adapter *);\n+void igb_write_rss_key(struct igb_adapter *adapter);\n void igb_write_rss_indir_tbl(struct igb_adapter *);\n int igb_set_spd_dplx(struct igb_adapter *, u32, u8);\n int igb_setup_tx_resources(struct igb_ring *);\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex f7938c1da835fc..65014a54a6d11c 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -3019,6 +3019,27 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)\n \treturn ret;\n }\n \n+/**\n+ * igb_write_rss_key - Program the RSS key into device registers\n+ * @adapter: board private structure\n+ *\n+ * Write the RSS key stored in adapter-\u003erss_key to the E1000 hardware registers.\n+ * Each 32-bit chunk of the key is read using get_unaligned_le32() and written\n+ * to the appropriate register.\n+ */\n+void igb_write_rss_key(struct igb_adapter *adapter)\n+{\n+\tstruct e1000_hw *hw = \u0026adapter-\u003ehw;\n+\n+\tASSERT_RTNL();\n+\n+\tfor (int i = 0; i \u003c IGB_RSS_KEY_SIZE / 4; i++) {\n+\t\tu32 val = get_unaligned_le32(\u0026adapter-\u003erss_key[i * 4]);\n+\n+\t\twr32(E1000_RSSRK(i), val);\n+\t}\n+}\n+\n static int igb_get_eee(struct net_device *netdev, struct ethtool_keee *edata)\n {\n \tstruct igb_adapter *adapter = netdev_priv(netdev);\n@@ -3276,10 +3297,12 @@ static int igb_get_rxfh(struct net_device *netdev,\n \tint i;\n \n \trxfh-\u003ehfunc = ETH_RSS_HASH_TOP;\n-\tif (!rxfh-\u003eindir)\n-\t\treturn 0;\n-\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n-\t\trxfh-\u003eindir[i] = adapter-\u003erss_indir_tbl[i];\n+\tif (rxfh-\u003eindir)\n+\t\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n+\t\t\trxfh-\u003eindir[i] = adapter-\u003erss_indir_tbl[i];\n+\n+\tif (rxfh-\u003ekey)\n+\t\tmemcpy(rxfh-\u003ekey, adapter-\u003erss_key, sizeof(adapter-\u003erss_key));\n \n \treturn 0;\n }\n@@ -3319,6 +3342,11 @@ void igb_write_rss_indir_tbl(struct igb_adapter *adapter)\n \t}\n }\n \n+static u32 igb_get_rxfh_key_size(struct net_device *netdev)\n+{\n+\treturn IGB_RSS_KEY_SIZE;\n+}\n+\n static int igb_set_rxfh(struct net_device *netdev,\n \t\t\tstruct ethtool_rxfh_param *rxfh,\n \t\t\tstruct netlink_ext_ack *extack)\n@@ -3329,35 +3357,39 @@ static int igb_set_rxfh(struct net_device *netdev,\n \tu32 num_queues;\n \n \t/* We do not allow change in unsupported parameters */\n-\tif (rxfh-\u003ekey ||\n-\t (rxfh-\u003ehfunc != ETH_RSS_HASH_NO_CHANGE \u0026\u0026\n-\t rxfh-\u003ehfunc != ETH_RSS_HASH_TOP))\n+\tif (rxfh-\u003ehfunc != ETH_RSS_HASH_NO_CHANGE \u0026\u0026\n+\t rxfh-\u003ehfunc != ETH_RSS_HASH_TOP)\n \t\treturn -EOPNOTSUPP;\n-\tif (!rxfh-\u003eindir)\n-\t\treturn 0;\n \n-\tnum_queues = adapter-\u003erss_queues;\n+\tif (rxfh-\u003eindir) {\n+\t\tnum_queues = adapter-\u003erss_queues;\n \n-\tswitch (hw-\u003emac.type) {\n-\tcase e1000_82576:\n-\t\t/* 82576 supports 2 RSS queues for SR-IOV */\n-\t\tif (adapter-\u003evfs_allocated_count)\n-\t\t\tnum_queues = 2;\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n+\t\tswitch (hw-\u003emac.type) {\n+\t\tcase e1000_82576:\n+\t\t\t/* 82576 supports 2 RSS queues for SR-IOV */\n+\t\t\tif (adapter-\u003evfs_allocated_count)\n+\t\t\t\tnum_queues = 2;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\t/* Verify user input. */\n+\t\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n+\t\t\tif (rxfh-\u003eindir[i] \u003e= num_queues)\n+\t\t\t\treturn -EINVAL;\n \n-\t/* Verify user input. */\n-\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n-\t\tif (rxfh-\u003eindir[i] \u003e= num_queues)\n-\t\t\treturn -EINVAL;\n \n+\t\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n+\t\t\tadapter-\u003erss_indir_tbl[i] = rxfh-\u003eindir[i];\n \n-\tfor (i = 0; i \u003c IGB_RETA_SIZE; i++)\n-\t\tadapter-\u003erss_indir_tbl[i] = rxfh-\u003eindir[i];\n+\t\tigb_write_rss_indir_tbl(adapter);\n+\t}\n \n-\tigb_write_rss_indir_tbl(adapter);\n+\tif (rxfh-\u003ekey) {\n+\t\tmemcpy(adapter-\u003erss_key, rxfh-\u003ekey, sizeof(adapter-\u003erss_key));\n+\t\tigb_write_rss_key(adapter);\n+\t}\n \n \treturn 0;\n }\n@@ -3483,6 +3515,7 @@ static const struct ethtool_ops igb_ethtool_ops = {\n \t.get_module_eeprom\t= igb_get_module_eeprom,\n \t.get_rxfh_indir_size\t= igb_get_rxfh_indir_size,\n \t.get_rxfh\t\t= igb_get_rxfh,\n+\t.get_rxfh_key_size\t= igb_get_rxfh_key_size,\n \t.set_rxfh\t\t= igb_set_rxfh,\n \t.get_rxfh_fields\t= igb_get_rxfh_fields,\n \t.set_rxfh_fields\t= igb_set_rxfh_fields,\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex a1e89a375744c1..d4a897a8c82c63 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -4048,6 +4048,9 @@ static int igb_sw_init(struct igb_adapter *adapter)\n \n \tpci_read_config_word(pdev, PCI_COMMAND, \u0026hw-\u003ebus.pci_cmd_word);\n \n+\t/* init RSS key */\n+\tnetdev_rss_key_fill(adapter-\u003erss_key, sizeof(adapter-\u003erss_key));\n+\n \t/* set default ring sizes */\n \tadapter-\u003etx_ring_count = IGB_DEFAULT_TXD;\n \tadapter-\u003erx_ring_count = IGB_DEFAULT_RXD;\n@@ -4522,11 +4525,8 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)\n \tstruct e1000_hw *hw = \u0026adapter-\u003ehw;\n \tu32 mrqc, rxcsum;\n \tu32 j, num_rx_queues;\n-\tu32 rss_key[10];\n \n-\tnetdev_rss_key_fill(rss_key, sizeof(rss_key));\n-\tfor (j = 0; j \u003c 10; j++)\n-\t\twr32(E1000_RSSRK(j), rss_key[j]);\n+\tigb_write_rss_key(adapter);\n \n \tnum_rx_queues = adapter-\u003erss_queues;\n \n@@ -8820,10 +8820,19 @@ static inline void igb_rx_hash(struct igb_ring *ring,\n \t\t\t union e1000_adv_rx_desc *rx_desc,\n \t\t\t struct sk_buff *skb)\n {\n-\tif (ring-\u003enetdev-\u003efeatures \u0026 NETIF_F_RXHASH)\n-\t\tskb_set_hash(skb,\n-\t\t\t le32_to_cpu(rx_desc-\u003ewb.lower.hi_dword.rss),\n-\t\t\t PKT_HASH_TYPE_L3);\n+\tu16 rss_type;\n+\n+\tif (!(ring-\u003enetdev-\u003efeatures \u0026 NETIF_F_RXHASH))\n+\t\treturn;\n+\n+\trss_type = le16_to_cpu(rx_desc-\u003ewb.lower.lo_dword.pkt_info) \u0026\n+\t\t E1000_RSS_TYPE_MASK;\n+\tif (!rss_type)\n+\t\treturn;\n+\n+\tskb_set_hash(skb, le32_to_cpu(rx_desc-\u003ewb.lower.hi_dword.rss),\n+\t\t (E1000_RSS_L4_TYPES_MASK \u0026 BIT(rss_type)) ?\n+\t\t PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3);\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 46d625b15f4487..17f213cc93e45d 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -30,6 +30,7 @@ void igc_ethtool_set_ops(struct net_device *);\n \n #define MAX_ETYPE_FILTER\t\t8\n #define IGC_RETA_SIZE\t\t\t128\n+#define IGC_RSS_KEY_SIZE\t\t40\n \n /* SDP support */\n #define IGC_N_EXTTS\t2\n@@ -302,6 +303,7 @@ struct igc_adapter {\n \tunsigned int nfc_rule_count;\n \n \tu8 rss_indir_tbl[IGC_RETA_SIZE];\n+\tu8 rss_key[IGC_RSS_KEY_SIZE];\n \n \tunsigned long link_check_timeout;\n \tstruct igc_info ei;\n@@ -361,6 +363,7 @@ unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter);\n void igc_set_flag_queue_pairs(struct igc_adapter *adapter,\n \t\t\t const u32 max_rss_queues);\n int igc_reinit_queues(struct igc_adapter *adapter);\n+void igc_write_rss_key(struct igc_adapter *adapter);\n void igc_write_rss_indir_tbl(struct igc_adapter *adapter);\n bool igc_has_link(struct igc_adapter *adapter);\n void igc_reset(struct igc_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c\nindex 1613b562d17c52..ab9120a3127f24 100644\n--- a/drivers/net/ethernet/intel/igc/igc_base.c\n+++ b/drivers/net/ethernet/intel/igc/igc_base.c\n@@ -114,11 +114,35 @@ static s32 igc_setup_copper_link_base(struct igc_hw *hw)\n \tu32 ctrl;\n \n \tctrl = rd32(IGC_CTRL);\n-\tctrl |= IGC_CTRL_SLU;\n-\tctrl \u0026= ~(IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX);\n-\twr32(IGC_CTRL, ctrl);\n-\n-\tret_val = igc_setup_copper_link(hw);\n+\tctrl \u0026= ~(IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX |\n+\t\t IGC_CTRL_SPEED_MASK | IGC_CTRL_FD);\n+\n+\tif (hw-\u003emac.autoneg_enabled) {\n+\t\tctrl |= IGC_CTRL_SLU;\n+\t\twr32(IGC_CTRL, ctrl);\n+\t\tret_val = igc_setup_copper_link(hw);\n+\t} else {\n+\t\tctrl |= IGC_CTRL_SLU | IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX;\n+\n+\t\tswitch (hw-\u003emac.forced_speed_duplex) {\n+\t\tcase IGC_FORCED_10H:\n+\t\t\tctrl |= IGC_CTRL_SPEED_10;\n+\t\t\tbreak;\n+\t\tcase IGC_FORCED_10F:\n+\t\t\tctrl |= IGC_CTRL_SPEED_10 | IGC_CTRL_FD;\n+\t\t\tbreak;\n+\t\tcase IGC_FORCED_100H:\n+\t\t\tctrl |= IGC_CTRL_SPEED_100;\n+\t\t\tbreak;\n+\t\tcase IGC_FORCED_100F:\n+\t\t\tctrl |= IGC_CTRL_SPEED_100 | IGC_CTRL_FD;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -IGC_ERR_CONFIG;\n+\t\t}\n+\t\twr32(IGC_CTRL, ctrl);\n+\t\tret_val = igc_setup_copper_link(hw);\n+\t}\n \n \treturn ret_val;\n }\n@@ -443,6 +467,7 @@ static const struct igc_phy_operations igc_phy_ops_base = {\n \t.reset\t\t\t= igc_phy_hw_reset,\n \t.read_reg\t\t= igc_read_phy_reg_gpy,\n \t.write_reg\t\t= igc_write_phy_reg_gpy,\n+\t.force_speed_duplex\t= igc_force_speed_duplex,\n };\n \n const struct igc_info igc_base_info = {\ndiff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h\nindex 9482ab11f050f7..3f504751c2d923 100644\n--- a/drivers/net/ethernet/intel/igc/igc_defines.h\n+++ b/drivers/net/ethernet/intel/igc/igc_defines.h\n@@ -129,10 +129,13 @@\n #define IGC_ERR_SWFW_SYNC\t\t13\n \n /* Device Control */\n+#define IGC_CTRL_FD\t\tBIT(0) /* Full Duplex */\n #define IGC_CTRL_RST\t\t0x04000000 /* Global reset */\n-\n #define IGC_CTRL_PHY_RST\t0x80000000 /* PHY Reset */\n #define IGC_CTRL_SLU\t\t0x00000040 /* Set link up (Force Link) */\n+#define IGC_CTRL_SPEED_MASK\tGENMASK(10, 8)\n+#define IGC_CTRL_SPEED_10\tFIELD_PREP(IGC_CTRL_SPEED_MASK, 0)\n+#define IGC_CTRL_SPEED_100\tFIELD_PREP(IGC_CTRL_SPEED_MASK, 1)\n #define IGC_CTRL_FRCSPD\t\t0x00000800 /* Force Speed */\n #define IGC_CTRL_FRCDPX\t\t0x00001000 /* Force Duplex */\n #define IGC_CTRL_VME\t\t0x40000000 /* IEEE VLAN mode enable */\n@@ -673,6 +676,10 @@\n #define IGC_GEN_POLL_TIMEOUT\t1920\n \n /* PHY Control Register */\n+#define MII_CR_SPEED_MASK\t(BIT(6) | BIT(13))\n+#define MII_CR_SPEED_10\t\t0x0000\t/* SSM=0, SSL=0: 10 Mb/s */\n+#define MII_CR_SPEED_100\tBIT(13)\t/* SSM=0, SSL=1: 100 Mb/s */\n+#define MII_CR_DUPLEX_EN\tBIT(8)\t/* 0 = Half Duplex, 1 = Full Duplex */\n #define MII_CR_RESTART_AUTO_NEG\t0x0200 /* Restart auto negotiation */\n #define MII_CR_POWER_DOWN\t0x0800 /* Power down */\n #define MII_CR_AUTO_NEG_EN\t0x1000 /* Auto Neg Enable */\ndiff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c\nindex 0122009bedd03e..89fe2788a565e0 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c\n@@ -1460,6 +1460,26 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev,\n \t}\n }\n \n+/**\n+ * igc_write_rss_key - Program the RSS key into device registers\n+ * @adapter: board private structure\n+ *\n+ * Write the RSS key stored in adapter-\u003erss_key to the IGC_RSSRK registers.\n+ * Each 32-bit chunk of the key is read using get_unaligned_le32() and written\n+ * to the appropriate register.\n+ */\n+void igc_write_rss_key(struct igc_adapter *adapter)\n+{\n+\tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n+\tu32 val;\n+\tint i;\n+\n+\tfor (i = 0; i \u003c IGC_RSS_KEY_SIZE / 4; i++) {\n+\t\tval = get_unaligned_le32(\u0026adapter-\u003erss_key[i * 4]);\n+\t\twr32(IGC_RSSRK(i), val);\n+\t}\n+}\n+\n void igc_write_rss_indir_tbl(struct igc_adapter *adapter)\n {\n \tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n@@ -1482,6 +1502,11 @@ void igc_write_rss_indir_tbl(struct igc_adapter *adapter)\n \t}\n }\n \n+static u32 igc_ethtool_get_rxfh_key_size(struct net_device *netdev)\n+{\n+\treturn IGC_RSS_KEY_SIZE;\n+}\n+\n static u32 igc_ethtool_get_rxfh_indir_size(struct net_device *netdev)\n {\n \treturn IGC_RETA_SIZE;\n@@ -1494,10 +1519,13 @@ static int igc_ethtool_get_rxfh(struct net_device *netdev,\n \tint i;\n \n \trxfh-\u003ehfunc = ETH_RSS_HASH_TOP;\n-\tif (!rxfh-\u003eindir)\n-\t\treturn 0;\n-\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n-\t\trxfh-\u003eindir[i] = adapter-\u003erss_indir_tbl[i];\n+\n+\tif (rxfh-\u003eindir)\n+\t\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n+\t\t\trxfh-\u003eindir[i] = adapter-\u003erss_indir_tbl[i];\n+\n+\tif (rxfh-\u003ekey)\n+\t\tmemcpy(rxfh-\u003ekey, adapter-\u003erss_key, sizeof(adapter-\u003erss_key));\n \n \treturn 0;\n }\n@@ -1511,24 +1539,28 @@ static int igc_ethtool_set_rxfh(struct net_device *netdev,\n \tint i;\n \n \t/* We do not allow change in unsupported parameters */\n-\tif (rxfh-\u003ekey ||\n-\t (rxfh-\u003ehfunc != ETH_RSS_HASH_NO_CHANGE \u0026\u0026\n-\t rxfh-\u003ehfunc != ETH_RSS_HASH_TOP))\n+\tif (rxfh-\u003ehfunc != ETH_RSS_HASH_NO_CHANGE \u0026\u0026\n+\t rxfh-\u003ehfunc != ETH_RSS_HASH_TOP)\n \t\treturn -EOPNOTSUPP;\n-\tif (!rxfh-\u003eindir)\n-\t\treturn 0;\n \n-\tnum_queues = adapter-\u003erss_queues;\n+\tif (rxfh-\u003eindir) {\n+\t\tnum_queues = adapter-\u003erss_queues;\n \n-\t/* Verify user input. */\n-\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n-\t\tif (rxfh-\u003eindir[i] \u003e= num_queues)\n-\t\t\treturn -EINVAL;\n+\t\t/* Verify user input. */\n+\t\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n+\t\t\tif (rxfh-\u003eindir[i] \u003e= num_queues)\n+\t\t\t\treturn -EINVAL;\n \n-\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n-\t\tadapter-\u003erss_indir_tbl[i] = rxfh-\u003eindir[i];\n+\t\tfor (i = 0; i \u003c IGC_RETA_SIZE; i++)\n+\t\t\tadapter-\u003erss_indir_tbl[i] = rxfh-\u003eindir[i];\n+\n+\t\tigc_write_rss_indir_tbl(adapter);\n+\t}\n \n-\tigc_write_rss_indir_tbl(adapter);\n+\tif (rxfh-\u003ekey) {\n+\t\tmemcpy(adapter-\u003erss_key, rxfh-\u003ekey, sizeof(adapter-\u003erss_key));\n+\t\tigc_write_rss_key(adapter);\n+\t}\n \n \treturn 0;\n }\n@@ -1914,44 +1946,58 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,\n \tethtool_link_ksettings_add_link_mode(cmd, supported, TP);\n \tethtool_link_ksettings_add_link_mode(cmd, advertising, TP);\n \n-\t/* advertising link modes */\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_10_HALF)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Half);\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_10_FULL)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Full);\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_100_HALF)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Half);\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_100_FULL)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Full);\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_1000_FULL)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 1000baseT_Full);\n-\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_2500_FULL)\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, 2500baseT_Full);\n-\n \t/* set autoneg settings */\n \tethtool_link_ksettings_add_link_mode(cmd, supported, Autoneg);\n-\tethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);\n+\tif (hw-\u003emac.autoneg_enabled) {\n+\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);\n+\t\tcmd-\u003ebase.autoneg = AUTONEG_ENABLE;\n+\n+\t\t/* advertising link modes only apply when autoneg is on */\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_10_HALF)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 10baseT_Half);\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_10_FULL)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 10baseT_Full);\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_100_HALF)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 100baseT_Half);\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_100_FULL)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 100baseT_Full);\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_1000_FULL)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 1000baseT_Full);\n+\t\tif (hw-\u003ephy.autoneg_advertised \u0026 ADVERTISE_2500_FULL)\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t 2500baseT_Full);\n+\n+\t\t/* Set pause flow control advertising */\n+\t\tswitch (hw-\u003efc.requested_mode) {\n+\t\tcase igc_fc_full:\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t Pause);\n+\t\t\tbreak;\n+\t\tcase igc_fc_rx_pause:\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t Pause);\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t Asym_Pause);\n+\t\t\tbreak;\n+\t\tcase igc_fc_tx_pause:\n+\t\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n+\t\t\t\t\t\t\t Asym_Pause);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t} else {\n+\t\tcmd-\u003ebase.autoneg = AUTONEG_DISABLE;\n+\t}\n \n-\t/* Set pause flow control settings */\n+\t/* Pause is always supported */\n \tethtool_link_ksettings_add_link_mode(cmd, supported, Pause);\n \n-\tswitch (hw-\u003efc.requested_mode) {\n-\tcase igc_fc_full:\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, Pause);\n-\t\tbreak;\n-\tcase igc_fc_rx_pause:\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising, Pause);\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n-\t\t\t\t\t\t Asym_Pause);\n-\t\tbreak;\n-\tcase igc_fc_tx_pause:\n-\t\tethtool_link_ksettings_add_link_mode(cmd, advertising,\n-\t\t\t\t\t\t Asym_Pause);\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n-\n \tstatus = pm_runtime_suspended(\u0026adapter-\u003epdev-\u003edev) ?\n \t\t 0 : rd32(IGC_STATUS);\n \n@@ -1983,7 +2029,6 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,\n \t\tcmd-\u003ebase.duplex = DUPLEX_UNKNOWN;\n \t}\n \tcmd-\u003ebase.speed = speed;\n-\tcmd-\u003ebase.autoneg = AUTONEG_ENABLE;\n \n \t/* MDI-X =\u003e 2; MDI =\u003e1; Invalid =\u003e0 */\n \tif (hw-\u003ephy.media_type == igc_media_type_copper)\n@@ -2000,37 +2045,50 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,\n \treturn 0;\n }\n \n-static int\n-igc_ethtool_set_link_ksettings(struct net_device *netdev,\n-\t\t\t const struct ethtool_link_ksettings *cmd)\n+/**\n+ * igc_handle_autoneg_disabled - Configure forced speed/duplex settings\n+ * @adapter: private driver structure\n+ * @speed: requested speed (must be SPEED_10 or SPEED_100)\n+ * @duplex: requested duplex\n+ *\n+ * Records forced speed/duplex when autoneg is disabled.\n+ * Caller must validate speed before calling this function.\n+ */\n+static void igc_handle_autoneg_disabled(struct igc_adapter *adapter, u32 speed,\n+\t\t\t\t\tu8 duplex)\n {\n-\tstruct igc_adapter *adapter = netdev_priv(netdev);\n-\tstruct net_device *dev = adapter-\u003enetdev;\n-\tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n-\tu16 advertised = 0;\n+\tstruct igc_mac_info *mac = \u0026adapter-\u003ehw.mac;\n \n-\t/* When adapter in resetting mode, autoneg/speed/duplex\n-\t * cannot be changed\n-\t */\n-\tif (igc_check_reset_block(hw)) {\n-\t\tnetdev_err(dev, \"Cannot change link characteristics when reset is active\\n\");\n-\t\treturn -EINVAL;\n+\tswitch (speed) {\n+\tcase SPEED_10:\n+\t\tmac-\u003eforced_speed_duplex = (duplex == DUPLEX_FULL) ?\n+\t\t\tIGC_FORCED_10F : IGC_FORCED_10H;\n+\t\tbreak;\n+\tcase SPEED_100:\n+\t\tmac-\u003eforced_speed_duplex = (duplex == DUPLEX_FULL) ?\n+\t\t\tIGC_FORCED_100F : IGC_FORCED_100H;\n+\t\tbreak;\n+\tdefault:\n+\t\tWARN_ONCE(1, \"Unsupported speed %u\\n\", speed);\n+\t\treturn;\n \t}\n \n-\t/* MDI setting is only allowed when autoneg enabled because\n-\t * some hardware doesn't allow MDI setting when speed or\n-\t * duplex is forced.\n-\t */\n-\tif (cmd-\u003ebase.eth_tp_mdix_ctrl) {\n-\t\tif (cmd-\u003ebase.eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO \u0026\u0026\n-\t\t cmd-\u003ebase.autoneg != AUTONEG_ENABLE) {\n-\t\t\tnetdev_err(dev, \"Forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\\n\");\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t}\n+\tmac-\u003eautoneg_enabled = false;\n+}\n \n-\twhile (test_and_set_bit(__IGC_RESETTING, \u0026adapter-\u003estate))\n-\t\tusleep_range(1000, 2000);\n+/**\n+ * igc_handle_autoneg_enabled - Configure autonegotiation advertisement\n+ * @adapter: private driver structure\n+ * @cmd: ethtool link ksettings from user\n+ *\n+ * Records advertised speeds and flow control settings when autoneg\n+ * is enabled.\n+ */\n+static void igc_handle_autoneg_enabled(struct igc_adapter *adapter,\n+\t\t\t\t const struct ethtool_link_ksettings *cmd)\n+{\n+\tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n+\tu16 advertised = 0;\n \n \tif (ethtool_link_ksettings_test_link_mode(cmd, advertising,\n \t\t\t\t\t\t 2500baseT_Full))\n@@ -2056,14 +2114,66 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,\n \t\t\t\t\t\t 10baseT_Half))\n \t\tadvertised |= ADVERTISE_10_HALF;\n \n-\tif (cmd-\u003ebase.autoneg == AUTONEG_ENABLE) {\n-\t\thw-\u003ephy.autoneg_advertised = advertised;\n-\t\tif (adapter-\u003efc_autoneg)\n-\t\t\thw-\u003efc.requested_mode = igc_fc_default;\n-\t} else {\n-\t\tnetdev_info(dev, \"Force mode currently not supported\\n\");\n+\thw-\u003emac.autoneg_enabled = true;\n+\thw-\u003ephy.autoneg_advertised = advertised;\n+\tif (adapter-\u003efc_autoneg)\n+\t\thw-\u003efc.requested_mode = igc_fc_default;\n+}\n+\n+static int\n+igc_ethtool_set_link_ksettings(struct net_device *netdev,\n+\t\t\t const struct ethtool_link_ksettings *cmd)\n+{\n+\tstruct igc_adapter *adapter = netdev_priv(netdev);\n+\tstruct net_device *dev = adapter-\u003enetdev;\n+\tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n+\n+\t/* When adapter in resetting mode, autoneg/speed/duplex\n+\t * cannot be changed\n+\t */\n+\tif (igc_check_reset_block(hw)) {\n+\t\tnetdev_err(dev, \"Cannot change link characteristics when reset is active\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (cmd-\u003ebase.autoneg != AUTONEG_ENABLE \u0026\u0026\n+\t cmd-\u003ebase.autoneg != AUTONEG_DISABLE) {\n+\t\tnetdev_info(dev, \"Unsupported autoneg setting\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* MDI setting is only allowed when autoneg enabled because\n+\t * some hardware doesn't allow MDI setting when speed or\n+\t * duplex is forced.\n+\t */\n+\tif (cmd-\u003ebase.eth_tp_mdix_ctrl) {\n+\t\tif (cmd-\u003ebase.eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO \u0026\u0026\n+\t\t cmd-\u003ebase.autoneg != AUTONEG_ENABLE) {\n+\t\t\tnetdev_err(dev, \"Forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t}\n \n+\tif (cmd-\u003ebase.autoneg == AUTONEG_DISABLE) {\n+\t\tif (cmd-\u003ebase.speed != SPEED_10 \u0026\u0026 cmd-\u003ebase.speed != SPEED_100) {\n+\t\t\tnetdev_info(dev, \"Unsupported speed for forced link\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tif (cmd-\u003ebase.duplex != DUPLEX_HALF \u0026\u0026 cmd-\u003ebase.duplex != DUPLEX_FULL) {\n+\t\t\tnetdev_info(dev, \"Duplex must be half or full for forced link\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\twhile (test_and_set_bit(__IGC_RESETTING, \u0026adapter-\u003estate))\n+\t\tusleep_range(1000, 2000);\n+\n+\tif (cmd-\u003ebase.autoneg == AUTONEG_ENABLE)\n+\t\tigc_handle_autoneg_enabled(adapter, cmd);\n+\telse\n+\t\tigc_handle_autoneg_disabled(adapter, cmd-\u003ebase.speed,\n+\t\t\t\t\t cmd-\u003ebase.duplex);\n+\n \t/* MDI-X =\u003e 2; MDI =\u003e 1; Auto =\u003e 3 */\n \tif (cmd-\u003ebase.eth_tp_mdix_ctrl) {\n \t\t/* fix up the value for auto (3 =\u003e 0) as zero is mapped\n@@ -2175,6 +2285,7 @@ static const struct ethtool_ops igc_ethtool_ops = {\n \t.get_rxnfc\t\t= igc_ethtool_get_rxnfc,\n \t.set_rxnfc\t\t= igc_ethtool_set_rxnfc,\n \t.get_rx_ring_count\t= igc_ethtool_get_rx_ring_count,\n+\t.get_rxfh_key_size\t= igc_ethtool_get_rxfh_key_size,\n \t.get_rxfh_indir_size\t= igc_ethtool_get_rxfh_indir_size,\n \t.get_rxfh\t\t= igc_ethtool_get_rxfh,\n \t.set_rxfh\t\t= igc_ethtool_set_rxfh,\ndiff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h\nindex be8a49a86d09f7..62aaee55668a5b 100644\n--- a/drivers/net/ethernet/intel/igc/igc_hw.h\n+++ b/drivers/net/ethernet/intel/igc/igc_hw.h\n@@ -73,6 +73,13 @@ struct igc_info {\n \n extern const struct igc_info igc_base_info;\n \n+enum igc_forced_speed_duplex {\n+\tIGC_FORCED_10H,\n+\tIGC_FORCED_10F,\n+\tIGC_FORCED_100H,\n+\tIGC_FORCED_100F,\n+};\n+\n struct igc_mac_info {\n \tstruct igc_mac_operations ops;\n \n@@ -92,8 +99,9 @@ struct igc_mac_info {\n \tbool asf_firmware_present;\n \tbool arc_subsystem_valid;\n \n-\tbool autoneg_failed;\n \tbool get_link_status;\n+\tbool autoneg_enabled;\n+\tenum igc_forced_speed_duplex forced_speed_duplex;\n };\n \n struct igc_nvm_operations {\ndiff --git a/drivers/net/ethernet/intel/igc/igc_mac.c b/drivers/net/ethernet/intel/igc/igc_mac.c\nindex 7ac6637f8db73b..d6f3f6618469d6 100644\n--- a/drivers/net/ethernet/intel/igc/igc_mac.c\n+++ b/drivers/net/ethernet/intel/igc/igc_mac.c\n@@ -438,26 +438,23 @@ void igc_config_collision_dist(struct igc_hw *hw)\n * Checks the status of auto-negotiation after link up to ensure that the\n * speed and duplex were not forced. If the link needed to be forced, then\n * flow control needs to be forced also. If auto-negotiation is enabled\n- * and did not fail, then we configure flow control based on our link\n- * partner.\n+ * then we configure flow control based on our link partner.\n */\n s32 igc_config_fc_after_link_up(struct igc_hw *hw)\n {\n \tu16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;\n-\tstruct igc_mac_info *mac = \u0026hw-\u003emac;\n \tu16 speed, duplex;\n \ts32 ret_val = 0;\n \n-\t/* Check for the case where we have fiber media and auto-neg failed\n-\t * so we had to force link. In this case, we need to force the\n-\t * configuration of the MAC to match the \"fc\" parameter.\n+\t/* Without autoneg, flow control capability is not exchanged with the\n+\t * link partner. IEEE 802.3 prohibits flow control in half-duplex mode.\n \t */\n-\tif (mac-\u003eautoneg_failed)\n-\t\tret_val = igc_force_mac_fc(hw);\n+\tif (!hw-\u003emac.autoneg_enabled) {\n+\t\tif (hw-\u003emac.forced_speed_duplex == IGC_FORCED_10H ||\n+\t\t hw-\u003emac.forced_speed_duplex == IGC_FORCED_100H)\n+\t\t\thw-\u003efc.current_mode = igc_fc_none;\n \n-\tif (ret_val) {\n-\t\thw_dbg(\"Error forcing flow control settings\\n\");\n-\t\tgoto out;\n+\t\tgoto force_fc;\n \t}\n \n \t/* In auto-neg, we need to check and see if Auto-Neg has completed,\n@@ -472,15 +469,15 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)\n \tret_val = hw-\u003ephy.ops.read_reg(hw, PHY_STATUS,\n \t\t\t\t \u0026mii_status_reg);\n \tif (ret_val)\n-\t\tgoto out;\n+\t\treturn ret_val;\n \tret_val = hw-\u003ephy.ops.read_reg(hw, PHY_STATUS,\n \t\t\t\t \u0026mii_status_reg);\n \tif (ret_val)\n-\t\tgoto out;\n+\t\treturn ret_val;\n \n \tif (!(mii_status_reg \u0026 MII_SR_AUTONEG_COMPLETE)) {\n \t\thw_dbg(\"Copper PHY and Auto Neg has not completed.\\n\");\n-\t\tgoto out;\n+\t\treturn ret_val;\n \t}\n \n \t/* The AutoNeg process has completed, so we now need to\n@@ -492,11 +489,11 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)\n \tret_val = hw-\u003ephy.ops.read_reg(hw, PHY_AUTONEG_ADV,\n \t\t\t\t \u0026mii_nway_adv_reg);\n \tif (ret_val)\n-\t\tgoto out;\n+\t\treturn ret_val;\n \tret_val = hw-\u003ephy.ops.read_reg(hw, PHY_LP_ABILITY,\n \t\t\t\t \u0026mii_nway_lp_ability_reg);\n \tif (ret_val)\n-\t\tgoto out;\n+\t\treturn ret_val;\n \t/* Two bits in the Auto Negotiation Advertisement Register\n \t * (Address 4) and two bits in the Auto Negotiation Base\n \t * Page Ability Register (Address 5) determine flow control\n@@ -612,7 +609,7 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)\n \tret_val = hw-\u003emac.ops.get_speed_and_duplex(hw, \u0026speed, \u0026duplex);\n \tif (ret_val) {\n \t\thw_dbg(\"Error getting link speed and duplex\\n\");\n-\t\tgoto out;\n+\t\treturn ret_val;\n \t}\n \n \tif (duplex == HALF_DUPLEX)\n@@ -621,13 +618,13 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)\n \t/* Now we call a subroutine to actually force the MAC\n \t * controller to use the correct flow control settings.\n \t */\n+force_fc:\n \tret_val = igc_force_mac_fc(hw);\n \tif (ret_val) {\n \t\thw_dbg(\"Error forcing flow control settings\\n\");\n-\t\tgoto out;\n+\t\treturn ret_val;\n \t}\n \n-out:\n \treturn ret_val;\n }\n \ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex 2c9e2dfd84991e..e6e9441fc3d4e6 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -785,11 +785,8 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)\n \tstruct igc_hw *hw = \u0026adapter-\u003ehw;\n \tu32 j, num_rx_queues;\n \tu32 mrqc, rxcsum;\n-\tu32 rss_key[10];\n \n-\tnetdev_rss_key_fill(rss_key, sizeof(rss_key));\n-\tfor (j = 0; j \u003c 10; j++)\n-\t\twr32(IGC_RSSRK(j), rss_key[j]);\n+\tigc_write_rss_key(adapter);\n \n \tnum_rx_queues = adapter-\u003erss_queues;\n \n@@ -5048,6 +5045,9 @@ static int igc_sw_init(struct igc_adapter *adapter)\n \n \tpci_read_config_word(pdev, PCI_COMMAND, \u0026hw-\u003ebus.pci_cmd_word);\n \n+\t/* init RSS key */\n+\tnetdev_rss_key_fill(adapter-\u003erss_key, sizeof(adapter-\u003erss_key));\n+\n \t/* set default ring sizes */\n \tadapter-\u003etx_ring_count = IGC_DEFAULT_TXD;\n \tadapter-\u003erx_ring_count = IGC_DEFAULT_RXD;\n@@ -7298,7 +7298,7 @@ static int igc_probe(struct pci_dev *pdev,\n \t/* Initialize link properties that are user-changeable */\n \tadapter-\u003efc_autoneg = true;\n \thw-\u003ephy.autoneg_advertised = 0xaf;\n-\n+\thw-\u003emac.autoneg_enabled = true;\n \thw-\u003efc.requested_mode = igc_fc_default;\n \thw-\u003efc.current_mode = igc_fc_default;\n \ndiff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c\nindex 6c4d204aecfaed..4cf737fb3b21e9 100644\n--- a/drivers/net/ethernet/intel/igc/igc_phy.c\n+++ b/drivers/net/ethernet/intel/igc/igc_phy.c\n@@ -494,12 +494,20 @@ s32 igc_setup_copper_link(struct igc_hw *hw)\n \ts32 ret_val = 0;\n \tbool link;\n \n-\t/* Setup autoneg and flow control advertisement and perform\n-\t * autonegotiation.\n-\t */\n-\tret_val = igc_copper_link_autoneg(hw);\n-\tif (ret_val)\n-\t\tgoto out;\n+\tif (hw-\u003emac.autoneg_enabled) {\n+\t\t/* Setup autoneg and flow control advertisement and perform\n+\t\t * autonegotiation.\n+\t\t */\n+\t\tret_val = igc_copper_link_autoneg(hw);\n+\t\tif (ret_val)\n+\t\t\tgoto out;\n+\t} else {\n+\t\tret_val = hw-\u003ephy.ops.force_speed_duplex(hw);\n+\t\tif (ret_val) {\n+\t\t\thw_dbg(\"Error Forcing Speed/Duplex\\n\");\n+\t\t\tgoto out;\n+\t\t}\n+\t}\n \n \t/* Check link status. Wait up to 100 microseconds for link to become\n \t * valid.\n@@ -778,3 +786,48 @@ u16 igc_read_phy_fw_version(struct igc_hw *hw)\n \n \treturn gphy_version;\n }\n+\n+/**\n+ * igc_force_speed_duplex - Force PHY speed and duplex settings\n+ * @hw: pointer to the HW structure\n+ *\n+ * Programs the GPY PHY control register to disable autonegotiation\n+ * and force the speed/duplex indicated by hw-\u003emac.forced_speed_duplex.\n+ */\n+s32 igc_force_speed_duplex(struct igc_hw *hw)\n+{\n+\tstruct igc_phy_info *phy = \u0026hw-\u003ephy;\n+\tu16 phy_ctrl;\n+\ts32 ret_val;\n+\n+\tret_val = phy-\u003eops.read_reg(hw, PHY_CONTROL, \u0026phy_ctrl);\n+\tif (ret_val)\n+\t\treturn ret_val;\n+\n+\tphy_ctrl \u0026= ~(MII_CR_SPEED_MASK | MII_CR_DUPLEX_EN |\n+\t\t MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG);\n+\n+\tswitch (hw-\u003emac.forced_speed_duplex) {\n+\tcase IGC_FORCED_10H:\n+\t\tphy_ctrl |= MII_CR_SPEED_10;\n+\t\tbreak;\n+\tcase IGC_FORCED_10F:\n+\t\tphy_ctrl |= MII_CR_SPEED_10 | MII_CR_DUPLEX_EN;\n+\t\tbreak;\n+\tcase IGC_FORCED_100H:\n+\t\tphy_ctrl |= MII_CR_SPEED_100;\n+\t\tbreak;\n+\tcase IGC_FORCED_100F:\n+\t\tphy_ctrl |= MII_CR_SPEED_100 | MII_CR_DUPLEX_EN;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -IGC_ERR_CONFIG;\n+\t}\n+\n+\tret_val = phy-\u003eops.write_reg(hw, PHY_CONTROL, phy_ctrl);\n+\tif (ret_val)\n+\t\treturn ret_val;\n+\n+\thw-\u003emac.get_link_status = true;\n+\treturn 0;\n+}\ndiff --git a/drivers/net/ethernet/intel/igc/igc_phy.h b/drivers/net/ethernet/intel/igc/igc_phy.h\nindex 832a7e359f186d..d37a89174826f0 100644\n--- a/drivers/net/ethernet/intel/igc/igc_phy.h\n+++ b/drivers/net/ethernet/intel/igc/igc_phy.h\n@@ -18,5 +18,6 @@ void igc_power_down_phy_copper(struct igc_hw *hw);\n s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data);\n s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data);\n u16 igc_read_phy_fw_version(struct igc_hw *hw);\n+s32 igc_force_speed_duplex(struct igc_hw *hw);\n \n #endif\n"
} |
| 2/1 | 2026/07/02 02:59 | agent | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"IGB",
"IGC"
],
"FocusSymbols": [
"igb_set_rxfh",
"igb_write_rss_key",
"igc_ethtool_set_rxfh",
"igc_write_rss_key",
"igc_ethtool_set_link_ksettings",
"igc_handle_autoneg_disabled",
"igc_handle_autoneg_enabled",
"igc_force_speed_duplex"
],
"Reasoning": "The patch implements RSS key configuration via ethtool for the igb and igc drivers, and adds support for forcing speed/duplex settings when autonegotiation is disabled in the igc driver. The igb driver is supported by QEMU and can be fuzzed.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 7fc3c1348ba04010da85bec2ea62723e1d3d585f
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Jul 2 02:59:03 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.h b/drivers/net/ethernet/intel/igb/e1000_82575.h
index 63ec253ac7885b..9e696d55e51282 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.h
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.h
@@ -87,6 +87,27 @@ union e1000_adv_rx_desc {
} wb; /* writeback */
};
+#define E1000_RSS_TYPE_NO_HASH 0
+#define E1000_RSS_TYPE_HASH_TCP_IPV4 1
+#define E1000_RSS_TYPE_HASH_IPV4 2
+#define E1000_RSS_TYPE_HASH_TCP_IPV6 3
+#define E1000_RSS_TYPE_HASH_IPV6_EX 4
+#define E1000_RSS_TYPE_HASH_IPV6 5
+#define E1000_RSS_TYPE_HASH_TCP_IPV6_EX 6
+#define E1000_RSS_TYPE_HASH_UDP_IPV4 7
+#define E1000_RSS_TYPE_HASH_UDP_IPV6 8
+#define E1000_RSS_TYPE_HASH_UDP_IPV6_EX 9
+
+#define E1000_RSS_TYPE_MASK GENMASK(3, 0)
+
+#define E1000_RSS_L4_TYPES_MASK \
+ (BIT(E1000_RSS_TYPE_HASH_TCP_IPV4) | \
+ BIT(E1000_RSS_TYPE_HASH_TCP_IPV6) | \
+ BIT(E1000_RSS_TYPE_HASH_TCP_IPV6_EX) | \
+ BIT(E1000_RSS_TYPE_HASH_UDP_IPV4) | \
+ BIT(E1000_RSS_TYPE_HASH_UDP_IPV6) | \
+ BIT(E1000_RSS_TYPE_HASH_UDP_IPV6_EX))
+
#define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
#define E1000_RXDADV_HDRBUFLEN_SHIFT 5
#define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 0fff1df81b7bd6..8c9b02058cecb0 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -495,6 +495,7 @@ struct hwmon_buff {
#define IGB_N_PEROUT 2
#define IGB_N_SDP 4
#define IGB_RETA_SIZE 128
+#define IGB_RSS_KEY_SIZE 40
enum igb_filter_match_flags {
IGB_FILTER_FLAG_ETHER_TYPE = 0x1,
@@ -655,6 +656,7 @@ struct igb_adapter {
struct i2c_client *i2c_client;
u32 rss_indir_tbl_init;
u8 rss_indir_tbl[IGB_RETA_SIZE];
+ u8 rss_key[IGB_RSS_KEY_SIZE];
unsigned long link_check_timeout;
int copper_tries;
@@ -735,6 +737,7 @@ void igb_down(struct igb_adapter *);
void igb_reinit_locked(struct igb_adapter *);
void igb_reset(struct igb_adapter *);
int igb_reinit_queues(struct igb_adapter *);
+void igb_write_rss_key(struct igb_adapter *adapter);
void igb_write_rss_indir_tbl(struct igb_adapter *);
int igb_set_spd_dplx(struct igb_adapter *, u32, u8);
int igb_setup_tx_resources(struct igb_ring *);
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index f7938c1da835fc..65014a54a6d11c 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -3019,6 +3019,27 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
return ret;
}
+/**
+ * igb_write_rss_key - Program the RSS key into device registers
+ * @adapter: board private structure
+ *
+ * Write the RSS key stored in adapter->rss_key to the E1000 hardware registers.
+ * Each 32-bit chunk of the key is read using get_unaligned_le32() and written
+ * to the appropriate register.
+ */
+void igb_write_rss_key(struct igb_adapter *adapter)
+{
+ struct e1000_hw *hw = &adapter->hw;
+
+ ASSERT_RTNL();
+
+ for (int i = 0; i < IGB_RSS_KEY_SIZE / 4; i++) {
+ u32 val = get_unaligned_le32(&adapter->rss_key[i * 4]);
+
+ wr32(E1000_RSSRK(i), val);
+ }
+}
+
static int igb_get_eee(struct net_device *netdev, struct ethtool_keee *edata)
{
struct igb_adapter *adapter = netdev_priv(netdev);
@@ -3276,10 +3297,12 @@ static int igb_get_rxfh(struct net_device *netdev,
int i;
rxfh->hfunc = ETH_RSS_HASH_TOP;
- if (!rxfh->indir)
- return 0;
- for (i = 0; i < IGB_RETA_SIZE; i++)
- rxfh->indir[i] = adapter->rss_indir_tbl[i];
+ if (rxfh->indir)
+ for (i = 0; i < IGB_RETA_SIZE; i++)
+ rxfh->indir[i] = adapter->rss_indir_tbl[i];
+
+ if (rxfh->key)
+ memcpy(rxfh->key, adapter->rss_key, sizeof(adapter->rss_key));
return 0;
}
@@ -3319,6 +3342,11 @@ void igb_write_rss_indir_tbl(struct igb_adapter *adapter)
}
}
+static u32 igb_get_rxfh_key_size(struct net_device *netdev)
+{
+ return IGB_RSS_KEY_SIZE;
+}
+
static int igb_set_rxfh(struct net_device *netdev,
struct ethtool_rxfh_param *rxfh,
struct netlink_ext_ack *extack)
@@ -3329,35 +3357,39 @@ static int igb_set_rxfh(struct net_device *netdev,
u32 num_queues;
/* We do not allow change in unsupported parameters */
- if (rxfh->key ||
- (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
- rxfh->hfunc != ETH_RSS_HASH_TOP))
+ if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
+ rxfh->hfunc != ETH_RSS_HASH_TOP)
return -EOPNOTSUPP;
- if (!rxfh->indir)
- return 0;
- num_queues = adapter->rss_queues;
+ if (rxfh->indir) {
+ num_queues = adapter->rss_queues;
- switch (hw->mac.type) {
- case e1000_82576:
- /* 82576 supports 2 RSS queues for SR-IOV */
- if (adapter->vfs_allocated_count)
- num_queues = 2;
- break;
- default:
- break;
- }
+ switch (hw->mac.type) {
+ case e1000_82576:
+ /* 82576 supports 2 RSS queues for SR-IOV */
+ if (adapter->vfs_allocated_count)
+ num_queues = 2;
+ break;
+ default:
+ break;
+ }
+
+ /* Verify user input. */
+ for (i = 0; i < IGB_RETA_SIZE; i++)
+ if (rxfh->indir[i] >= num_queues)
+ return -EINVAL;
- /* Verify user input. */
- for (i = 0; i < IGB_RETA_SIZE; i++)
- if (rxfh->indir[i] >= num_queues)
- return -EINVAL;
+ for (i = 0; i < IGB_RETA_SIZE; i++)
+ adapter->rss_indir_tbl[i] = rxfh->indir[i];
- for (i = 0; i < IGB_RETA_SIZE; i++)
- adapter->rss_indir_tbl[i] = rxfh->indir[i];
+ igb_write_rss_indir_tbl(adapter);
+ }
- igb_write_rss_indir_tbl(adapter);
+ if (rxfh->key) {
+ memcpy(adapter->rss_key, rxfh->key, sizeof(adapter->rss_key));
+ igb_write_rss_key(adapter);
+ }
return 0;
}
@@ -3483,6 +3515,7 @@ static const struct ethtool_ops igb_ethtool_ops = {
.get_module_eeprom = igb_get_module_eeprom,
.get_rxfh_indir_size = igb_get_rxfh_indir_size,
.get_rxfh = igb_get_rxfh,
+ .get_rxfh_key_size = igb_get_rxfh_key_size,
.set_rxfh = igb_set_rxfh,
.get_rxfh_fields = igb_get_rxfh_fields,
.set_rxfh_fields = igb_set_rxfh_fields,
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a1e89a375744c1..d4a897a8c82c63 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4048,6 +4048,9 @@ static int igb_sw_init(struct igb_adapter *adapter)
pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word);
+ /* init RSS key */
+ netdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key));
+
/* set default ring sizes */
adapter->tx_ring_count = IGB_DEFAULT_TXD;
adapter->rx_ring_count = IGB_DEFAULT_RXD;
@@ -4522,11 +4525,8 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
struct e1000_hw *hw = &adapter->hw;
u32 mrqc, rxcsum;
u32 j, num_rx_queues;
- u32 rss_key[10];
- netdev_rss_key_fill(rss_key, sizeof(rss_key));
- for (j = 0; j < 10; j++)
- wr32(E1000_RSSRK(j), rss_key[j]);
+ igb_write_rss_key(adapter);
num_rx_queues = adapter->rss_queues;
@@ -8820,10 +8820,19 @@ static inline void igb_rx_hash(struct igb_ring *ring,
union e1000_adv_rx_desc *rx_desc,
struct sk_buff *skb)
{
- if (ring->netdev->features & NETIF_F_RXHASH)
- skb_set_hash(skb,
- le32_to_cpu(rx_desc->wb.lower.hi_dword.rss),
- PKT_HASH_TYPE_L3);
+ u16 rss_type;
+
+ if (!(ring->netdev->features & NETIF_F_RXHASH))
+ return;
+
+ rss_type = le16_to_cpu(rx_desc->wb.lower.lo_dword.pkt_info) &
+ E1000_RSS_TYPE_MASK;
+ if (!rss_type)
+ return;
+
+ skb_set_hash(skb, le32_to_cpu(rx_desc->wb.lower.hi_dword.rss),
+ (E1000_RSS_L4_TYPES_MASK & BIT(rss_type)) ?
+ PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3);
}
/**
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 46d625b15f4487..17f213cc93e45d 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -30,6 +30,7 @@ void igc_ethtool_set_ops(struct net_device *);
#define MAX_ETYPE_FILTER 8
#define IGC_RETA_SIZE 128
+#define IGC_RSS_KEY_SIZE 40
/* SDP support */
#define IGC_N_EXTTS 2
@@ -302,6 +303,7 @@ struct igc_adapter {
unsigned int nfc_rule_count;
u8 rss_indir_tbl[IGC_RETA_SIZE];
+ u8 rss_key[IGC_RSS_KEY_SIZE];
unsigned long link_check_timeout;
struct igc_info ei;
@@ -361,6 +363,7 @@ unsigned int igc_get_max_rss_queues(struct igc_adapter *adapter);
void igc_set_flag_queue_pairs(struct igc_adapter *adapter,
const u32 max_rss_queues);
int igc_reinit_queues(struct igc_adapter *adapter);
+void igc_write_rss_key(struct igc_adapter *adapter);
void igc_write_rss_indir_tbl(struct igc_adapter *adapter);
bool igc_has_link(struct igc_adapter *adapter);
void igc_reset(struct igc_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
index 1613b562d17c52..ab9120a3127f24 100644
--- a/drivers/net/ethernet/intel/igc/igc_base.c
+++ b/drivers/net/ethernet/intel/igc/igc_base.c
@@ -114,11 +114,35 @@ static s32 igc_setup_copper_link_base(struct igc_hw *hw)
u32 ctrl;
ctrl = rd32(IGC_CTRL);
- ctrl |= IGC_CTRL_SLU;
- ctrl &= ~(IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX);
- wr32(IGC_CTRL, ctrl);
-
- ret_val = igc_setup_copper_link(hw);
+ ctrl &= ~(IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX |
+ IGC_CTRL_SPEED_MASK | IGC_CTRL_FD);
+
+ if (hw->mac.autoneg_enabled) {
+ ctrl |= IGC_CTRL_SLU;
+ wr32(IGC_CTRL, ctrl);
+ ret_val = igc_setup_copper_link(hw);
+ } else {
+ ctrl |= IGC_CTRL_SLU | IGC_CTRL_FRCSPD | IGC_CTRL_FRCDPX;
+
+ switch (hw->mac.forced_speed_duplex) {
+ case IGC_FORCED_10H:
+ ctrl |= IGC_CTRL_SPEED_10;
+ break;
+ case IGC_FORCED_10F:
+ ctrl |= IGC_CTRL_SPEED_10 | IGC_CTRL_FD;
+ break;
+ case IGC_FORCED_100H:
+ ctrl |= IGC_CTRL_SPEED_100;
+ break;
+ case IGC_FORCED_100F:
+ ctrl |= IGC_CTRL_SPEED_100 | IGC_CTRL_FD;
+ break;
+ default:
+ return -IGC_ERR_CONFIG;
+ }
+ wr32(IGC_CTRL, ctrl);
+ ret_val = igc_setup_copper_link(hw);
+ }
return ret_val;
}
@@ -443,6 +467,7 @@ static const struct igc_phy_operations igc_phy_ops_base = {
.reset = igc_phy_hw_reset,
.read_reg = igc_read_phy_reg_gpy,
.write_reg = igc_write_phy_reg_gpy,
+ .force_speed_duplex = igc_force_speed_duplex,
};
const struct igc_info igc_base_info = {
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index 9482ab11f050f7..3f504751c2d923 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -129,10 +129,13 @@
#define IGC_ERR_SWFW_SYNC 13
/* Device Control */
+#define IGC_CTRL_FD BIT(0) /* Full Duplex */
#define IGC_CTRL_RST 0x04000000 /* Global reset */
-
#define IGC_CTRL_PHY_RST 0x80000000 /* PHY Reset */
#define IGC_CTRL_SLU 0x00000040 /* Set link up (Force Link) */
+#define IGC_CTRL_SPEED_MASK GENMASK(10, 8)
+#define IGC_CTRL_SPEED_10 FIELD_PREP(IGC_CTRL_SPEED_MASK, 0)
+#define IGC_CTRL_SPEED_100 FIELD_PREP(IGC_CTRL_SPEED_MASK, 1)
#define IGC_CTRL_FRCSPD 0x00000800 /* Force Speed */
#define IGC_CTRL_FRCDPX 0x00001000 /* Force Duplex */
#define IGC_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */
@@ -673,6 +676,10 @@
#define IGC_GEN_POLL_TIMEOUT 1920
/* PHY Control Register */
+#define MII_CR_SPEED_MASK (BIT(6) | BIT(13))
+#define MII_CR_SPEED_10 0x0000 /* SSM=0, SSL=0: 10 Mb/s */
+#define MII_CR_SPEED_100 BIT(13) /* SSM=0, SSL=1: 100 Mb/s */
+#define MII_CR_DUPLEX_EN BIT(8) /* 0 = Half Duplex, 1 = Full Duplex */
#define MII_CR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */
#define MII_CR_POWER_DOWN 0x0800 /* Power down */
#define MII_CR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 0122009bedd03e..89fe2788a565e0 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1460,6 +1460,26 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev,
}
}
+/**
+ * igc_write_rss_key - Program the RSS key into device registers
+ * @adapter: board private structure
+ *
+ * Write the RSS key stored in adapter->rss_key to the IGC_RSSRK registers.
+ * Each 32-bit chunk of the key is read using get_unaligned_le32() and written
+ * to the appropriate register.
+ */
+void igc_write_rss_key(struct igc_adapter *adapter)
+{
+ struct igc_hw *hw = &adapter->hw;
+ u32 val;
+ int i;
+
+ for (i = 0; i < IGC_RSS_KEY_SIZE / 4; i++) {
+ val = get_unaligned_le32(&adapter->rss_key[i * 4]);
+ wr32(IGC_RSSRK(i), val);
+ }
+}
+
void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
{
struct igc_hw *hw = &adapter->hw;
@@ -1482,6 +1502,11 @@ void igc_write_rss_indir_tbl(struct igc_adapter *adapter)
}
}
+static u32 igc_ethtool_get_rxfh_key_size(struct net_device *netdev)
+{
+ return IGC_RSS_KEY_SIZE;
+}
+
static u32 igc_ethtool_get_rxfh_indir_size(struct net_device *netdev)
{
return IGC_RETA_SIZE;
@@ -1494,10 +1519,13 @@ static int igc_ethtool_get_rxfh(struct net_device *netdev,
int i;
rxfh->hfunc = ETH_RSS_HASH_TOP;
- if (!rxfh->indir)
- return 0;
- for (i = 0; i < IGC_RETA_SIZE; i++)
- rxfh->indir[i] = adapter->rss_indir_tbl[i];
+
+ if (rxfh->indir)
+ for (i = 0; i < IGC_RETA_SIZE; i++)
+ rxfh->indir[i] = adapter->rss_indir_tbl[i];
+
+ if (rxfh->key)
+ memcpy(rxfh->key, adapter->rss_key, sizeof(adapter->rss_key));
return 0;
}
@@ -1511,24 +1539,28 @@ static int igc_ethtool_set_rxfh(struct net_device *netdev,
int i;
/* We do not allow change in unsupported parameters */
- if (rxfh->key ||
- (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
- rxfh->hfunc != ETH_RSS_HASH_TOP))
+ if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
+ rxfh->hfunc != ETH_RSS_HASH_TOP)
return -EOPNOTSUPP;
- if (!rxfh->indir)
- return 0;
- num_queues = adapter->rss_queues;
+ if (rxfh->indir) {
+ num_queues = adapter->rss_queues;
- /* Verify user input. */
- for (i = 0; i < IGC_RETA_SIZE; i++)
- if (rxfh->indir[i] >= num_queues)
- return -EINVAL;
+ /* Verify user input. */
+ for (i = 0; i < IGC_RETA_SIZE; i++)
+ if (rxfh->indir[i] >= num_queues)
+ return -EINVAL;
- for (i = 0; i < IGC_RETA_SIZE; i++)
- adapter->rss_indir_tbl[i] = rxfh->indir[i];
+ for (i = 0; i < IGC_RETA_SIZE; i++)
+ adapter->rss_indir_tbl[i] = rxfh->indir[i];
+
+ igc_write_rss_indir_tbl(adapter);
+ }
- igc_write_rss_indir_tbl(adapter);
+ if (rxfh->key) {
+ memcpy(adapter->rss_key, rxfh->key, sizeof(adapter->rss_key));
+ igc_write_rss_key(adapter);
+ }
return 0;
}
@@ -1914,44 +1946,58 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,
ethtool_link_ksettings_add_link_mode(cmd, supported, TP);
ethtool_link_ksettings_add_link_mode(cmd, advertising, TP);
- /* advertising link modes */
- if (hw->phy.autoneg_advertised & ADVERTISE_10_HALF)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Half);
- if (hw->phy.autoneg_advertised & ADVERTISE_10_FULL)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Full);
- if (hw->phy.autoneg_advertised & ADVERTISE_100_HALF)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Half);
- if (hw->phy.autoneg_advertised & ADVERTISE_100_FULL)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 100baseT_Full);
- if (hw->phy.autoneg_advertised & ADVERTISE_1000_FULL)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 1000baseT_Full);
- if (hw->phy.autoneg_advertised & ADVERTISE_2500_FULL)
- ethtool_link_ksettings_add_link_mode(cmd, advertising, 2500baseT_Full);
-
/* set autoneg settings */
ethtool_link_ksettings_add_link_mode(cmd, supported, Autoneg);
- ethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);
+ if (hw->mac.autoneg_enabled) {
+ ethtool_link_ksettings_add_link_mode(cmd, advertising, Autoneg);
+ cmd->base.autoneg = AUTONEG_ENABLE;
+
+ /* advertising link modes only apply when autoneg is on */
+ if (hw->phy.autoneg_advertised & ADVERTISE_10_HALF)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 10baseT_Half);
+ if (hw->phy.autoneg_advertised & ADVERTISE_10_FULL)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 10baseT_Full);
+ if (hw->phy.autoneg_advertised & ADVERTISE_100_HALF)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 100baseT_Half);
+ if (hw->phy.autoneg_advertised & ADVERTISE_100_FULL)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 100baseT_Full);
+ if (hw->phy.autoneg_advertised & ADVERTISE_1000_FULL)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 1000baseT_Full);
+ if (hw->phy.autoneg_advertised & ADVERTISE_2500_FULL)
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ 2500baseT_Full);
+
+ /* Set pause flow control advertising */
+ switch (hw->fc.requested_mode) {
+ case igc_fc_full:
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ Pause);
+ break;
+ case igc_fc_rx_pause:
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ Pause);
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ Asym_Pause);
+ break;
+ case igc_fc_tx_pause:
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
+ Asym_Pause);
+ break;
+ default:
+ break;
+ }
+ } else {
+ cmd->base.autoneg = AUTONEG_DISABLE;
+ }
- /* Set pause flow control settings */
+ /* Pause is always supported */
ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
- switch (hw->fc.requested_mode) {
- case igc_fc_full:
- ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause);
- break;
- case igc_fc_rx_pause:
- ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause);
- ethtool_link_ksettings_add_link_mode(cmd, advertising,
- Asym_Pause);
- break;
- case igc_fc_tx_pause:
- ethtool_link_ksettings_add_link_mode(cmd, advertising,
- Asym_Pause);
- break;
- default:
- break;
- }
-
status = pm_runtime_suspended(&adapter->pdev->dev) ?
0 : rd32(IGC_STATUS);
@@ -1983,7 +2029,6 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,
cmd->base.duplex = DUPLEX_UNKNOWN;
}
cmd->base.speed = speed;
- cmd->base.autoneg = AUTONEG_ENABLE;
/* MDI-X => 2; MDI =>1; Invalid =>0 */
if (hw->phy.media_type == igc_media_type_copper)
@@ -2000,37 +2045,50 @@ static int igc_ethtool_get_link_ksettings(struct net_device *netdev,
return 0;
}
-static int
-igc_ethtool_set_link_ksettings(struct net_device *netdev,
- const struct ethtool_link_ksettings *cmd)
+/**
+ * igc_handle_autoneg_disabled - Configure forced speed/duplex settings
+ * @adapter: private driver structure
+ * @speed: requested speed (must be SPEED_10 or SPEED_100)
+ * @duplex: requested duplex
+ *
+ * Records forced speed/duplex when autoneg is disabled.
+ * Caller must validate speed before calling this function.
+ */
+static void igc_handle_autoneg_disabled(struct igc_adapter *adapter, u32 speed,
+ u8 duplex)
{
- struct igc_adapter *adapter = netdev_priv(netdev);
- struct net_device *dev = adapter->netdev;
- struct igc_hw *hw = &adapter->hw;
- u16 advertised = 0;
+ struct igc_mac_info *mac = &adapter->hw.mac;
- /* When adapter in resetting mode, autoneg/speed/duplex
- * cannot be changed
- */
- if (igc_check_reset_block(hw)) {
- netdev_err(dev, "Cannot change link characteristics when reset is active\n");
- return -EINVAL;
+ switch (speed) {
+ case SPEED_10:
+ mac->forced_speed_duplex = (duplex == DUPLEX_FULL) ?
+ IGC_FORCED_10F : IGC_FORCED_10H;
+ break;
+ case SPEED_100:
+ mac->forced_speed_duplex = (duplex == DUPLEX_FULL) ?
+ IGC_FORCED_100F : IGC_FORCED_100H;
+ break;
+ default:
+ WARN_ONCE(1, "Unsupported speed %u\n", speed);
+ return;
}
- /* MDI setting is only allowed when autoneg enabled because
- * some hardware doesn't allow MDI setting when speed or
- * duplex is forced.
- */
- if (cmd->base.eth_tp_mdix_ctrl) {
- if (cmd->base.eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO &&
- cmd->base.autoneg != AUTONEG_ENABLE) {
- netdev_err(dev, "Forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n");
- return -EINVAL;
- }
- }
+ mac->autoneg_enabled = false;
+}
- while (test_and_set_bit(__IGC_RESETTING, &adapter->state))
- usleep_range(1000, 2000);
+/**
+ * igc_handle_autoneg_enabled - Configure autonegotiation advertisement
+ * @adapter: private driver structure
+ * @cmd: ethtool link ksettings from user
+ *
+ * Records advertised speeds and flow control settings when autoneg
+ * is enabled.
+ */
+static void igc_handle_autoneg_enabled(struct igc_adapter *adapter,
+ const struct ethtool_link_ksettings *cmd)
+{
+ struct igc_hw *hw = &adapter->hw;
+ u16 advertised = 0;
if (ethtool_link_ksettings_test_link_mode(cmd, advertising,
2500baseT_Full))
@@ -2056,14 +2114,66 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,
10baseT_Half))
advertised |= ADVERTISE_10_HALF;
- if (cmd->base.autoneg == AUTONEG_ENABLE) {
- hw->phy.autoneg_advertised = advertised;
- if (adapter->fc_autoneg)
- hw->fc.requested_mode = igc_fc_default;
- } else {
- netdev_info(dev, "Force mode currently not supported\n");
+ hw->mac.autoneg_enabled = true;
+ hw->phy.autoneg_advertised = advertised;
+ if (adapter->fc_autoneg)
+ hw->fc.requested_mode = igc_fc_default;
+}
+
+static int
+igc_ethtool_set_link_ksettings(struct net_device *netdev,
+ const struct ethtool_link_ksettings *cmd)
+{
+ struct igc_adapter *adapter = netdev_priv(netdev);
+ struct net_device *dev = adapter->netdev;
+ struct igc_hw *hw = &adapter->hw;
+
+ /* When adapter in resetting mode, autoneg/speed/duplex
+ * cannot be changed
+ */
+ if (igc_check_reset_block(hw)) {
+ netdev_err(dev, "Cannot change link characteristics when reset is active\n");
+ return -EINVAL;
+ }
+
+ if (cmd->base.autoneg != AUTONEG_ENABLE &&
+ cmd->base.autoneg != AUTONEG_DISABLE) {
+ netdev_info(dev, "Unsupported autoneg setting\n");
+ return -EINVAL;
+ }
+
+ /* MDI setting is only allowed when autoneg enabled because
+ * some hardware doesn't allow MDI setting when speed or
+ * duplex is forced.
+ */
+ if (cmd->base.eth_tp_mdix_ctrl) {
+ if (cmd->base.eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO &&
+ cmd->base.autoneg != AUTONEG_ENABLE) {
+ netdev_err(dev, "Forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n");
+ return -EINVAL;
+ }
}
+ if (cmd->base.autoneg == AUTONEG_DISABLE) {
+ if (cmd->base.speed != SPEED_10 && cmd->base.speed != SPEED_100) {
+ netdev_info(dev, "Unsupported speed for forced link\n");
+ return -EINVAL;
+ }
+ if (cmd->base.duplex != DUPLEX_HALF && cmd->base.duplex != DUPLEX_FULL) {
+ netdev_info(dev, "Duplex must be half or full for forced link\n");
+ return -EINVAL;
+ }
+ }
+
+ while (test_and_set_bit(__IGC_RESETTING, &adapter->state))
+ usleep_range(1000, 2000);
+
+ if (cmd->base.autoneg == AUTONEG_ENABLE)
+ igc_handle_autoneg_enabled(adapter, cmd);
+ else
+ igc_handle_autoneg_disabled(adapter, cmd->base.speed,
+ cmd->base.duplex);
+
/* MDI-X => 2; MDI => 1; Auto => 3 */
if (cmd->base.eth_tp_mdix_ctrl) {
/* fix up the value for auto (3 => 0) as zero is mapped
@@ -2175,6 +2285,7 @@ static const struct ethtool_ops igc_ethtool_ops = {
.get_rxnfc = igc_ethtool_get_rxnfc,
.set_rxnfc = igc_ethtool_set_rxnfc,
.get_rx_ring_count = igc_ethtool_get_rx_ring_count,
+ .get_rxfh_key_size = igc_ethtool_get_rxfh_key_size,
.get_rxfh_indir_size = igc_ethtool_get_rxfh_indir_size,
.get_rxfh = igc_ethtool_get_rxfh,
.set_rxfh = igc_ethtool_set_rxfh,
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index be8a49a86d09f7..62aaee55668a5b 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -73,6 +73,13 @@ struct igc_info {
extern const struct igc_info igc_base_info;
+enum igc_forced_speed_duplex {
+ IGC_FORCED_10H,
+ IGC_FORCED_10F,
+ IGC_FORCED_100H,
+ IGC_FORCED_100F,
+};
+
struct igc_mac_info {
struct igc_mac_operations ops;
@@ -92,8 +99,9 @@ struct igc_mac_info {
bool asf_firmware_present;
bool arc_subsystem_valid;
- bool autoneg_failed;
bool get_link_status;
+ bool autoneg_enabled;
+ enum igc_forced_speed_duplex forced_speed_duplex;
};
struct igc_nvm_operations {
diff --git a/drivers/net/ethernet/intel/igc/igc_mac.c b/drivers/net/ethernet/intel/igc/igc_mac.c
index 7ac6637f8db73b..d6f3f6618469d6 100644
--- a/drivers/net/ethernet/intel/igc/igc_mac.c
+++ b/drivers/net/ethernet/intel/igc/igc_mac.c
@@ -438,26 +438,23 @@ void igc_config_collision_dist(struct igc_hw *hw)
* Checks the status of auto-negotiation after link up to ensure that the
* speed and duplex were not forced. If the link needed to be forced, then
* flow control needs to be forced also. If auto-negotiation is enabled
- * and did not fail, then we configure flow control based on our link
- * partner.
+ * then we configure flow control based on our link partner.
*/
s32 igc_config_fc_after_link_up(struct igc_hw *hw)
{
u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
- struct igc_mac_info *mac = &hw->mac;
u16 speed, duplex;
s32 ret_val = 0;
- /* Check for the case where we have fiber media and auto-neg failed
- * so we had to force link. In this case, we need to force the
- * configuration of the MAC to match the "fc" parameter.
+ /* Without autoneg, flow control capability is not exchanged with the
+ * link partner. IEEE 802.3 prohibits flow control in half-duplex mode.
*/
- if (mac->autoneg_failed)
- ret_val = igc_force_mac_fc(hw);
+ if (!hw->mac.autoneg_enabled) {
+ if (hw->mac.forced_speed_duplex == IGC_FORCED_10H ||
+ hw->mac.forced_speed_duplex == IGC_FORCED_100H)
+ hw->fc.current_mode = igc_fc_none;
- if (ret_val) {
- hw_dbg("Error forcing flow control settings\n");
- goto out;
+ goto force_fc;
}
/* In auto-neg, we need to check and see if Auto-Neg has completed,
@@ -472,15 +469,15 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
- goto out;
+ return ret_val;
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS,
&mii_status_reg);
if (ret_val)
- goto out;
+ return ret_val;
if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
hw_dbg("Copper PHY and Auto Neg has not completed.\n");
- goto out;
+ return ret_val;
}
/* The AutoNeg process has completed, so we now need to
@@ -492,11 +489,11 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
ret_val = hw->phy.ops.read_reg(hw, PHY_AUTONEG_ADV,
&mii_nway_adv_reg);
if (ret_val)
- goto out;
+ return ret_val;
ret_val = hw->phy.ops.read_reg(hw, PHY_LP_ABILITY,
&mii_nway_lp_ability_reg);
if (ret_val)
- goto out;
+ return ret_val;
/* Two bits in the Auto Negotiation Advertisement Register
* (Address 4) and two bits in the Auto Negotiation Base
* Page Ability Register (Address 5) determine flow control
@@ -612,7 +609,7 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
ret_val = hw->mac.ops.get_speed_and_duplex(hw, &speed, &duplex);
if (ret_val) {
hw_dbg("Error getting link speed and duplex\n");
- goto out;
+ return ret_val;
}
if (duplex == HALF_DUPLEX)
@@ -621,13 +618,13 @@ s32 igc_config_fc_after_link_up(struct igc_hw *hw)
/* Now we call a subroutine to actually force the MAC
* controller to use the correct flow control settings.
*/
+force_fc:
ret_val = igc_force_mac_fc(hw);
if (ret_val) {
hw_dbg("Error forcing flow control settings\n");
- goto out;
+ return ret_val;
}
-out:
return ret_val;
}
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 2c9e2dfd84991e..e6e9441fc3d4e6 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -785,11 +785,8 @@ static void igc_setup_mrqc(struct igc_adapter *adapter)
struct igc_hw *hw = &adapter->hw;
u32 j, num_rx_queues;
u32 mrqc, rxcsum;
- u32 rss_key[10];
- netdev_rss_key_fill(rss_key, sizeof(rss_key));
- for (j = 0; j < 10; j++)
- wr32(IGC_RSSRK(j), rss_key[j]);
+ igc_write_rss_key(adapter);
num_rx_queues = adapter->rss_queues;
@@ -5048,6 +5045,9 @@ static int igc_sw_init(struct igc_adapter *adapter)
pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word);
+ /* init RSS key */
+ netdev_rss_key_fill(adapter->rss_key, sizeof(adapter->rss_key));
+
/* set default ring sizes */
adapter->tx_ring_count = IGC_DEFAULT_TXD;
adapter->rx_ring_count = IGC_DEFAULT_RXD;
@@ -7298,7 +7298,7 @@ static int igc_probe(struct pci_dev *pdev,
/* Initialize link properties that are user-changeable */
adapter->fc_autoneg = true;
hw->phy.autoneg_advertised = 0xaf;
-
+ hw->mac.autoneg_enabled = true;
hw->fc.requested_mode = igc_fc_default;
hw->fc.current_mode = igc_fc_default;
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 6c4d204aecfaed..4cf737fb3b21e9 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -494,12 +494,20 @@ s32 igc_setup_copper_link(struct igc_hw *hw)
s32 ret_val = 0;
bool link;
- /* Setup autoneg and flow control advertisement and perform
- * autonegotiation.
- */
- ret_val = igc_copper_link_autoneg(hw);
- if (ret_val)
- goto out;
+ if (hw->mac.autoneg_enabled) {
+ /* Setup autoneg and flow control advertisement and perform
+ * autonegotiation.
+ */
+ ret_val = igc_copper_link_autoneg(hw);
+ if (ret_val)
+ goto out;
+ } else {
+ ret_val = hw->phy.ops.force_speed_duplex(hw);
+ if (ret_val) {
+ hw_dbg("Error Forcing Speed/Duplex\n");
+ goto out;
+ }
+ }
/* Check link status. Wait up to 100 microseconds for link to become
* valid.
@@ -778,3 +786,48 @@ u16 igc_read_phy_fw_version(struct igc_hw *hw)
return gphy_version;
}
+
+/**
+ * igc_force_speed_duplex - Force PHY speed and duplex settings
+ * @hw: pointer to the HW structure
+ *
+ * Programs the GPY PHY control register to disable autonegotiation
+ * and force the speed/duplex indicated by hw->mac.forced_speed_duplex.
+ */
+s32 igc_force_speed_duplex(struct igc_hw *hw)
+{
+ struct igc_phy_info *phy = &hw->phy;
+ u16 phy_ctrl;
+ s32 ret_val;
+
+ ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
+ if (ret_val)
+ return ret_val;
+
+ phy_ctrl &= ~(MII_CR_SPEED_MASK | MII_CR_DUPLEX_EN |
+ MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG);
+
+ switch (hw->mac.forced_speed_duplex) {
+ case IGC_FORCED_10H:
+ phy_ctrl |= MII_CR_SPEED_10;
+ break;
+ case IGC_FORCED_10F:
+ phy_ctrl |= MII_CR_SPEED_10 | MII_CR_DUPLEX_EN;
+ break;
+ case IGC_FORCED_100H:
+ phy_ctrl |= MII_CR_SPEED_100;
+ break;
+ case IGC_FORCED_100F:
+ phy_ctrl |= MII_CR_SPEED_100 | MII_CR_DUPLEX_EN;
+ break;
+ default:
+ return -IGC_ERR_CONFIG;
+ }
+
+ ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_ctrl);
+ if (ret_val)
+ return ret_val;
+
+ hw->mac.get_link_status = true;
+ return 0;
+}
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.h b/drivers/net/ethernet/intel/igc/igc_phy.h
index 832a7e359f186d..d37a89174826f0 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.h
+++ b/drivers/net/ethernet/intel/igc/igc_phy.h
@@ -18,5 +18,6 @@ void igc_power_down_phy_copper(struct igc_hw *hw);
s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data);
s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data);
u16 igc_read_phy_fw_version(struct igc_hw *hw);
+s32 igc_force_speed_duplex(struct igc_hw *hw);
#endif
|
| 3/2 | 2026/07/02 02:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 15980 output: 32 thoughts: 668 Thoughts: **Analyzing the Reachability and Fuzzability of Network Driver Patches** Okay, so we've got this patch series that tweaks the `igb` and `igc` drivers. Let's break down the changes and figure out their implications. For `igb`, it's all about RSS (Receive Side Scaling) hash type definitions, ethtool configuration for the RSS key, and modification to `igb_rx_hash` to handle different hash types in the descriptor. The `igc` changes involve ethtool support for RSS key configuration, plus a few modifications to handle forced speed and duplex settings when autonegotiation is off. The immediate question is whether these changes are even *reachable* in a virtualized environment. `igb` targets the Intel Gigabit Ethernet controllers (like 82575, I350, etc.), and `igc` is for the 2.5G controllers (I225-LM/V). Can we emulate these, and test our changes? Hmm, QEMU's got `e1000e` and `e1000` (82574L, 82540EM), but what about `igb`? Good news, it looks like QEMU *does* support `igb` now, specifically the 82576. QEMU 8.0 added this, which is great. So `igb` is definitely reachable. Now, what about `igc`? Unfortunately, QEMU *doesn't* support `igc` at this point. That's a bit of a roadblock. Next, I need to check how to enable `igb` in QEMU. Is it a default or do I need to explicitly specify it? The configs `CONFIG_IGB` and `CONFIG_IGC` are relevant here. I'll need to double-check the QEMU configuration to ensure I'm using `igb` properly. Finally, can we *fuzz* these changes in `igb`? The relevant code is in `igb_ethtool.c` (for ethtool interaction) and `igb_main.c` (including the RX path). Specifically, `igb_set_rxfh` is called through ethtool, and `igb_rx_hash` is in the RX path – these are potential fuzzing targets. `igc` will be a no-go for fuzzing since it can't be emulated. I'll check the driver's Kconfig to find and verify the config options for `igb` and `igc` under `drivers/net/ethernet/intel/Kconfig`. |
| 4/2 | 2026/07/02 02:59 | tool | grepper |
0mArgs:{
"Expression": "config IGB",
"PathPrefix": "drivers/net/ethernet/intel/"
}Results: {
"Output": "drivers/net/ethernet/intel/Kconfig=81=config E1000E_HWTS\n--\ndrivers/net/ethernet/intel/Kconfig-89-\ndrivers/net/ethernet/intel/Kconfig:90:config IGB\ndrivers/net/ethernet/intel/Kconfig-91-\ttristate \"Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support\"\n--\ndrivers/net/ethernet/intel/Kconfig-108-\ndrivers/net/ethernet/intel/Kconfig:109:config IGB_HWMON\ndrivers/net/ethernet/intel/Kconfig-110-\tbool \"Intel(R) PCI-Express Gigabit adapters HWMON support\"\n--\ndrivers/net/ethernet/intel/Kconfig-119-\ndrivers/net/ethernet/intel/Kconfig:120:config IGB_DCA\ndrivers/net/ethernet/intel/Kconfig-121-\tbool \"Direct Cache Access (DCA) Support\"\n--\ndrivers/net/ethernet/intel/Kconfig-128-\ndrivers/net/ethernet/intel/Kconfig:129:config IGBVF\ndrivers/net/ethernet/intel/Kconfig-130-\ttristate \"Intel(R) 82576 Virtual Function Ethernet support\"\n"
} |
| 5/2 | 2026/07/02 02:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 17614 output: 32 thoughts: 11 Thoughts: Okay, here's my attempt at summarizing the thought process, tailored for an expert audience, and written in the first person: **Quick Check: IGC Considerations** Alright, I'm thinking, "We can't just focus on the usual suspects here; we need to broaden the scope a bit." My immediate reaction is to bring the `igc` angle into the discussion. I need to make sure we haven't overlooked any potential implications or relevant information that might be hiding within that data set. It could be crucial for a more complete understanding. Time to dig in, and see what we can find. |
| 6/2 | 2026/07/02 02:59 | tool | grepper |
0mArgs:{
"Expression": "config IGC",
"PathPrefix": "drivers/net/ethernet/intel/"
}Results: {
"Output": "drivers/net/ethernet/intel/Kconfig=355=config FM10K\n--\ndrivers/net/ethernet/intel/Kconfig-372-\ndrivers/net/ethernet/intel/Kconfig:373:config IGC\ndrivers/net/ethernet/intel/Kconfig-374-\ttristate \"Intel(R) Ethernet Controller I225-LM/I225-V support\"\n--\ndrivers/net/ethernet/intel/Kconfig-390-\ndrivers/net/ethernet/intel/Kconfig:391:config IGC_LEDS\ndrivers/net/ethernet/intel/Kconfig-392-\tdef_bool LEDS_TRIGGER_NETDEV\n"
} |
| 7/2 | 2026/07/02 02:59 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 17972 output: 198 thoughts: 1065 Thoughts: **Fuzzing the IGB and IGC Drivers: A Focused Approach** Okay, so I'm assessing the fuzzing potential for these changes related to RSS key configuration and autonegotiation control in the `igb` and `igc` drivers. The key here is QEMU's support. Since `igb` is supported by QEMU, the `igb` changes are definitely reachable and fuzzable. I'm less certain about `igc` – QEMU might not fully support it yet, though that could change. Either way, syzkaller can reach these via ethtool using netlink or ioctl. For `igb`, `igb_set_rxfh` is directly reachable. For `igc`, `igc_ethtool_set_rxfh` and `igc_ethtool_set_link_ksettings` should be reachable if the device is present (even if not emulated). Since `igb` is definitely accessible, the effort is worthwhile; `WorthFuzzing=true`. Now, for focus symbols, I'm thinking: * `igb_set_rxfh` * `igb_write_rss_key` * `igc_ethtool_set_rxfh` * `igc_write_rss_key` * `igc_ethtool_set_link_ksettings` * `igc_handle_autoneg_disabled` * `igc_handle_autoneg_enabled` * `igc_force_speed_duplex` However, I need to consider `igb_rx_hash` because it's a hot-path function within the RX path. I need to be careful with the potential skewing of test distributions. Even though it's *specific* to the `igb` driver, it is called per packet. The prompt says to avoid generic hot-path functions, so I will omit `igb_rx_hash` to avoid skewing. I've also confirmed that `igb_set_rxfh` is static, which is good to know. `igb_write_rss_key` is not. For configuration, I will enable `IGB` and `IGC`. QEMU supports the `-device igb` flag from version 8.0.0, which verifies the `igb` part. I'm unsure about `igc`, but I'll include the config anyway. Let's do a final review: **`igb` driver:** * `igb_write_rss_key` * `igb_get_rxfh_key_size` * `igb_set_rxfh` * `igb_rx_hash` **`igc` driver:** * `igc_write_rss_key` * `igc_ethtool_get_rxfh_key_size` * `igc_ethtool_set_rxfh` * `igc_handle_autoneg_disabled` * `igc_handle_autoneg_enabled` * `igc_ethtool_set_link_ksettings` * `igc_force_speed_duplex` So, my final list of focus symbols are, as listed above: * `igb_set_rxfh` * `igb_write_rss_key` * `igc_ethtool_set_rxfh` * `igc_write_rss_key` * `igc_ethtool_set_link_ksettings` * `igc_handle_autoneg_disabled` * `igc_handle_autoneg_enabled` * `igc_force_speed_duplex` Configs: * `IGB` * `IGC` Reasoning: The patch enables RSS key configuration via ethtool and adds support for forcing speed/duplex settings when autonegotiation is disabled. The `igb` driver is supported by QEMU. Okay, let's set these results. |
| 8/2 | 2026/07/02 02:59 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"IGB",
"IGC"
],
"FocusSymbols": [
"igb_set_rxfh",
"igb_write_rss_key",
"igc_ethtool_set_rxfh",
"igc_write_rss_key",
"igc_ethtool_set_link_ksettings",
"igc_handle_autoneg_disabled",
"igc_handle_autoneg_enabled",
"igc_force_speed_duplex"
],
"Reasoning": "The patch implements RSS key configuration via ethtool for the igb and igc drivers, and adds support for forcing speed/duplex settings when autonegotiation is disabled in the igc driver. The igb driver is supported by QEMU and can be fuzzed.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"IGB",
"IGC"
],
"FocusSymbols": [
"igb_set_rxfh",
"igb_write_rss_key",
"igc_ethtool_set_rxfh",
"igc_write_rss_key",
"igc_ethtool_set_link_ksettings",
"igc_handle_autoneg_disabled",
"igc_handle_autoneg_enabled",
"igc_force_speed_duplex"
],
"Reasoning": "The patch implements RSS key configuration via ethtool for the igb and igc drivers, and adds support for forcing speed/duplex settings when autonegotiation is disabled in the igc driver. The igb driver is supported by QEMU and can be fuzzed.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|