On 18/01/2024 10:59, Sachin Kumar Garg wrote:
- switch (*in) {
- case HFI_RATE_CONTROL_OFF:
- case HFI_RATE_CONTROL_CBR_CFR:
- case HFI_RATE_CONTROL_CBR_VFR:
- case HFI_RATE_CONTROL_VBR_CFR:
- case HFI_RATE_CONTROL_VBR_VFR:
- case HFI_RATE_CONTROL_CQ:
- break;
- default:
- ret = -EINVAL;
- break;
+ if (hfi_ver == HFI_VERSION_4XX) {
+ switch (*in) {
+ case HFI_RATE_CONTROL_OFF:
+ case HFI_RATE_CONTROL_CBR_CFR:
+ case HFI_RATE_CONTROL_CBR_VFR:
+ case HFI_RATE_CONTROL_VBR_CFR:
+ case HFI_RATE_CONTROL_VBR_VFR:
+ case HFI_RATE_CONTROL_CQ:
+ case HFI_RATE_CONTROL_MBR_CFR:
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
+ } else {
+ switch (*in) {
+ case HFI_RATE_CONTROL_OFF:
+ case HFI_RATE_CONTROL_CBR_CFR:
+ case HFI_RATE_CONTROL_CBR_VFR:
+ case HFI_RATE_CONTROL_VBR_CFR:
+ case HFI_RATE_CONTROL_VBR_VFR:
+ case HFI_RATE_CONTROL_CQ:
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
The if/else you have here seems like a needless replication
Just have =>
case HFI_RATE_CONTROL_MBR_CFR:
if (hfi_ver == HFI_VERSION_4XX)
---
bod