Skip to content

Commit

Permalink
pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit
Browse files Browse the repository at this point in the history
This driver prefers connection speed over sas port speed. On stable/13
branch the stack-allocated CCB is not cleared thus the cam layer may
report weird speed on boot.

```
da0: <VMware Virtual disk 2.0> Fixed Direct Access SPC-4 SCSI device
da0: 4294967.295MB/s transfers
```

-current and stable/14 have the change [1] which clears stack-allocated
CCB thus are not affected, but I want -current and stable/14 to have this
fix in to reduce drift between branches.

1. ec5325d cam: make sure to clear even more CCBs allocated on the stack

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D48438
  • Loading branch information
gmshake committed Jan 15, 2025
1 parent 316aa4d commit 7befd68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sys/dev/vmware/pvscsi/pvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ pvscsi_action(struct cam_sim *sim, union ccb *ccb)
cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB;
cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ;

/* Prefer connection speed over sas port speed */
cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED;
cts->xport_specific.sas.bitrate = 0;

ccb_h->status = CAM_REQ_CMP;
xpt_done(ccb);
} break;
Expand Down

0 comments on commit 7befd68

Please sign in to comment.