| 2924 | } |
| 2925 | |
| 2926 | int ena_com_fill_hash_ctrl(struct ena_com_dev *ena_dev, |
| 2927 | enum ena_admin_flow_hash_proto proto, |
| 2928 | u16 hash_fields) |
| 2929 | { |
| 2930 | struct ena_rss *rss = &ena_dev->rss; |
| 2931 | struct ena_admin_feature_rss_hash_control *hash_ctrl = rss->hash_ctrl; |
| 2932 | u16 supported_fields; |
| 2933 | int rc; |
| 2934 | |
| 2935 | if (proto >= ENA_ADMIN_RSS_PROTO_NUM) { |
| 2936 | ena_trc_err(ena_dev, "Invalid proto num (%u)\n", proto); |
| 2937 | return ENA_COM_INVAL; |
| 2938 | } |
| 2939 | |
| 2940 | /* Get the ctrl table */ |
| 2941 | rc = ena_com_get_hash_ctrl(ena_dev, proto, NULL); |
| 2942 | if (unlikely(rc)) |
| 2943 | return rc; |
| 2944 | |
| 2945 | /* Make sure all the fields are supported */ |
| 2946 | supported_fields = hash_ctrl->supported_fields[proto].fields; |
| 2947 | if ((hash_fields & supported_fields) != hash_fields) { |
| 2948 | ena_trc_err(ena_dev, "Proto %d doesn't support the required fields %x. supports only: %x\n", |
| 2949 | proto, hash_fields, supported_fields); |
| 2950 | } |
| 2951 | |
| 2952 | hash_ctrl->selected_fields[proto].fields = hash_fields; |
| 2953 | |
| 2954 | rc = ena_com_set_hash_ctrl(ena_dev); |
| 2955 | |
| 2956 | /* In case of failure, restore the old hash ctrl */ |
| 2957 | if (unlikely(rc)) |
| 2958 | ena_com_get_hash_ctrl(ena_dev, 0, NULL); |
| 2959 | |
| 2960 | return 0; |
| 2961 | } |
| 2962 | |
| 2963 | int ena_com_indirect_table_fill_entry(struct ena_com_dev *ena_dev, |
| 2964 | u16 entry_idx, u16 entry_value) |
no test coverage detected