)]}'
{
  "commit": "02fffd1939f6b45892f61822459953ce95e42948",
  "tree": "8739d044c65312677c3c76fb5457247d54d9e9e6",
  "parents": [
    "90e4b849dfa6fc8e6c050bcfe1b331b69c015d28"
  ],
  "author": {
    "name": "Lorenzo Bianconi",
    "email": "lorenzo.bianconi@oss.qualcomm.com",
    "time": "Fri Sep 11 10:58:30 2026 +0200"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Wed Sep 16 19:07:13 2026 -0700"
  },
  "message": "net: stmmac: preserve real_num_tx_queues on mqprio setup failure\n\nWith the FPE preemption-class mapping error now propagated from\nstmmac_fpe_map_preemption_class(), tc_setup_dwmac510_mqprio() can fail\non the mapping step. The error path used to call stmmac_reset_tc_mqprio(),\nwhich resets the number of real TX queues to priv-\u003eplat-\u003etx_queues_to_use\n(the platform maximum), overwriting the value that was active before the\noffload was attempted (for example a lower count left over from a previous\nmqprio configuration).\n\nThe issue can be triggered using the following configuration:\n\n  # First mqprio config lowers the hw queue count below the platform\n  # default (e.g. 8 TX queues).\n  $tc qdisc add dev eth0 root handle 1: mqprio queues 2@0 2@2\n\n  # Replace mqprio configuration with a second one that fails FPE\n  # preemption-class mapping. stmmac driver resets the real_num_tx_queues\n  # to the platform maximum, losing the previous configuration.\n  $tc qdisc replace dev eth0 root handle 2: mqprio queues 2@0 2@2 fp E P\n\nSave ndev-\u003ereal_num_tx_queues before lowering it and restore it,\ntogether with the TC-to-queue and priority-to-TC mappings, when the FPE\npreemption-class mapping fails, instead of resetting the queue count to\nthe platform maximum.\n\nNote that a failed setup makes the qdisc layer run mqprio_destroy() on\nthe new qdisc. Because priv-\u003ehw_offload is only assigned after\nndo_setup_tc() succeeds, mqprio_destroy() calls netdev_set_num_tc(dev, 0),\nso dev-\u003enum_tc ends up 0 regardless of the driver-side restore and the\nprevious qdisc is not reactivated. The restore is still needed to keep\nreal_num_tx_queues and to avoid leaving the failed configuration\u0027s\nTC-to-queue and priority-to-TC mappings in place.\n\nFixes: 195e4f409a40 (\"net: stmmac: support fp parameter of tc-mqprio\")\nSigned-off-by: Lorenzo Bianconi \u003clorenzo.bianconi@oss.qualcomm.com\u003e\nLink: https://patch.msgid.link/20260911-stmmac-tc_setup_dwmac510_mqprio-error-path-v3-2-a76b1e2547c1@oss.qualcomm.com\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5398616fcdfea4119c6b5d1c589c71c2ed6ed438",
      "old_mode": 33188,
      "old_path": "drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c",
      "new_id": "42a00446e9b41afc8ac18e04d0cdaa82874ed42e",
      "new_mode": 33188,
      "new_path": "drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c"
    }
  ]
}
