Lines Matching refs:txsc

99 	struct cn10k_mcs_txsc *txsc;  in cn10k_mcs_get_txsc()  local
101 list_for_each_entry(txsc, &cfg->txsc_list, entry) { in cn10k_mcs_get_txsc()
102 if (txsc->sw_secy == secy) in cn10k_mcs_get_txsc()
103 return txsc; in cn10k_mcs_get_txsc()
499 struct cn10k_mcs_txsc *txsc) in cn10k_mcs_write_tx_secy() argument
513 tag_offset = txsc->vlan_dev ? 16 : 12; in cn10k_mcs_write_tx_secy()
569 req->secy_id = txsc->hw_secy_id_tx; in cn10k_mcs_write_tx_secy()
581 struct cn10k_mcs_txsc *txsc) in cn10k_mcs_write_tx_flowid() argument
610 req->flow_id = txsc->hw_flow_id; in cn10k_mcs_write_tx_flowid()
611 req->secy_id = txsc->hw_secy_id_tx; in cn10k_mcs_write_tx_flowid()
612 req->sc_id = txsc->hw_sc_id; in cn10k_mcs_write_tx_flowid()
627 struct cn10k_mcs_txsc *txsc, in cn10k_mcs_link_tx_sa2sc() argument
635 if (txsc->encoding_sa != sa_num) in cn10k_mcs_link_tx_sa2sc()
647 map_req->sa_index0 = txsc->hw_sa_id[sa_num]; in cn10k_mcs_link_tx_sa2sc()
650 map_req->sc_id = txsc->hw_sc_id; in cn10k_mcs_link_tx_sa2sc()
661 struct cn10k_mcs_txsc *txsc, in cn10k_mcs_write_tx_sa_plcy() argument
665 u8 *sak = txsc->sa_key[assoc_num]; in cn10k_mcs_write_tx_sa_plcy()
666 u8 *salt = txsc->salt[assoc_num]; in cn10k_mcs_write_tx_sa_plcy()
679 salt, txsc->ssci[assoc_num]); in cn10k_mcs_write_tx_sa_plcy()
684 plcy_req->sa_index[0] = txsc->hw_sa_id[assoc_num]; in cn10k_mcs_write_tx_sa_plcy()
696 struct cn10k_mcs_txsc *txsc, in cn10k_write_tx_sa_pn() argument
711 req->pn_id = txsc->hw_sa_id[assoc_num]; in cn10k_write_tx_sa_pn()
915 struct cn10k_mcs_txsc *txsc; in cn10k_mcs_create_txsc() local
918 txsc = kzalloc(sizeof(*txsc), GFP_KERNEL); in cn10k_mcs_create_txsc()
919 if (!txsc) in cn10k_mcs_create_txsc()
923 &txsc->hw_flow_id); in cn10k_mcs_create_txsc()
929 &txsc->hw_secy_id_tx); in cn10k_mcs_create_txsc()
934 &txsc->hw_secy_id_rx); in cn10k_mcs_create_txsc()
939 &txsc->hw_sc_id); in cn10k_mcs_create_txsc()
943 return txsc; in cn10k_mcs_create_txsc()
946 txsc->hw_secy_id_rx, false); in cn10k_mcs_create_txsc()
949 txsc->hw_secy_id_tx, false); in cn10k_mcs_create_txsc()
952 txsc->hw_flow_id, false); in cn10k_mcs_create_txsc()
954 kfree(txsc); in cn10k_mcs_create_txsc()
961 struct cn10k_mcs_txsc *txsc) in cn10k_mcs_delete_txsc() argument
963 u8 sa_bmap = txsc->sa_bmap; in cn10k_mcs_delete_txsc()
968 cn10k_mcs_write_tx_sa_plcy(pfvf, txsc->sw_secy, in cn10k_mcs_delete_txsc()
969 txsc, sa_num); in cn10k_mcs_delete_txsc()
970 cn10k_mcs_free_txsa(pfvf, txsc->hw_sa_id[sa_num]); in cn10k_mcs_delete_txsc()
977 txsc->hw_sc_id, false); in cn10k_mcs_delete_txsc()
979 txsc->hw_secy_id_rx, false); in cn10k_mcs_delete_txsc()
981 txsc->hw_secy_id_tx, false); in cn10k_mcs_delete_txsc()
983 txsc->hw_flow_id, false); in cn10k_mcs_delete_txsc()
1039 struct cn10k_mcs_txsc *txsc, in cn10k_mcs_secy_tx_cfg() argument
1043 cn10k_mcs_write_tx_sa_plcy(pfvf, secy, txsc, sa_num); in cn10k_mcs_secy_tx_cfg()
1044 cn10k_write_tx_sa_pn(pfvf, txsc, sa_num, sw_tx_sa->next_pn); in cn10k_mcs_secy_tx_cfg()
1045 cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc, sa_num, in cn10k_mcs_secy_tx_cfg()
1049 cn10k_mcs_write_tx_secy(pfvf, secy, txsc); in cn10k_mcs_secy_tx_cfg()
1050 cn10k_mcs_write_tx_flowid(pfvf, secy, txsc); in cn10k_mcs_secy_tx_cfg()
1052 cn10k_mcs_write_rx_secy(pfvf, secy, txsc->hw_secy_id_rx); in cn10k_mcs_secy_tx_cfg()
1121 struct cn10k_mcs_txsc *txsc) in cn10k_mcs_sync_stats() argument
1134 if (secy->validate_frames == txsc->last_validate_frames && in cn10k_mcs_sync_stats()
1135 secy->replay_protect == txsc->last_replay_protect) in cn10k_mcs_sync_stats()
1138 cn10k_mcs_secy_stats(pfvf, txsc->hw_secy_id_rx, &rx_rsp, MCS_RX, true); in cn10k_mcs_sync_stats()
1140 txsc->stats.InPktsBadTag += rx_rsp.pkt_badtag_cnt; in cn10k_mcs_sync_stats()
1141 txsc->stats.InPktsUnknownSCI += rx_rsp.pkt_nosa_cnt; in cn10k_mcs_sync_stats()
1142 txsc->stats.InPktsNoSCI += rx_rsp.pkt_nosaerror_cnt; in cn10k_mcs_sync_stats()
1143 if (txsc->last_validate_frames == MACSEC_VALIDATE_STRICT) in cn10k_mcs_sync_stats()
1144 txsc->stats.InPktsNoTag += rx_rsp.pkt_untaged_cnt; in cn10k_mcs_sync_stats()
1146 txsc->stats.InPktsUntagged += rx_rsp.pkt_untaged_cnt; in cn10k_mcs_sync_stats()
1157 if (txsc->last_replay_protect) in cn10k_mcs_sync_stats()
1162 if (txsc->last_validate_frames == MACSEC_VALIDATE_DISABLED) in cn10k_mcs_sync_stats()
1168 txsc->last_validate_frames = secy->validate_frames; in cn10k_mcs_sync_stats()
1169 txsc->last_replay_protect = secy->replay_protect; in cn10k_mcs_sync_stats()
1178 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_open() local
1182 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_open()
1183 if (!txsc) in cn10k_mdo_open()
1186 sa_num = txsc->encoding_sa; in cn10k_mdo_open()
1189 err = cn10k_mcs_secy_tx_cfg(pfvf, secy, txsc, sw_tx_sa, sa_num); in cn10k_mdo_open()
1193 return cn10k_mcs_secy_rx_cfg(pfvf, secy, txsc->hw_secy_id_rx); in cn10k_mdo_open()
1200 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_stop() local
1203 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_stop()
1204 if (!txsc) in cn10k_mdo_stop()
1207 err = cn10k_mcs_ena_dis_flowid(pfvf, txsc->hw_flow_id, false, MCS_TX); in cn10k_mdo_stop()
1219 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_add_secy() local
1224 txsc = cn10k_mcs_create_txsc(pfvf); in cn10k_mdo_add_secy()
1225 if (IS_ERR(txsc)) in cn10k_mdo_add_secy()
1228 txsc->sw_secy = secy; in cn10k_mdo_add_secy()
1229 txsc->encoding_sa = secy->tx_sc.encoding_sa; in cn10k_mdo_add_secy()
1230 txsc->last_validate_frames = secy->validate_frames; in cn10k_mdo_add_secy()
1231 txsc->last_replay_protect = secy->replay_protect; in cn10k_mdo_add_secy()
1232 txsc->vlan_dev = is_vlan_dev(ctx->netdev); in cn10k_mdo_add_secy()
1234 list_add(&txsc->entry, &cfg->txsc_list); in cn10k_mdo_add_secy()
1237 return cn10k_mcs_secy_tx_cfg(pfvf, secy, txsc, NULL, 0); in cn10k_mdo_add_secy()
1248 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_upd_secy() local
1253 txsc = cn10k_mcs_get_txsc(cfg, secy); in cn10k_mdo_upd_secy()
1254 if (!txsc) in cn10k_mdo_upd_secy()
1258 if (txsc->encoding_sa != secy->tx_sc.encoding_sa) { in cn10k_mdo_upd_secy()
1259 txsc->encoding_sa = secy->tx_sc.encoding_sa; in cn10k_mdo_upd_secy()
1260 sa_num = txsc->encoding_sa; in cn10k_mdo_upd_secy()
1263 cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc, sa_num, active); in cn10k_mdo_upd_secy()
1267 cn10k_mcs_sync_stats(pfvf, secy, txsc); in cn10k_mdo_upd_secy()
1269 err = cn10k_mcs_secy_tx_cfg(pfvf, secy, txsc, NULL, 0); in cn10k_mdo_upd_secy()
1281 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_del_secy() local
1283 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_del_secy()
1284 if (!txsc) in cn10k_mdo_del_secy()
1287 cn10k_mcs_ena_dis_flowid(pfvf, txsc->hw_flow_id, false, MCS_TX); in cn10k_mdo_del_secy()
1289 cn10k_mcs_delete_txsc(pfvf, txsc); in cn10k_mdo_del_secy()
1290 list_del(&txsc->entry); in cn10k_mdo_del_secy()
1291 kfree(txsc); in cn10k_mdo_del_secy()
1303 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_add_txsa() local
1306 txsc = cn10k_mcs_get_txsc(cfg, secy); in cn10k_mdo_add_txsa()
1307 if (!txsc) in cn10k_mdo_add_txsa()
1313 if (cn10k_mcs_alloc_txsa(pfvf, &txsc->hw_sa_id[sa_num])) in cn10k_mdo_add_txsa()
1316 memcpy(&txsc->sa_key[sa_num], ctx->sa.key, secy->key_len); in cn10k_mdo_add_txsa()
1317 memcpy(&txsc->salt[sa_num], sw_tx_sa->key.salt.bytes, MACSEC_SALT_LEN); in cn10k_mdo_add_txsa()
1318 txsc->ssci[sa_num] = sw_tx_sa->ssci; in cn10k_mdo_add_txsa()
1320 txsc->sa_bmap |= 1 << sa_num; in cn10k_mdo_add_txsa()
1323 err = cn10k_mcs_write_tx_sa_plcy(pfvf, secy, txsc, sa_num); in cn10k_mdo_add_txsa()
1327 err = cn10k_write_tx_sa_pn(pfvf, txsc, sa_num, in cn10k_mdo_add_txsa()
1332 err = cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc, in cn10k_mdo_add_txsa()
1348 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_upd_txsa() local
1351 txsc = cn10k_mcs_get_txsc(cfg, secy); in cn10k_mdo_upd_txsa()
1352 if (!txsc) in cn10k_mdo_upd_txsa()
1361 err = cn10k_write_tx_sa_pn(pfvf, txsc, sa_num, in cn10k_mdo_upd_txsa()
1367 err = cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc, in cn10k_mdo_upd_txsa()
1381 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_del_txsa() local
1383 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_del_txsa()
1384 if (!txsc) in cn10k_mdo_del_txsa()
1390 cn10k_mcs_free_txsa(pfvf, txsc->hw_sa_id[sa_num]); in cn10k_mdo_del_txsa()
1391 txsc->sa_bmap &= ~(1 << sa_num); in cn10k_mdo_del_txsa()
1402 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_add_rxsc() local
1405 txsc = cn10k_mcs_get_txsc(cfg, secy); in cn10k_mdo_add_rxsc()
1406 if (!txsc) in cn10k_mdo_add_rxsc()
1418 err = cn10k_mcs_write_rx_flowid(pfvf, rxsc, txsc->hw_secy_id_rx); in cn10k_mdo_add_rxsc()
1422 err = cn10k_mcs_write_sc_cam(pfvf, rxsc, txsc->hw_secy_id_rx); in cn10k_mdo_add_rxsc()
1575 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_get_dev_stats() local
1577 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_get_dev_stats()
1578 if (!txsc) in cn10k_mdo_get_dev_stats()
1581 cn10k_mcs_secy_stats(pfvf, txsc->hw_secy_id_tx, &tx_rsp, MCS_TX, false); in cn10k_mdo_get_dev_stats()
1585 cn10k_mcs_secy_stats(pfvf, txsc->hw_secy_id_rx, &rx_rsp, MCS_RX, true); in cn10k_mdo_get_dev_stats()
1586 txsc->stats.InPktsBadTag += rx_rsp.pkt_badtag_cnt; in cn10k_mdo_get_dev_stats()
1587 txsc->stats.InPktsUnknownSCI += rx_rsp.pkt_nosa_cnt; in cn10k_mdo_get_dev_stats()
1588 txsc->stats.InPktsNoSCI += rx_rsp.pkt_nosaerror_cnt; in cn10k_mdo_get_dev_stats()
1590 txsc->stats.InPktsNoTag += rx_rsp.pkt_untaged_cnt; in cn10k_mdo_get_dev_stats()
1592 txsc->stats.InPktsUntagged += rx_rsp.pkt_untaged_cnt; in cn10k_mdo_get_dev_stats()
1593 txsc->stats.InPktsOverrun = 0; in cn10k_mdo_get_dev_stats()
1595 ctx->stats.dev_stats->InPktsNoTag = txsc->stats.InPktsNoTag; in cn10k_mdo_get_dev_stats()
1596 ctx->stats.dev_stats->InPktsUntagged = txsc->stats.InPktsUntagged; in cn10k_mdo_get_dev_stats()
1597 ctx->stats.dev_stats->InPktsBadTag = txsc->stats.InPktsBadTag; in cn10k_mdo_get_dev_stats()
1598 ctx->stats.dev_stats->InPktsUnknownSCI = txsc->stats.InPktsUnknownSCI; in cn10k_mdo_get_dev_stats()
1599 ctx->stats.dev_stats->InPktsNoSCI = txsc->stats.InPktsNoSCI; in cn10k_mdo_get_dev_stats()
1600 ctx->stats.dev_stats->InPktsOverrun = txsc->stats.InPktsOverrun; in cn10k_mdo_get_dev_stats()
1610 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_get_tx_sc_stats() local
1612 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_get_tx_sc_stats()
1613 if (!txsc) in cn10k_mdo_get_tx_sc_stats()
1616 cn10k_mcs_sc_stats(pfvf, txsc->hw_sc_id, &rsp, MCS_TX, false); in cn10k_mdo_get_tx_sc_stats()
1632 struct cn10k_mcs_txsc *txsc; in cn10k_mdo_get_tx_sa_stats() local
1634 txsc = cn10k_mcs_get_txsc(cfg, ctx->secy); in cn10k_mdo_get_tx_sa_stats()
1635 if (!txsc) in cn10k_mdo_get_tx_sa_stats()
1641 cn10k_mcs_sa_stats(pfvf, txsc->hw_sa_id[sa_num], &rsp, MCS_TX, false); in cn10k_mdo_get_tx_sa_stats()
1745 struct cn10k_mcs_txsc *txsc; in cn10k_handle_mcs_event() local
1755 list_for_each_entry(txsc, &cfg->txsc_list, entry) { in cn10k_handle_mcs_event()
1757 if (txsc->hw_sa_id[an] == event->sa_id) { in cn10k_handle_mcs_event()
1758 secy = txsc->sw_secy; in cn10k_handle_mcs_event()