Lines Matching refs:rxsc
62 struct cn10k_mcs_rxsc *rxsc; in cn10k_mcs_get_rxsc() local
64 list_for_each_entry(rxsc, &cfg->rxsc_list, entry) { in cn10k_mcs_get_rxsc()
65 if (rxsc->sw_rxsc == rx_sc && rxsc->sw_secy == secy) in cn10k_mcs_get_rxsc()
66 return rxsc; in cn10k_mcs_get_rxsc()
237 struct cn10k_mcs_rxsc *rxsc, u8 hw_secy_id) in cn10k_mcs_write_rx_flowid() argument
239 struct macsec_rx_sc *sw_rx_sc = rxsc->sw_rxsc; in cn10k_mcs_write_rx_flowid()
260 req->flow_id = rxsc->hw_flow_id; in cn10k_mcs_write_rx_flowid()
262 req->sc_id = rxsc->hw_sc_id; in cn10k_mcs_write_rx_flowid()
276 struct cn10k_mcs_rxsc *rxsc, u8 hw_secy_id) in cn10k_mcs_write_sc_cam() argument
278 struct macsec_rx_sc *sw_rx_sc = rxsc->sw_rxsc; in cn10k_mcs_write_sc_cam()
292 sc_req->sc_id = rxsc->hw_sc_id; in cn10k_mcs_write_sc_cam()
304 struct cn10k_mcs_rxsc *rxsc, in cn10k_mcs_write_rx_sa_plcy() argument
307 unsigned char *src = rxsc->sa_key[assoc_num]; in cn10k_mcs_write_rx_sa_plcy()
335 plcy_req->sa_index[0] = rxsc->hw_sa_id[assoc_num]; in cn10k_mcs_write_rx_sa_plcy()
339 map_req->sa_index = rxsc->hw_sa_id[assoc_num]; in cn10k_mcs_write_rx_sa_plcy()
341 map_req->sc_id = rxsc->hw_sc_id; in cn10k_mcs_write_rx_sa_plcy()
353 struct cn10k_mcs_rxsc *rxsc, in cn10k_mcs_write_rx_sa_pn() argument
368 req->pn_id = rxsc->hw_sa_id[assoc_num]; in cn10k_mcs_write_rx_sa_pn()
852 struct cn10k_mcs_rxsc *rxsc; in cn10k_mcs_create_rxsc() local
855 rxsc = kzalloc(sizeof(*rxsc), GFP_KERNEL); in cn10k_mcs_create_rxsc()
856 if (!rxsc) in cn10k_mcs_create_rxsc()
860 &rxsc->hw_flow_id); in cn10k_mcs_create_rxsc()
865 &rxsc->hw_sc_id); in cn10k_mcs_create_rxsc()
869 return rxsc; in cn10k_mcs_create_rxsc()
872 rxsc->hw_flow_id, false); in cn10k_mcs_create_rxsc()
874 kfree(rxsc); in cn10k_mcs_create_rxsc()
881 struct cn10k_mcs_rxsc *rxsc) in cn10k_mcs_delete_rxsc() argument
883 u8 sa_bmap = rxsc->sa_bmap; in cn10k_mcs_delete_rxsc()
888 cn10k_mcs_write_rx_sa_plcy(pfvf, rxsc->sw_secy, rxsc, in cn10k_mcs_delete_rxsc()
890 cn10k_mcs_free_rxsa(pfvf, rxsc->hw_sa_id[sa_num]); in cn10k_mcs_delete_rxsc()
897 rxsc->hw_sc_id, false); in cn10k_mcs_delete_rxsc()
899 rxsc->hw_flow_id, false); in cn10k_mcs_delete_rxsc()
991 struct cn10k_mcs_rxsc *rxsc; in cn10k_mcs_sync_stats() local
1013 list_for_each_entry(rxsc, &cfg->rxsc_list, entry) { in cn10k_mcs_sync_stats()
1014 cn10k_mcs_sc_stats(pfvf, rxsc->hw_sc_id, &sc_rsp, MCS_RX, true); in cn10k_mcs_sync_stats()
1016 rxsc->stats.InOctetsValidated += sc_rsp.octet_validate_cnt; in cn10k_mcs_sync_stats()
1017 rxsc->stats.InOctetsDecrypted += sc_rsp.octet_decrypt_cnt; in cn10k_mcs_sync_stats()
1019 rxsc->stats.InPktsInvalid += sc_rsp.pkt_invalid_cnt; in cn10k_mcs_sync_stats()
1020 rxsc->stats.InPktsNotValid += sc_rsp.pkt_notvalid_cnt; in cn10k_mcs_sync_stats()
1023 rxsc->stats.InPktsLate += sc_rsp.pkt_late_cnt; in cn10k_mcs_sync_stats()
1025 rxsc->stats.InPktsDelayed += sc_rsp.pkt_late_cnt; in cn10k_mcs_sync_stats()
1028 rxsc->stats.InPktsUnchecked += sc_rsp.pkt_unchecked_cnt; in cn10k_mcs_sync_stats()
1030 rxsc->stats.InPktsOK += sc_rsp.pkt_unchecked_cnt; in cn10k_mcs_sync_stats()
1262 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_add_rxsc() local
1270 rxsc = cn10k_mcs_create_rxsc(pfvf); in cn10k_mdo_add_rxsc()
1271 if (IS_ERR(rxsc)) in cn10k_mdo_add_rxsc()
1274 rxsc->sw_secy = ctx->secy; in cn10k_mdo_add_rxsc()
1275 rxsc->sw_rxsc = ctx->rx_sc; in cn10k_mdo_add_rxsc()
1276 list_add(&rxsc->entry, &cfg->rxsc_list); in cn10k_mdo_add_rxsc()
1279 err = cn10k_mcs_write_rx_flowid(pfvf, rxsc, txsc->hw_secy_id_rx); in cn10k_mdo_add_rxsc()
1283 err = cn10k_mcs_write_sc_cam(pfvf, rxsc, txsc->hw_secy_id_rx); in cn10k_mdo_add_rxsc()
1297 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_upd_rxsc() local
1299 rxsc = cn10k_mcs_get_rxsc(cfg, secy, ctx->rx_sc); in cn10k_mdo_upd_rxsc()
1300 if (!rxsc) in cn10k_mdo_upd_rxsc()
1304 return cn10k_mcs_ena_dis_flowid(pfvf, rxsc->hw_flow_id, in cn10k_mdo_upd_rxsc()
1314 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_del_rxsc() local
1316 rxsc = cn10k_mcs_get_rxsc(cfg, ctx->secy, ctx->rx_sc); in cn10k_mdo_del_rxsc()
1317 if (!rxsc) in cn10k_mdo_del_rxsc()
1320 cn10k_mcs_ena_dis_flowid(pfvf, rxsc->hw_flow_id, false, MCS_RX); in cn10k_mdo_del_rxsc()
1321 cn10k_mcs_delete_rxsc(pfvf, rxsc); in cn10k_mdo_del_rxsc()
1322 list_del(&rxsc->entry); in cn10k_mdo_del_rxsc()
1323 kfree(rxsc); in cn10k_mdo_del_rxsc()
1338 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_add_rxsa() local
1341 rxsc = cn10k_mcs_get_rxsc(cfg, secy, sw_rx_sc); in cn10k_mdo_add_rxsa()
1342 if (!rxsc) in cn10k_mdo_add_rxsa()
1348 if (cn10k_mcs_alloc_rxsa(pfvf, &rxsc->hw_sa_id[sa_num])) in cn10k_mdo_add_rxsa()
1351 memcpy(&rxsc->sa_key[sa_num], ctx->sa.key, ctx->secy->key_len); in cn10k_mdo_add_rxsa()
1352 rxsc->sa_bmap |= 1 << sa_num; in cn10k_mdo_add_rxsa()
1355 err = cn10k_mcs_write_rx_sa_plcy(pfvf, secy, rxsc, in cn10k_mdo_add_rxsa()
1360 err = cn10k_mcs_write_rx_sa_pn(pfvf, rxsc, sa_num, next_pn); in cn10k_mdo_add_rxsa()
1378 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_upd_rxsa() local
1381 rxsc = cn10k_mcs_get_rxsc(cfg, secy, sw_rx_sc); in cn10k_mdo_upd_rxsa()
1382 if (!rxsc) in cn10k_mdo_upd_rxsa()
1389 err = cn10k_mcs_write_rx_sa_plcy(pfvf, secy, rxsc, sa_num, sa_in_use); in cn10k_mdo_upd_rxsa()
1393 err = cn10k_mcs_write_rx_sa_pn(pfvf, rxsc, sa_num, next_pn); in cn10k_mdo_upd_rxsa()
1407 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_del_rxsa() local
1409 rxsc = cn10k_mcs_get_rxsc(cfg, ctx->secy, sw_rx_sc); in cn10k_mdo_del_rxsa()
1410 if (!rxsc) in cn10k_mdo_del_rxsa()
1416 cn10k_mcs_write_rx_sa_plcy(pfvf, ctx->secy, rxsc, sa_num, false); in cn10k_mdo_del_rxsa()
1417 cn10k_mcs_free_rxsa(pfvf, rxsc->hw_sa_id[sa_num]); in cn10k_mdo_del_rxsa()
1419 rxsc->sa_bmap &= ~(1 << sa_num); in cn10k_mdo_del_rxsa()
1510 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_get_rx_sc_stats() local
1512 rxsc = cn10k_mcs_get_rxsc(cfg, secy, ctx->rx_sc); in cn10k_mdo_get_rx_sc_stats()
1513 if (!rxsc) in cn10k_mdo_get_rx_sc_stats()
1516 cn10k_mcs_sc_stats(pfvf, rxsc->hw_sc_id, &rsp, MCS_RX, true); in cn10k_mdo_get_rx_sc_stats()
1518 rxsc->stats.InOctetsValidated += rsp.octet_validate_cnt; in cn10k_mdo_get_rx_sc_stats()
1519 rxsc->stats.InOctetsDecrypted += rsp.octet_decrypt_cnt; in cn10k_mdo_get_rx_sc_stats()
1521 rxsc->stats.InPktsInvalid += rsp.pkt_invalid_cnt; in cn10k_mdo_get_rx_sc_stats()
1522 rxsc->stats.InPktsNotValid += rsp.pkt_notvalid_cnt; in cn10k_mdo_get_rx_sc_stats()
1525 rxsc->stats.InPktsLate += rsp.pkt_late_cnt; in cn10k_mdo_get_rx_sc_stats()
1527 rxsc->stats.InPktsDelayed += rsp.pkt_late_cnt; in cn10k_mdo_get_rx_sc_stats()
1530 rxsc->stats.InPktsUnchecked += rsp.pkt_unchecked_cnt; in cn10k_mdo_get_rx_sc_stats()
1532 rxsc->stats.InPktsOK += rsp.pkt_unchecked_cnt; in cn10k_mdo_get_rx_sc_stats()
1534 ctx->stats.rx_sc_stats->InOctetsValidated = rxsc->stats.InOctetsValidated; in cn10k_mdo_get_rx_sc_stats()
1535 ctx->stats.rx_sc_stats->InOctetsDecrypted = rxsc->stats.InOctetsDecrypted; in cn10k_mdo_get_rx_sc_stats()
1536 ctx->stats.rx_sc_stats->InPktsInvalid = rxsc->stats.InPktsInvalid; in cn10k_mdo_get_rx_sc_stats()
1537 ctx->stats.rx_sc_stats->InPktsNotValid = rxsc->stats.InPktsNotValid; in cn10k_mdo_get_rx_sc_stats()
1538 ctx->stats.rx_sc_stats->InPktsLate = rxsc->stats.InPktsLate; in cn10k_mdo_get_rx_sc_stats()
1539 ctx->stats.rx_sc_stats->InPktsDelayed = rxsc->stats.InPktsDelayed; in cn10k_mdo_get_rx_sc_stats()
1540 ctx->stats.rx_sc_stats->InPktsUnchecked = rxsc->stats.InPktsUnchecked; in cn10k_mdo_get_rx_sc_stats()
1541 ctx->stats.rx_sc_stats->InPktsOK = rxsc->stats.InPktsOK; in cn10k_mdo_get_rx_sc_stats()
1553 struct cn10k_mcs_rxsc *rxsc; in cn10k_mdo_get_rx_sa_stats() local
1555 rxsc = cn10k_mcs_get_rxsc(cfg, ctx->secy, sw_rx_sc); in cn10k_mdo_get_rx_sa_stats()
1556 if (!rxsc) in cn10k_mdo_get_rx_sa_stats()
1562 cn10k_mcs_sa_stats(pfvf, rxsc->hw_sa_id[sa_num], &rsp, MCS_RX, false); in cn10k_mdo_get_rx_sa_stats()