Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: Enable writing filtering tables

Write the hardware tables based on the populated software structures.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Henry Tieman <henry.w.tieman@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Tony Nguyen and committed by
Jeff Kirsher
43dbfc7b 451f2c44

+651
+1
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
··· 1856 1856 1857 1857 /* package commands */ 1858 1858 ice_aqc_opc_download_pkg = 0x0C40, 1859 + ice_aqc_opc_update_pkg = 0x0C42, 1859 1860 ice_aqc_opc_get_pkg_info_list = 0x0C43, 1860 1861 1861 1862 /* debug commands */
+604
drivers/net/ethernet/intel/ice/ice_flex_pipe.c
··· 5 5 #include "ice_flex_pipe.h" 6 6 #include "ice_flow.h" 7 7 8 + static const u32 ice_sect_lkup[ICE_BLK_COUNT][ICE_SECT_COUNT] = { 9 + /* SWITCH */ 10 + { 11 + ICE_SID_XLT0_SW, 12 + ICE_SID_XLT_KEY_BUILDER_SW, 13 + ICE_SID_XLT1_SW, 14 + ICE_SID_XLT2_SW, 15 + ICE_SID_PROFID_TCAM_SW, 16 + ICE_SID_PROFID_REDIR_SW, 17 + ICE_SID_FLD_VEC_SW, 18 + ICE_SID_CDID_KEY_BUILDER_SW, 19 + ICE_SID_CDID_REDIR_SW 20 + }, 21 + 22 + /* ACL */ 23 + { 24 + ICE_SID_XLT0_ACL, 25 + ICE_SID_XLT_KEY_BUILDER_ACL, 26 + ICE_SID_XLT1_ACL, 27 + ICE_SID_XLT2_ACL, 28 + ICE_SID_PROFID_TCAM_ACL, 29 + ICE_SID_PROFID_REDIR_ACL, 30 + ICE_SID_FLD_VEC_ACL, 31 + ICE_SID_CDID_KEY_BUILDER_ACL, 32 + ICE_SID_CDID_REDIR_ACL 33 + }, 34 + 35 + /* FD */ 36 + { 37 + ICE_SID_XLT0_FD, 38 + ICE_SID_XLT_KEY_BUILDER_FD, 39 + ICE_SID_XLT1_FD, 40 + ICE_SID_XLT2_FD, 41 + ICE_SID_PROFID_TCAM_FD, 42 + ICE_SID_PROFID_REDIR_FD, 43 + ICE_SID_FLD_VEC_FD, 44 + ICE_SID_CDID_KEY_BUILDER_FD, 45 + ICE_SID_CDID_REDIR_FD 46 + }, 47 + 48 + /* RSS */ 49 + { 50 + ICE_SID_XLT0_RSS, 51 + ICE_SID_XLT_KEY_BUILDER_RSS, 52 + ICE_SID_XLT1_RSS, 53 + ICE_SID_XLT2_RSS, 54 + ICE_SID_PROFID_TCAM_RSS, 55 + ICE_SID_PROFID_REDIR_RSS, 56 + ICE_SID_FLD_VEC_RSS, 57 + ICE_SID_CDID_KEY_BUILDER_RSS, 58 + ICE_SID_CDID_REDIR_RSS 59 + }, 60 + 61 + /* PE */ 62 + { 63 + ICE_SID_XLT0_PE, 64 + ICE_SID_XLT_KEY_BUILDER_PE, 65 + ICE_SID_XLT1_PE, 66 + ICE_SID_XLT2_PE, 67 + ICE_SID_PROFID_TCAM_PE, 68 + ICE_SID_PROFID_REDIR_PE, 69 + ICE_SID_FLD_VEC_PE, 70 + ICE_SID_CDID_KEY_BUILDER_PE, 71 + ICE_SID_CDID_REDIR_PE 72 + } 73 + }; 74 + 75 + /** 76 + * ice_sect_id - returns section ID 77 + * @blk: block type 78 + * @sect: section type 79 + * 80 + * This helper function returns the proper section ID given a block type and a 81 + * section type. 82 + */ 83 + static u32 ice_sect_id(enum ice_block blk, enum ice_sect sect) 84 + { 85 + return ice_sect_lkup[blk][sect]; 86 + } 87 + 8 88 /** 9 89 * ice_pkg_val_buf 10 90 * @buf: pointer to the ice buffer ··· 456 376 } 457 377 458 378 /** 379 + * ice_acquire_change_lock 380 + * @hw: pointer to the HW structure 381 + * @access: access type (read or write) 382 + * 383 + * This function will request ownership of the change lock. 384 + */ 385 + static enum ice_status 386 + ice_acquire_change_lock(struct ice_hw *hw, enum ice_aq_res_access_type access) 387 + { 388 + return ice_acquire_res(hw, ICE_CHANGE_LOCK_RES_ID, access, 389 + ICE_CHANGE_LOCK_TIMEOUT); 390 + } 391 + 392 + /** 393 + * ice_release_change_lock 394 + * @hw: pointer to the HW structure 395 + * 396 + * This function will release the change lock using the proper Admin Command. 397 + */ 398 + static void ice_release_change_lock(struct ice_hw *hw) 399 + { 400 + ice_release_res(hw, ICE_CHANGE_LOCK_RES_ID); 401 + } 402 + 403 + /** 459 404 * ice_aq_download_pkg 460 405 * @hw: pointer to the hardware structure 461 406 * @pkg_buf: the package buffer to transfer ··· 508 403 509 404 cmd = &desc.params.download_pkg; 510 405 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_download_pkg); 406 + desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 407 + 408 + if (last_buf) 409 + cmd->flags |= ICE_AQC_DOWNLOAD_PKG_LAST_BUF; 410 + 411 + status = ice_aq_send_cmd(hw, &desc, pkg_buf, buf_size, cd); 412 + if (status == ICE_ERR_AQ_ERROR) { 413 + /* Read error from buffer only when the FW returned an error */ 414 + struct ice_aqc_download_pkg_resp *resp; 415 + 416 + resp = (struct ice_aqc_download_pkg_resp *)pkg_buf; 417 + if (error_offset) 418 + *error_offset = le32_to_cpu(resp->error_offset); 419 + if (error_info) 420 + *error_info = le32_to_cpu(resp->error_info); 421 + } 422 + 423 + return status; 424 + } 425 + 426 + /** 427 + * ice_aq_update_pkg 428 + * @hw: pointer to the hardware structure 429 + * @pkg_buf: the package cmd buffer 430 + * @buf_size: the size of the package cmd buffer 431 + * @last_buf: last buffer indicator 432 + * @error_offset: returns error offset 433 + * @error_info: returns error information 434 + * @cd: pointer to command details structure or NULL 435 + * 436 + * Update Package (0x0C42) 437 + */ 438 + static enum ice_status 439 + ice_aq_update_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf, u16 buf_size, 440 + bool last_buf, u32 *error_offset, u32 *error_info, 441 + struct ice_sq_cd *cd) 442 + { 443 + struct ice_aqc_download_pkg *cmd; 444 + struct ice_aq_desc desc; 445 + enum ice_status status; 446 + 447 + if (error_offset) 448 + *error_offset = 0; 449 + if (error_info) 450 + *error_info = 0; 451 + 452 + cmd = &desc.params.download_pkg; 453 + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_update_pkg); 511 454 desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 512 455 513 456 if (last_buf) ··· 608 455 } 609 456 610 457 return NULL; 458 + } 459 + 460 + /** 461 + * ice_update_pkg 462 + * @hw: pointer to the hardware structure 463 + * @bufs: pointer to an array of buffers 464 + * @count: the number of buffers in the array 465 + * 466 + * Obtains change lock and updates package. 467 + */ 468 + static enum ice_status 469 + ice_update_pkg(struct ice_hw *hw, struct ice_buf *bufs, u32 count) 470 + { 471 + enum ice_status status; 472 + u32 offset, info, i; 473 + 474 + status = ice_acquire_change_lock(hw, ICE_RES_WRITE); 475 + if (status) 476 + return status; 477 + 478 + for (i = 0; i < count; i++) { 479 + struct ice_buf_hdr *bh = (struct ice_buf_hdr *)(bufs + i); 480 + bool last = ((i + 1) == count); 481 + 482 + status = ice_aq_update_pkg(hw, bh, le16_to_cpu(bh->data_end), 483 + last, &offset, &info, NULL); 484 + 485 + if (status) { 486 + ice_debug(hw, ICE_DBG_PKG, 487 + "Update pkg failed: err %d off %d inf %d\n", 488 + status, offset, info); 489 + break; 490 + } 491 + } 492 + 493 + ice_release_change_lock(hw); 494 + 495 + return status; 611 496 } 612 497 613 498 /** ··· 1127 936 } 1128 937 1129 938 return status; 939 + } 940 + 941 + /** 942 + * ice_pkg_buf_alloc 943 + * @hw: pointer to the HW structure 944 + * 945 + * Allocates a package buffer and returns a pointer to the buffer header. 946 + * Note: all package contents must be in Little Endian form. 947 + */ 948 + static struct ice_buf_build *ice_pkg_buf_alloc(struct ice_hw *hw) 949 + { 950 + struct ice_buf_build *bld; 951 + struct ice_buf_hdr *buf; 952 + 953 + bld = devm_kzalloc(ice_hw_to_dev(hw), sizeof(*bld), GFP_KERNEL); 954 + if (!bld) 955 + return NULL; 956 + 957 + buf = (struct ice_buf_hdr *)bld; 958 + buf->data_end = cpu_to_le16(offsetof(struct ice_buf_hdr, 959 + section_entry)); 960 + return bld; 961 + } 962 + 963 + /** 964 + * ice_pkg_buf_free 965 + * @hw: pointer to the HW structure 966 + * @bld: pointer to pkg build (allocated by ice_pkg_buf_alloc()) 967 + * 968 + * Frees a package buffer 969 + */ 970 + static void ice_pkg_buf_free(struct ice_hw *hw, struct ice_buf_build *bld) 971 + { 972 + devm_kfree(ice_hw_to_dev(hw), bld); 973 + } 974 + 975 + /** 976 + * ice_pkg_buf_reserve_section 977 + * @bld: pointer to pkg build (allocated by ice_pkg_buf_alloc()) 978 + * @count: the number of sections to reserve 979 + * 980 + * Reserves one or more section table entries in a package buffer. This routine 981 + * can be called multiple times as long as they are made before calling 982 + * ice_pkg_buf_alloc_section(). Once ice_pkg_buf_alloc_section() 983 + * is called once, the number of sections that can be allocated will not be able 984 + * to be increased; not using all reserved sections is fine, but this will 985 + * result in some wasted space in the buffer. 986 + * Note: all package contents must be in Little Endian form. 987 + */ 988 + static enum ice_status 989 + ice_pkg_buf_reserve_section(struct ice_buf_build *bld, u16 count) 990 + { 991 + struct ice_buf_hdr *buf; 992 + u16 section_count; 993 + u16 data_end; 994 + 995 + if (!bld) 996 + return ICE_ERR_PARAM; 997 + 998 + buf = (struct ice_buf_hdr *)&bld->buf; 999 + 1000 + /* already an active section, can't increase table size */ 1001 + section_count = le16_to_cpu(buf->section_count); 1002 + if (section_count > 0) 1003 + return ICE_ERR_CFG; 1004 + 1005 + if (bld->reserved_section_table_entries + count > ICE_MAX_S_COUNT) 1006 + return ICE_ERR_CFG; 1007 + bld->reserved_section_table_entries += count; 1008 + 1009 + data_end = le16_to_cpu(buf->data_end) + 1010 + (count * sizeof(buf->section_entry[0])); 1011 + buf->data_end = cpu_to_le16(data_end); 1012 + 1013 + return 0; 1014 + } 1015 + 1016 + /** 1017 + * ice_pkg_buf_alloc_section 1018 + * @bld: pointer to pkg build (allocated by ice_pkg_buf_alloc()) 1019 + * @type: the section type value 1020 + * @size: the size of the section to reserve (in bytes) 1021 + * 1022 + * Reserves memory in the buffer for a section's content and updates the 1023 + * buffers' status accordingly. This routine returns a pointer to the first 1024 + * byte of the section start within the buffer, which is used to fill in the 1025 + * section contents. 1026 + * Note: all package contents must be in Little Endian form. 1027 + */ 1028 + static void * 1029 + ice_pkg_buf_alloc_section(struct ice_buf_build *bld, u32 type, u16 size) 1030 + { 1031 + struct ice_buf_hdr *buf; 1032 + u16 sect_count; 1033 + u16 data_end; 1034 + 1035 + if (!bld || !type || !size) 1036 + return NULL; 1037 + 1038 + buf = (struct ice_buf_hdr *)&bld->buf; 1039 + 1040 + /* check for enough space left in buffer */ 1041 + data_end = le16_to_cpu(buf->data_end); 1042 + 1043 + /* section start must align on 4 byte boundary */ 1044 + data_end = ALIGN(data_end, 4); 1045 + 1046 + if ((data_end + size) > ICE_MAX_S_DATA_END) 1047 + return NULL; 1048 + 1049 + /* check for more available section table entries */ 1050 + sect_count = le16_to_cpu(buf->section_count); 1051 + if (sect_count < bld->reserved_section_table_entries) { 1052 + void *section_ptr = ((u8 *)buf) + data_end; 1053 + 1054 + buf->section_entry[sect_count].offset = cpu_to_le16(data_end); 1055 + buf->section_entry[sect_count].size = cpu_to_le16(size); 1056 + buf->section_entry[sect_count].type = cpu_to_le32(type); 1057 + 1058 + data_end += size; 1059 + buf->data_end = cpu_to_le16(data_end); 1060 + 1061 + buf->section_count = cpu_to_le16(sect_count + 1); 1062 + return section_ptr; 1063 + } 1064 + 1065 + /* no free section table entries */ 1066 + return NULL; 1067 + } 1068 + 1069 + /** 1070 + * ice_pkg_buf_get_active_sections 1071 + * @bld: pointer to pkg build (allocated by ice_pkg_buf_alloc()) 1072 + * 1073 + * Returns the number of active sections. Before using the package buffer 1074 + * in an update package command, the caller should make sure that there is at 1075 + * least one active section - otherwise, the buffer is not legal and should 1076 + * not be used. 1077 + * Note: all package contents must be in Little Endian form. 1078 + */ 1079 + static u16 ice_pkg_buf_get_active_sections(struct ice_buf_build *bld) 1080 + { 1081 + struct ice_buf_hdr *buf; 1082 + 1083 + if (!bld) 1084 + return 0; 1085 + 1086 + buf = (struct ice_buf_hdr *)&bld->buf; 1087 + return le16_to_cpu(buf->section_count); 1088 + } 1089 + 1090 + /** 1091 + * ice_pkg_buf 1092 + * @bld: pointer to pkg build (allocated by ice_pkg_buf_alloc()) 1093 + * 1094 + * Return a pointer to the buffer's header 1095 + */ 1096 + static struct ice_buf *ice_pkg_buf(struct ice_buf_build *bld) 1097 + { 1098 + if (!bld) 1099 + return NULL; 1100 + 1101 + return &bld->buf; 1130 1102 } 1131 1103 1132 1104 /* PTG Management */ ··· 2562 2208 } 2563 2209 2564 2210 /** 2211 + * ice_prof_bld_es - build profile ID extraction sequence changes 2212 + * @hw: pointer to the HW struct 2213 + * @blk: hardware block 2214 + * @bld: the update package buffer build to add to 2215 + * @chgs: the list of changes to make in hardware 2216 + */ 2217 + static enum ice_status 2218 + ice_prof_bld_es(struct ice_hw *hw, enum ice_block blk, 2219 + struct ice_buf_build *bld, struct list_head *chgs) 2220 + { 2221 + u16 vec_size = hw->blk[blk].es.fvw * sizeof(struct ice_fv_word); 2222 + struct ice_chs_chg *tmp; 2223 + 2224 + list_for_each_entry(tmp, chgs, list_entry) 2225 + if (tmp->type == ICE_PTG_ES_ADD && tmp->add_prof) { 2226 + u16 off = tmp->prof_id * hw->blk[blk].es.fvw; 2227 + struct ice_pkg_es *p; 2228 + u32 id; 2229 + 2230 + id = ice_sect_id(blk, ICE_VEC_TBL); 2231 + p = (struct ice_pkg_es *) 2232 + ice_pkg_buf_alloc_section(bld, id, sizeof(*p) + 2233 + vec_size - 2234 + sizeof(p->es[0])); 2235 + 2236 + if (!p) 2237 + return ICE_ERR_MAX_LIMIT; 2238 + 2239 + p->count = cpu_to_le16(1); 2240 + p->offset = cpu_to_le16(tmp->prof_id); 2241 + 2242 + memcpy(p->es, &hw->blk[blk].es.t[off], vec_size); 2243 + } 2244 + 2245 + return 0; 2246 + } 2247 + 2248 + /** 2249 + * ice_prof_bld_tcam - build profile ID TCAM changes 2250 + * @hw: pointer to the HW struct 2251 + * @blk: hardware block 2252 + * @bld: the update package buffer build to add to 2253 + * @chgs: the list of changes to make in hardware 2254 + */ 2255 + static enum ice_status 2256 + ice_prof_bld_tcam(struct ice_hw *hw, enum ice_block blk, 2257 + struct ice_buf_build *bld, struct list_head *chgs) 2258 + { 2259 + struct ice_chs_chg *tmp; 2260 + 2261 + list_for_each_entry(tmp, chgs, list_entry) 2262 + if (tmp->type == ICE_TCAM_ADD && tmp->add_tcam_idx) { 2263 + struct ice_prof_id_section *p; 2264 + u32 id; 2265 + 2266 + id = ice_sect_id(blk, ICE_PROF_TCAM); 2267 + p = (struct ice_prof_id_section *) 2268 + ice_pkg_buf_alloc_section(bld, id, sizeof(*p)); 2269 + 2270 + if (!p) 2271 + return ICE_ERR_MAX_LIMIT; 2272 + 2273 + p->count = cpu_to_le16(1); 2274 + p->entry[0].addr = cpu_to_le16(tmp->tcam_idx); 2275 + p->entry[0].prof_id = tmp->prof_id; 2276 + 2277 + memcpy(p->entry[0].key, 2278 + &hw->blk[blk].prof.t[tmp->tcam_idx].key, 2279 + sizeof(hw->blk[blk].prof.t->key)); 2280 + } 2281 + 2282 + return 0; 2283 + } 2284 + 2285 + /** 2286 + * ice_prof_bld_xlt1 - build XLT1 changes 2287 + * @blk: hardware block 2288 + * @bld: the update package buffer build to add to 2289 + * @chgs: the list of changes to make in hardware 2290 + */ 2291 + static enum ice_status 2292 + ice_prof_bld_xlt1(enum ice_block blk, struct ice_buf_build *bld, 2293 + struct list_head *chgs) 2294 + { 2295 + struct ice_chs_chg *tmp; 2296 + 2297 + list_for_each_entry(tmp, chgs, list_entry) 2298 + if (tmp->type == ICE_PTG_ES_ADD && tmp->add_ptg) { 2299 + struct ice_xlt1_section *p; 2300 + u32 id; 2301 + 2302 + id = ice_sect_id(blk, ICE_XLT1); 2303 + p = (struct ice_xlt1_section *) 2304 + ice_pkg_buf_alloc_section(bld, id, sizeof(*p)); 2305 + 2306 + if (!p) 2307 + return ICE_ERR_MAX_LIMIT; 2308 + 2309 + p->count = cpu_to_le16(1); 2310 + p->offset = cpu_to_le16(tmp->ptype); 2311 + p->value[0] = tmp->ptg; 2312 + } 2313 + 2314 + return 0; 2315 + } 2316 + 2317 + /** 2318 + * ice_prof_bld_xlt2 - build XLT2 changes 2319 + * @blk: hardware block 2320 + * @bld: the update package buffer build to add to 2321 + * @chgs: the list of changes to make in hardware 2322 + */ 2323 + static enum ice_status 2324 + ice_prof_bld_xlt2(enum ice_block blk, struct ice_buf_build *bld, 2325 + struct list_head *chgs) 2326 + { 2327 + struct ice_chs_chg *tmp; 2328 + 2329 + list_for_each_entry(tmp, chgs, list_entry) { 2330 + struct ice_xlt2_section *p; 2331 + u32 id; 2332 + 2333 + switch (tmp->type) { 2334 + case ICE_VSIG_ADD: 2335 + case ICE_VSI_MOVE: 2336 + case ICE_VSIG_REM: 2337 + id = ice_sect_id(blk, ICE_XLT2); 2338 + p = (struct ice_xlt2_section *) 2339 + ice_pkg_buf_alloc_section(bld, id, sizeof(*p)); 2340 + 2341 + if (!p) 2342 + return ICE_ERR_MAX_LIMIT; 2343 + 2344 + p->count = cpu_to_le16(1); 2345 + p->offset = cpu_to_le16(tmp->vsi); 2346 + p->value[0] = cpu_to_le16(tmp->vsig); 2347 + break; 2348 + default: 2349 + break; 2350 + } 2351 + } 2352 + 2353 + return 0; 2354 + } 2355 + 2356 + /** 2357 + * ice_upd_prof_hw - update hardware using the change list 2358 + * @hw: pointer to the HW struct 2359 + * @blk: hardware block 2360 + * @chgs: the list of changes to make in hardware 2361 + */ 2362 + static enum ice_status 2363 + ice_upd_prof_hw(struct ice_hw *hw, enum ice_block blk, 2364 + struct list_head *chgs) 2365 + { 2366 + struct ice_buf_build *b; 2367 + struct ice_chs_chg *tmp; 2368 + enum ice_status status; 2369 + u16 pkg_sects; 2370 + u16 xlt1 = 0; 2371 + u16 xlt2 = 0; 2372 + u16 tcam = 0; 2373 + u16 es = 0; 2374 + u16 sects; 2375 + 2376 + /* count number of sections we need */ 2377 + list_for_each_entry(tmp, chgs, list_entry) { 2378 + switch (tmp->type) { 2379 + case ICE_PTG_ES_ADD: 2380 + if (tmp->add_ptg) 2381 + xlt1++; 2382 + if (tmp->add_prof) 2383 + es++; 2384 + break; 2385 + case ICE_TCAM_ADD: 2386 + tcam++; 2387 + break; 2388 + case ICE_VSIG_ADD: 2389 + case ICE_VSI_MOVE: 2390 + case ICE_VSIG_REM: 2391 + xlt2++; 2392 + break; 2393 + default: 2394 + break; 2395 + } 2396 + } 2397 + sects = xlt1 + xlt2 + tcam + es; 2398 + 2399 + if (!sects) 2400 + return 0; 2401 + 2402 + /* Build update package buffer */ 2403 + b = ice_pkg_buf_alloc(hw); 2404 + if (!b) 2405 + return ICE_ERR_NO_MEMORY; 2406 + 2407 + status = ice_pkg_buf_reserve_section(b, sects); 2408 + if (status) 2409 + goto error_tmp; 2410 + 2411 + /* Preserve order of table update: ES, TCAM, PTG, VSIG */ 2412 + if (es) { 2413 + status = ice_prof_bld_es(hw, blk, b, chgs); 2414 + if (status) 2415 + goto error_tmp; 2416 + } 2417 + 2418 + if (tcam) { 2419 + status = ice_prof_bld_tcam(hw, blk, b, chgs); 2420 + if (status) 2421 + goto error_tmp; 2422 + } 2423 + 2424 + if (xlt1) { 2425 + status = ice_prof_bld_xlt1(blk, b, chgs); 2426 + if (status) 2427 + goto error_tmp; 2428 + } 2429 + 2430 + if (xlt2) { 2431 + status = ice_prof_bld_xlt2(blk, b, chgs); 2432 + if (status) 2433 + goto error_tmp; 2434 + } 2435 + 2436 + /* After package buffer build check if the section count in buffer is 2437 + * non-zero and matches the number of sections detected for package 2438 + * update. 2439 + */ 2440 + pkg_sects = ice_pkg_buf_get_active_sections(b); 2441 + if (!pkg_sects || pkg_sects != sects) { 2442 + status = ICE_ERR_INVAL_SIZE; 2443 + goto error_tmp; 2444 + } 2445 + 2446 + /* update package */ 2447 + status = ice_update_pkg(hw, ice_pkg_buf(b), 1); 2448 + if (status == ICE_ERR_AQ_ERROR) 2449 + ice_debug(hw, ICE_DBG_INIT, "Unable to update HW profile\n"); 2450 + 2451 + error_tmp: 2452 + ice_pkg_buf_free(hw, b); 2453 + return status; 2454 + } 2455 + 2456 + /** 2565 2457 * ice_add_prof - add profile 2566 2458 * @hw: pointer to the HW struct 2567 2459 * @blk: hardware block ··· 3696 3096 goto err_ice_add_prof_id_flow; 3697 3097 } 3698 3098 } 3099 + 3100 + /* update hardware */ 3101 + if (!status) 3102 + status = ice_upd_prof_hw(hw, blk, &chg); 3699 3103 3700 3104 err_ice_add_prof_id_flow: 3701 3105 list_for_each_entry_safe(del, tmp, &chg, list_entry) {
+46
drivers/net/ethernet/intel/ice/ice_flex_type.h
··· 108 108 sizeof(struct ice_buf_hdr) - (hd_sz)) / (ent_sz)) 109 109 110 110 /* ice package section IDs */ 111 + #define ICE_SID_XLT0_SW 10 112 + #define ICE_SID_XLT_KEY_BUILDER_SW 11 111 113 #define ICE_SID_XLT1_SW 12 112 114 #define ICE_SID_XLT2_SW 13 113 115 #define ICE_SID_PROFID_TCAM_SW 14 114 116 #define ICE_SID_PROFID_REDIR_SW 15 115 117 #define ICE_SID_FLD_VEC_SW 16 118 + #define ICE_SID_CDID_KEY_BUILDER_SW 17 119 + #define ICE_SID_CDID_REDIR_SW 18 116 120 121 + #define ICE_SID_XLT0_ACL 20 122 + #define ICE_SID_XLT_KEY_BUILDER_ACL 21 117 123 #define ICE_SID_XLT1_ACL 22 118 124 #define ICE_SID_XLT2_ACL 23 119 125 #define ICE_SID_PROFID_TCAM_ACL 24 120 126 #define ICE_SID_PROFID_REDIR_ACL 25 121 127 #define ICE_SID_FLD_VEC_ACL 26 128 + #define ICE_SID_CDID_KEY_BUILDER_ACL 27 129 + #define ICE_SID_CDID_REDIR_ACL 28 122 130 131 + #define ICE_SID_XLT0_FD 30 132 + #define ICE_SID_XLT_KEY_BUILDER_FD 31 123 133 #define ICE_SID_XLT1_FD 32 124 134 #define ICE_SID_XLT2_FD 33 125 135 #define ICE_SID_PROFID_TCAM_FD 34 126 136 #define ICE_SID_PROFID_REDIR_FD 35 127 137 #define ICE_SID_FLD_VEC_FD 36 138 + #define ICE_SID_CDID_KEY_BUILDER_FD 37 139 + #define ICE_SID_CDID_REDIR_FD 38 128 140 141 + #define ICE_SID_XLT0_RSS 40 142 + #define ICE_SID_XLT_KEY_BUILDER_RSS 41 129 143 #define ICE_SID_XLT1_RSS 42 130 144 #define ICE_SID_XLT2_RSS 43 131 145 #define ICE_SID_PROFID_TCAM_RSS 44 132 146 #define ICE_SID_PROFID_REDIR_RSS 45 133 147 #define ICE_SID_FLD_VEC_RSS 46 148 + #define ICE_SID_CDID_KEY_BUILDER_RSS 47 149 + #define ICE_SID_CDID_REDIR_RSS 48 134 150 135 151 #define ICE_SID_RXPARSER_BOOST_TCAM 56 136 152 153 + #define ICE_SID_XLT0_PE 80 154 + #define ICE_SID_XLT_KEY_BUILDER_PE 81 137 155 #define ICE_SID_XLT1_PE 82 138 156 #define ICE_SID_XLT2_PE 83 139 157 #define ICE_SID_PROFID_TCAM_PE 84 140 158 #define ICE_SID_PROFID_REDIR_PE 85 141 159 #define ICE_SID_FLD_VEC_PE 86 160 + #define ICE_SID_CDID_KEY_BUILDER_PE 87 161 + #define ICE_SID_CDID_REDIR_PE 88 142 162 143 163 /* Label Metadata section IDs */ 144 164 #define ICE_SID_LBL_FIRST 0x80000010 ··· 173 153 ICE_BLK_RSS, 174 154 ICE_BLK_PE, 175 155 ICE_BLK_COUNT 156 + }; 157 + 158 + enum ice_sect { 159 + ICE_XLT0 = 0, 160 + ICE_XLT_KB, 161 + ICE_XLT1, 162 + ICE_XLT2, 163 + ICE_PROF_TCAM, 164 + ICE_PROF_REDIR, 165 + ICE_VEC_TBL, 166 + ICE_CDID_KB, 167 + ICE_CDID_REDIR, 168 + ICE_SECT_COUNT 176 169 }; 177 170 178 171 /* package labels */ ··· 270 237 u8 redir_value[1]; 271 238 }; 272 239 240 + /* package buffer building */ 241 + 242 + struct ice_buf_build { 243 + struct ice_buf buf; 244 + u16 reserved_section_table_entries; 245 + }; 246 + 273 247 struct ice_pkg_enum { 274 248 struct ice_buf_table *buf_table; 275 249 u32 buf_idx; ··· 289 249 290 250 u32 entry_idx; 291 251 void *(*handler)(u32 sect_type, void *section, u32 index, u32 *offset); 252 + }; 253 + 254 + struct ice_pkg_es { 255 + __le16 count; 256 + __le16 offset; 257 + struct ice_fv_word es[1]; 292 258 }; 293 259 294 260 struct ice_es {