Lines Matching refs:sparx5

168 static void sparx5_vcap_type_err(struct sparx5 *sparx5,  in sparx5_vcap_type_err()  argument
177 static void sparx5_vcap_wait_super_update(struct sparx5 *sparx5) in sparx5_vcap_wait_super_update() argument
183 false, sparx5, VCAP_SUPER_CTRL); in sparx5_vcap_wait_super_update()
187 static void sparx5_vcap_wait_es0_update(struct sparx5 *sparx5) in sparx5_vcap_wait_es0_update() argument
193 false, sparx5, VCAP_ES0_CTRL); in sparx5_vcap_wait_es0_update()
197 static void sparx5_vcap_wait_es2_update(struct sparx5 *sparx5) in sparx5_vcap_wait_es2_update() argument
203 false, sparx5, VCAP_ES2_CTRL); in sparx5_vcap_wait_es2_update()
207 static void _sparx5_vcap_range_init(struct sparx5 *sparx5, in _sparx5_vcap_range_init() argument
218 sparx5, VCAP_SUPER_CFG); in _sparx5_vcap_range_init()
226 sparx5, VCAP_SUPER_CTRL); in _sparx5_vcap_range_init()
227 sparx5_vcap_wait_super_update(sparx5); in _sparx5_vcap_range_init()
232 sparx5, VCAP_ES0_CFG); in _sparx5_vcap_range_init()
240 sparx5, VCAP_ES0_CTRL); in _sparx5_vcap_range_init()
241 sparx5_vcap_wait_es0_update(sparx5); in _sparx5_vcap_range_init()
246 sparx5, VCAP_ES2_CFG); in _sparx5_vcap_range_init()
254 sparx5, VCAP_ES2_CTRL); in _sparx5_vcap_range_init()
255 sparx5_vcap_wait_es2_update(sparx5); in _sparx5_vcap_range_init()
258 sparx5_vcap_type_err(sparx5, admin, __func__); in _sparx5_vcap_range_init()
264 static void sparx5_vcap_block_init(struct sparx5 *sparx5, in sparx5_vcap_block_init() argument
267 _sparx5_vcap_range_init(sparx5, admin, admin->first_valid_addr, in sparx5_vcap_block_init()
278 return vcap_keyset_name(port->sparx5->vcap_ctrl, keyset); in sparx5_vcap_keyset_name()
427 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_is0_get_port_keysets() local
431 value = spx5_rd(sparx5, ANA_CL_ADV_CL_CFG(portno, lookup)); in sparx5_vcap_is0_get_port_keysets()
481 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_is2_get_port_keysets() local
485 value = spx5_rd(sparx5, ANA_ACL_VCAP_S2_KEY_SEL(portno, lookup)); in sparx5_vcap_is2_get_port_keysets()
610 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_es0_get_port_keysets() local
614 value = spx5_rd(sparx5, REW_RTAG_ETAG_CTRL(portno)); in sparx5_vcap_es0_get_port_keysets()
635 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_es2_get_port_keysets() local
639 value = spx5_rd(sparx5, EACL_VCAP_ES2_KEY_SEL(portno, lookup)); in sparx5_vcap_es2_get_port_keysets()
722 sparx5_vcap_type_err(port->sparx5, admin, __func__); in sparx5_vcap_get_port_keyset()
799 sparx5_vcap_type_err(port->sparx5, admin, __func__); in sparx5_vcap_validate_keyset()
904 sparx5_vcap_type_err(port->sparx5, admin, __func__); in sparx5_vcap_add_default_fields()
918 static void sparx5_vcap_is0_cache_write(struct sparx5 *sparx5, in sparx5_vcap_is0_cache_write() argument
935 spx5_wr(keystr[idx] & mskstr[idx], sparx5, in sparx5_vcap_is0_cache_write()
937 spx5_wr(~mskstr[idx], sparx5, in sparx5_vcap_is0_cache_write()
943 spx5_wr(actstr[idx], sparx5, in sparx5_vcap_is0_cache_write()
955 spx5_wr(admin->cache.counter, sparx5, in sparx5_vcap_is0_cache_write()
959 static void sparx5_vcap_is2_cache_write(struct sparx5 *sparx5, in sparx5_vcap_is2_cache_write() argument
976 spx5_wr(keystr[idx] & mskstr[idx], sparx5, in sparx5_vcap_is2_cache_write()
978 spx5_wr(~mskstr[idx], sparx5, in sparx5_vcap_is2_cache_write()
984 spx5_wr(actstr[idx], sparx5, in sparx5_vcap_is2_cache_write()
997 spx5_wr(admin->cache.counter, sparx5, in sparx5_vcap_is2_cache_write()
1000 spx5_wr(admin->cache.counter, sparx5, in sparx5_vcap_is2_cache_write()
1002 spx5_wr(admin->cache.sticky, sparx5, in sparx5_vcap_is2_cache_write()
1008 static void sparx5_es0_write_esdx_counter(struct sparx5 *sparx5, in sparx5_es0_write_esdx_counter() argument
1011 mutex_lock(&sparx5->queue_stats_lock); in sparx5_es0_write_esdx_counter()
1012 spx5_wr(XQS_STAT_CFG_STAT_VIEW_SET(id), sparx5, XQS_STAT_CFG); in sparx5_es0_write_esdx_counter()
1013 spx5_wr(admin->cache.counter, sparx5, in sparx5_es0_write_esdx_counter()
1015 spx5_wr(0, sparx5, XQS_CNT(SPARX5_STAT_ESDX_YEL_PKTS)); in sparx5_es0_write_esdx_counter()
1016 mutex_unlock(&sparx5->queue_stats_lock); in sparx5_es0_write_esdx_counter()
1019 static void sparx5_vcap_es0_cache_write(struct sparx5 *sparx5, in sparx5_vcap_es0_cache_write() argument
1036 spx5_wr(keystr[idx] & mskstr[idx], sparx5, in sparx5_vcap_es0_cache_write()
1038 spx5_wr(~mskstr[idx], sparx5, in sparx5_vcap_es0_cache_write()
1044 spx5_wr(actstr[idx], sparx5, in sparx5_vcap_es0_cache_write()
1055 spx5_wr(admin->cache.counter, sparx5, VCAP_ES0_VCAP_CNT_DAT(0)); in sparx5_vcap_es0_cache_write()
1056 sparx5_es0_write_esdx_counter(sparx5, admin, start); in sparx5_vcap_es0_cache_write()
1060 static void sparx5_vcap_es2_cache_write(struct sparx5 *sparx5, in sparx5_vcap_es2_cache_write() argument
1077 spx5_wr(keystr[idx] & mskstr[idx], sparx5, in sparx5_vcap_es2_cache_write()
1079 spx5_wr(~mskstr[idx], sparx5, in sparx5_vcap_es2_cache_write()
1085 spx5_wr(actstr[idx], sparx5, in sparx5_vcap_es2_cache_write()
1097 spx5_wr(admin->cache.counter, sparx5, EACL_ES2_CNT(start)); in sparx5_vcap_es2_cache_write()
1098 spx5_wr(admin->cache.sticky, sparx5, VCAP_ES2_VCAP_CNT_DAT(0)); in sparx5_vcap_es2_cache_write()
1110 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_cache_write() local
1114 sparx5_vcap_is0_cache_write(sparx5, admin, sel, start, count); in sparx5_vcap_cache_write()
1117 sparx5_vcap_is2_cache_write(sparx5, admin, sel, start, count); in sparx5_vcap_cache_write()
1120 sparx5_vcap_es0_cache_write(sparx5, admin, sel, start, count); in sparx5_vcap_cache_write()
1123 sparx5_vcap_es2_cache_write(sparx5, admin, sel, start, count); in sparx5_vcap_cache_write()
1126 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_cache_write()
1131 static void sparx5_vcap_is0_cache_read(struct sparx5 *sparx5, in sparx5_vcap_is0_cache_read() argument
1146 keystr[idx] = spx5_rd(sparx5, in sparx5_vcap_is0_cache_read()
1148 mskstr[idx] = ~spx5_rd(sparx5, in sparx5_vcap_is0_cache_read()
1155 actstr[idx] = spx5_rd(sparx5, in sparx5_vcap_is0_cache_read()
1160 spx5_rd(sparx5, VCAP_SUPER_VCAP_CNT_DAT(0)); in sparx5_vcap_is0_cache_read()
1162 spx5_rd(sparx5, VCAP_SUPER_VCAP_CNT_DAT(0)); in sparx5_vcap_is0_cache_read()
1166 static void sparx5_vcap_is2_cache_read(struct sparx5 *sparx5, in sparx5_vcap_is2_cache_read() argument
1181 keystr[idx] = spx5_rd(sparx5, in sparx5_vcap_is2_cache_read()
1183 mskstr[idx] = ~spx5_rd(sparx5, in sparx5_vcap_is2_cache_read()
1190 actstr[idx] = spx5_rd(sparx5, in sparx5_vcap_is2_cache_read()
1197 spx5_rd(sparx5, ANA_ACL_CNT_A(start)); in sparx5_vcap_is2_cache_read()
1200 spx5_rd(sparx5, ANA_ACL_CNT_B(start)); in sparx5_vcap_is2_cache_read()
1202 spx5_rd(sparx5, VCAP_SUPER_VCAP_CNT_DAT(0)); in sparx5_vcap_is2_cache_read()
1207 static void sparx5_es0_read_esdx_counter(struct sparx5 *sparx5, in sparx5_es0_read_esdx_counter() argument
1212 mutex_lock(&sparx5->queue_stats_lock); in sparx5_es0_read_esdx_counter()
1213 spx5_wr(XQS_STAT_CFG_STAT_VIEW_SET(id), sparx5, XQS_STAT_CFG); in sparx5_es0_read_esdx_counter()
1214 counter = spx5_rd(sparx5, XQS_CNT(SPARX5_STAT_ESDX_GRN_PKTS)) + in sparx5_es0_read_esdx_counter()
1215 spx5_rd(sparx5, XQS_CNT(SPARX5_STAT_ESDX_YEL_PKTS)); in sparx5_es0_read_esdx_counter()
1216 mutex_unlock(&sparx5->queue_stats_lock); in sparx5_es0_read_esdx_counter()
1221 static void sparx5_vcap_es0_cache_read(struct sparx5 *sparx5, in sparx5_vcap_es0_cache_read() argument
1237 spx5_rd(sparx5, VCAP_ES0_VCAP_ENTRY_DAT(idx)); in sparx5_vcap_es0_cache_read()
1239 ~spx5_rd(sparx5, VCAP_ES0_VCAP_MASK_DAT(idx)); in sparx5_vcap_es0_cache_read()
1246 spx5_rd(sparx5, VCAP_ES0_VCAP_ACTION_DAT(idx)); in sparx5_vcap_es0_cache_read()
1250 spx5_rd(sparx5, VCAP_ES0_VCAP_CNT_DAT(0)); in sparx5_vcap_es0_cache_read()
1252 sparx5_es0_read_esdx_counter(sparx5, admin, start); in sparx5_vcap_es0_cache_read()
1256 static void sparx5_vcap_es2_cache_read(struct sparx5 *sparx5, in sparx5_vcap_es2_cache_read() argument
1272 spx5_rd(sparx5, VCAP_ES2_VCAP_ENTRY_DAT(idx)); in sparx5_vcap_es2_cache_read()
1274 ~spx5_rd(sparx5, VCAP_ES2_VCAP_MASK_DAT(idx)); in sparx5_vcap_es2_cache_read()
1281 spx5_rd(sparx5, VCAP_ES2_VCAP_ACTION_DAT(idx)); in sparx5_vcap_es2_cache_read()
1286 spx5_rd(sparx5, EACL_ES2_CNT(start)); in sparx5_vcap_es2_cache_read()
1288 spx5_rd(sparx5, VCAP_ES2_VCAP_CNT_DAT(0)); in sparx5_vcap_es2_cache_read()
1300 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_cache_read() local
1304 sparx5_vcap_is0_cache_read(sparx5, admin, sel, start, count); in sparx5_vcap_cache_read()
1307 sparx5_vcap_is2_cache_read(sparx5, admin, sel, start, count); in sparx5_vcap_cache_read()
1310 sparx5_vcap_es0_cache_read(sparx5, admin, sel, start, count); in sparx5_vcap_cache_read()
1313 sparx5_vcap_es2_cache_read(sparx5, admin, sel, start, count); in sparx5_vcap_cache_read()
1316 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_cache_read()
1327 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_range_init() local
1329 _sparx5_vcap_range_init(sparx5, admin, addr, count); in sparx5_vcap_range_init()
1332 static void sparx5_vcap_super_update(struct sparx5 *sparx5, in sparx5_vcap_super_update() argument
1339 VCAP_SUPER_CFG_MV_SIZE_SET(0), sparx5, VCAP_SUPER_CFG); in sparx5_vcap_super_update()
1347 sparx5, VCAP_SUPER_CTRL); in sparx5_vcap_super_update()
1348 sparx5_vcap_wait_super_update(sparx5); in sparx5_vcap_super_update()
1351 static void sparx5_vcap_es0_update(struct sparx5 *sparx5, in sparx5_vcap_es0_update() argument
1358 VCAP_ES0_CFG_MV_SIZE_SET(0), sparx5, VCAP_ES0_CFG); in sparx5_vcap_es0_update()
1366 sparx5, VCAP_ES0_CTRL); in sparx5_vcap_es0_update()
1367 sparx5_vcap_wait_es0_update(sparx5); in sparx5_vcap_es0_update()
1370 static void sparx5_vcap_es2_update(struct sparx5 *sparx5, in sparx5_vcap_es2_update() argument
1377 VCAP_ES2_CFG_MV_SIZE_SET(0), sparx5, VCAP_ES2_CFG); in sparx5_vcap_es2_update()
1385 sparx5, VCAP_ES2_CTRL); in sparx5_vcap_es2_update()
1386 sparx5_vcap_wait_es2_update(sparx5); in sparx5_vcap_es2_update()
1395 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_update() local
1400 sparx5_vcap_super_update(sparx5, cmd, sel, addr); in sparx5_vcap_update()
1403 sparx5_vcap_es0_update(sparx5, cmd, sel, addr); in sparx5_vcap_update()
1406 sparx5_vcap_es2_update(sparx5, cmd, sel, addr); in sparx5_vcap_update()
1409 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_update()
1414 static void sparx5_vcap_super_move(struct sparx5 *sparx5, in sparx5_vcap_super_move() argument
1422 sparx5, VCAP_SUPER_CFG); in sparx5_vcap_super_move()
1430 sparx5, VCAP_SUPER_CTRL); in sparx5_vcap_super_move()
1431 sparx5_vcap_wait_super_update(sparx5); in sparx5_vcap_super_move()
1434 static void sparx5_vcap_es0_move(struct sparx5 *sparx5, in sparx5_vcap_es0_move() argument
1442 sparx5, VCAP_ES0_CFG); in sparx5_vcap_es0_move()
1450 sparx5, VCAP_ES0_CTRL); in sparx5_vcap_es0_move()
1451 sparx5_vcap_wait_es0_update(sparx5); in sparx5_vcap_es0_move()
1454 static void sparx5_vcap_es2_move(struct sparx5 *sparx5, in sparx5_vcap_es2_move() argument
1462 sparx5, VCAP_ES2_CFG); in sparx5_vcap_es2_move()
1470 sparx5, VCAP_ES2_CTRL); in sparx5_vcap_es2_move()
1471 sparx5_vcap_wait_es2_update(sparx5); in sparx5_vcap_es2_move()
1479 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_move() local
1496 sparx5_vcap_super_move(sparx5, addr, cmd, mv_num_pos, mv_size); in sparx5_vcap_move()
1499 sparx5_vcap_es0_move(sparx5, addr, cmd, mv_num_pos, mv_size); in sparx5_vcap_move()
1502 sparx5_vcap_es2_move(sparx5, addr, cmd, mv_num_pos, mv_size); in sparx5_vcap_move()
1505 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_move()
1539 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_is0_set_port_keyset() local
1548 sparx5, in sparx5_vcap_is0_set_port_keyset()
1555 sparx5, in sparx5_vcap_is0_set_port_keyset()
1562 sparx5, in sparx5_vcap_is0_set_port_keyset()
1628 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_is2_set_port_keyset() local
1637 sparx5, in sparx5_vcap_is2_set_port_keyset()
1644 sparx5, in sparx5_vcap_is2_set_port_keyset()
1648 sparx5, in sparx5_vcap_is2_set_port_keyset()
1655 sparx5, in sparx5_vcap_is2_set_port_keyset()
1660 sparx5, in sparx5_vcap_is2_set_port_keyset()
1667 sparx5, in sparx5_vcap_is2_set_port_keyset()
1721 struct sparx5 *sparx5 = port->sparx5; in sparx5_vcap_es2_set_port_keyset() local
1730 sparx5, in sparx5_vcap_es2_set_port_keyset()
1737 sparx5, in sparx5_vcap_es2_set_port_keyset()
1744 sparx5, in sparx5_vcap_es2_set_port_keyset()
1787 sparx5_vcap_type_err(port->sparx5, admin, __func__); in sparx5_vcap_set_port_keyset()
1793 static void sparx5_vcap_is0_port_key_selection(struct sparx5 *sparx5, in sparx5_vcap_is0_port_key_selection() argument
1808 spx5_wr(keysel, sparx5, in sparx5_vcap_is0_port_key_selection()
1812 sparx5, in sparx5_vcap_is0_port_key_selection()
1819 static void sparx5_vcap_is2_port_key_selection(struct sparx5 *sparx5, in sparx5_vcap_is2_port_key_selection() argument
1833 spx5_wr(keysel, sparx5, in sparx5_vcap_is2_port_key_selection()
1841 sparx5, in sparx5_vcap_is2_port_key_selection()
1846 static void sparx5_vcap_es0_port_key_selection(struct sparx5 *sparx5, in sparx5_vcap_es0_port_key_selection() argument
1855 sparx5, REW_RTAG_ETAG_CTRL(portno)); in sparx5_vcap_es0_port_key_selection()
1858 sparx5, REW_ES0_CTRL); in sparx5_vcap_es0_port_key_selection()
1862 static void sparx5_vcap_es2_port_key_selection(struct sparx5 *sparx5, in sparx5_vcap_es2_port_key_selection() argument
1873 spx5_wr(keysel, sparx5, in sparx5_vcap_es2_port_key_selection()
1878 static void sparx5_vcap_port_key_selection(struct sparx5 *sparx5, in sparx5_vcap_port_key_selection() argument
1883 sparx5_vcap_is0_port_key_selection(sparx5, admin); in sparx5_vcap_port_key_selection()
1886 sparx5_vcap_is2_port_key_selection(sparx5, admin); in sparx5_vcap_port_key_selection()
1889 sparx5_vcap_es0_port_key_selection(sparx5, admin); in sparx5_vcap_port_key_selection()
1892 sparx5_vcap_es2_port_key_selection(sparx5, admin); in sparx5_vcap_port_key_selection()
1895 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_port_key_selection()
1901 static void sparx5_vcap_port_key_deselection(struct sparx5 *sparx5, in sparx5_vcap_port_key_deselection() argument
1912 sparx5, in sparx5_vcap_port_key_deselection()
1919 sparx5, in sparx5_vcap_port_key_deselection()
1924 REW_ES0_CTRL_ES0_LU_ENA, sparx5, REW_ES0_CTRL); in sparx5_vcap_port_key_deselection()
1931 sparx5, in sparx5_vcap_port_key_deselection()
1935 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_port_key_deselection()
1953 sparx5_vcap_admin_alloc(struct sparx5 *sparx5, struct vcap_control *ctrl, in sparx5_vcap_admin_alloc() argument
1987 static void sparx5_vcap_block_alloc(struct sparx5 *sparx5, in sparx5_vcap_block_alloc() argument
2002 spx5_wr(VCAP_SUPER_IDX_CORE_IDX_SET(idx), sparx5, in sparx5_vcap_block_alloc()
2005 sparx5, VCAP_SUPER_MAP); in sparx5_vcap_block_alloc()
2016 cores = spx5_rd(sparx5, VCAP_ES0_CORE_CNT); in sparx5_vcap_block_alloc()
2018 spx5_wr(VCAP_ES0_IDX_CORE_IDX_SET(idx), sparx5, in sparx5_vcap_block_alloc()
2020 spx5_wr(VCAP_ES0_MAP_CORE_MAP_SET(1), sparx5, in sparx5_vcap_block_alloc()
2028 cores = spx5_rd(sparx5, VCAP_ES2_CORE_CNT); in sparx5_vcap_block_alloc()
2030 spx5_wr(VCAP_ES2_IDX_CORE_IDX_SET(idx), sparx5, in sparx5_vcap_block_alloc()
2032 spx5_wr(VCAP_ES2_MAP_CORE_MAP_SET(1), sparx5, in sparx5_vcap_block_alloc()
2037 sparx5_vcap_type_err(sparx5, admin, __func__); in sparx5_vcap_block_alloc()
2043 int sparx5_vcap_init(struct sparx5 *sparx5) in sparx5_vcap_init() argument
2064 sparx5->vcap_ctrl = ctrl; in sparx5_vcap_init()
2074 admin = sparx5_vcap_admin_alloc(sparx5, ctrl, cfg); in sparx5_vcap_init()
2081 sparx5_vcap_block_alloc(sparx5, admin, cfg); in sparx5_vcap_init()
2082 sparx5_vcap_block_init(sparx5, admin); in sparx5_vcap_init()
2084 sparx5_vcap_port_key_selection(sparx5, admin); in sparx5_vcap_init()
2087 dir = vcap_debugfs(sparx5->dev, sparx5->debugfs_root, ctrl); in sparx5_vcap_init()
2089 if (sparx5->ports[idx]) in sparx5_vcap_init()
2090 vcap_port_debugfs(sparx5->dev, dir, ctrl, in sparx5_vcap_init()
2091 sparx5->ports[idx]->ndev); in sparx5_vcap_init()
2096 void sparx5_vcap_destroy(struct sparx5 *sparx5) in sparx5_vcap_destroy() argument
2098 struct vcap_control *ctrl = sparx5->vcap_ctrl; in sparx5_vcap_destroy()
2105 sparx5_vcap_port_key_deselection(sparx5, admin); in sparx5_vcap_destroy()