)]}'
{
  "commit": "2689a6e77668bc7bd0cf486fa7e4d733c5069bd9",
  "tree": "cb98505a1642c47c8b52ee555a9486420955f26e",
  "parents": [
    "4fa4052c7ebb59e4d4aa396f1563c89118623ec7"
  ],
  "author": {
    "name": "Michael Brown",
    "email": "mcb30@ipxe.org",
    "time": "Wed Jun 21 11:49:53 2023 +0100"
  },
  "committer": {
    "name": "Michael Brown",
    "email": "mcb30@ipxe.org",
    "time": "Wed Jun 21 11:49:53 2023 +0100"
  },
  "message": "[efi] Always poll for TX completions\n\nPolling for TX completions is arguably redundant when there are no\ntransmissions currently in progress.  Commit c6c7e78 (\"[efi] Poll for\nTX completions only when there is an outstanding TX buffer\") switched\nto setting the PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS flag only when\nthere is an in-progress transmission awaiting completion, in order to\nreduce reported TX errors and debug message noise from buggy NII\nimplementations that report spurious TX completions whenever the\ntransmit queue is empty.\n\nSome other NII implementations (observed with the Realtek driver in a\nDell Latitude 3440) seem to have a bug in the transmit datapath\nhandling which results in the transmit ring freezing after sending a\nfew hundred packets under heavy load.  The symptoms are that the\nTPPoll register\u0027s NPQ bit remains set and the 256-entry transmit ring\ncontains a large number of uncompleted descriptors (with the OWN bit\nset), the first two of which have identical data buffer addresses.\n\nThough iPXE will submit at most one in-progress transmission via NII,\nthe Dell/Realtek driver seems to make a page-aligned copy of each\ntransmit data buffer and to report TX completions immediately without\nwaiting for the packet to actually be transmitted.  These synthetic TX\ncompletions continue even after the hardware transmit ring freezes.\n\nSetting PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS on every poll reduces the\nprobability of this Dell/Realtek driver bug being triggered by a\nfactor of around 500, which brings the failure rate down to the point\nthat it can sensibly be managed by external logic such as the\n\"--timeout\" option for image downloads.  Closing and reopening the\ninterface (via \"ifclose\"/\"ifopen\") will clear the error condition and\nallow transmissions to resume.\n\nRevert to setting PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS on every poll,\nand silently ignore situations in which the hardware reports a\ncompletion when no transmission is in progress.  This approximately\nmatches the behaviour of the SnpDxe driver, which will also generally\nset PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS on every poll.\n\nSigned-off-by: Michael Brown \u003cmcb30@ipxe.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "be5bce4b4326ab8cc5c9a1a64cf389086d05735c",
      "old_mode": 33188,
      "old_path": "src/drivers/net/efi/nii.c",
      "new_id": "8dd17e4b5f7c84460f3add2fd8210dbf4b5dc258",
      "new_mode": 33188,
      "new_path": "src/drivers/net/efi/nii.c"
    }
  ]
}
