Lines Matching refs:sg

96 static void otx2_dma_unmap_skb_frags(struct otx2_nic *pfvf, struct sg_list *sg)  in otx2_dma_unmap_skb_frags()  argument
100 for (seg = 0; seg < sg->num_segs; seg++) { in otx2_dma_unmap_skb_frags()
101 otx2_dma_unmap_page(pfvf, sg->dma_addr[seg], in otx2_dma_unmap_skb_frags()
102 sg->size[seg], DMA_TO_DEVICE); in otx2_dma_unmap_skb_frags()
104 sg->num_segs = 0; in otx2_dma_unmap_skb_frags()
112 struct sg_list *sg; in otx2_xdp_snd_pkt_handler() local
116 sg = &sq->sg[snd_comp->sqe_id]; in otx2_xdp_snd_pkt_handler()
118 pa = otx2_iova_to_phys(pfvf->iommu_domain, sg->dma_addr[0]); in otx2_xdp_snd_pkt_handler()
119 otx2_dma_unmap_page(pfvf, sg->dma_addr[0], in otx2_xdp_snd_pkt_handler()
120 sg->size[0], DMA_TO_DEVICE); in otx2_xdp_snd_pkt_handler()
135 struct sg_list *sg; in otx2_snd_pkt_handler() local
143 sg = &sq->sg[snd_comp->sqe_id]; in otx2_snd_pkt_handler()
144 skb = (struct sk_buff *)sg->skb; in otx2_snd_pkt_handler()
162 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_snd_pkt_handler()
164 sg->skb = (u64)NULL; in otx2_snd_pkt_handler()
250 struct nix_rx_sg_s *sg = &cqe->sg; in otx2_free_rcv_seg() local
255 start = (void *)sg; in otx2_free_rcv_seg()
258 sg = (struct nix_rx_sg_s *)start; in otx2_free_rcv_seg()
259 seg_addr = &sg->seg_addr; in otx2_free_rcv_seg()
260 for (seg = 0; seg < sg->segs; seg++, seg_addr++) in otx2_free_rcv_seg()
263 start += sizeof(*sg); in otx2_free_rcv_seg()
326 if (cqe->sg.segs) in otx2_check_rcv_errors()
337 struct nix_rx_sg_s *sg = &cqe->sg; in otx2_rcv_pkt_handler() local
357 start = (void *)sg; in otx2_rcv_pkt_handler()
360 sg = (struct nix_rx_sg_s *)start; in otx2_rcv_pkt_handler()
361 seg_addr = &sg->seg_addr; in otx2_rcv_pkt_handler()
362 seg_size = (void *)sg; in otx2_rcv_pkt_handler()
363 for (seg = 0; seg < sg->segs; seg++, seg_addr++) { in otx2_rcv_pkt_handler()
368 start += sizeof(*sg); in otx2_rcv_pkt_handler()
396 !cqe->sg.seg_addr) { in otx2_rx_napi_handler()
407 cqe->sg.seg_addr = 0x00; in otx2_rx_napi_handler()
551 struct nix_sqe_sg_s *sg = NULL; in otx2_sqe_add_sg() local
556 sq->sg[sq->head].num_segs = 0; in otx2_sqe_add_sg()
560 sg = (struct nix_sqe_sg_s *)(sq->sqe_base + *offset); in otx2_sqe_add_sg()
561 sg->ld_type = NIX_SEND_LDTYPE_LDD; in otx2_sqe_add_sg()
562 sg->subdc = NIX_SUBDC_SG; in otx2_sqe_add_sg()
563 sg->segs = 0; in otx2_sqe_add_sg()
564 sg_lens = (void *)sg; in otx2_sqe_add_sg()
565 iova = (void *)sg + sizeof(*sg); in otx2_sqe_add_sg()
570 *offset += sizeof(*sg) + (3 * sizeof(u64)); in otx2_sqe_add_sg()
572 *offset += sizeof(*sg) + sizeof(u64); in otx2_sqe_add_sg()
579 sg->segs++; in otx2_sqe_add_sg()
583 sq->sg[sq->head].dma_addr[seg] = dma_addr; in otx2_sqe_add_sg()
584 sq->sg[sq->head].size[seg] = len; in otx2_sqe_add_sg()
585 sq->sg[sq->head].num_segs++; in otx2_sqe_add_sg()
588 sq->sg[sq->head].skb = (u64)skb; in otx2_sqe_add_sg()
730 struct sg_list *sg = &sq->sg[sqe]; in otx2_dma_map_tso_skb() local
734 sg->num_segs = 0; in otx2_dma_map_tso_skb()
748 sg->dma_addr[sg->num_segs] = dma_addr; in otx2_dma_map_tso_skb()
749 sg->size[sg->num_segs] = len; in otx2_dma_map_tso_skb()
750 sg->num_segs++; in otx2_dma_map_tso_skb()
754 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_dma_map_tso_skb()
762 struct sg_list *sg = &sq->sg[sqe]; in otx2_tso_frag_dma_addr() local
767 return sg->dma_addr[0] + (seg_addr - (u64)skb->data); in otx2_tso_frag_dma_addr()
773 return sg->dma_addr[seg] + offset; in otx2_tso_frag_dma_addr()
779 struct nix_sqe_sg_s *sg = NULL; in otx2_sqe_tso_add_sg() local
787 sg = (struct nix_sqe_sg_s *)(sq->sqe_base + *offset); in otx2_sqe_tso_add_sg()
788 sg->ld_type = NIX_SEND_LDTYPE_LDD; in otx2_sqe_tso_add_sg()
789 sg->subdc = NIX_SUBDC_SG; in otx2_sqe_tso_add_sg()
790 sg->segs = 0; in otx2_sqe_tso_add_sg()
791 sg_lens = (void *)sg; in otx2_sqe_tso_add_sg()
792 iova = (void *)sg + sizeof(*sg); in otx2_sqe_tso_add_sg()
797 *offset += sizeof(*sg) + (3 * sizeof(u64)); in otx2_sqe_tso_add_sg()
799 *offset += sizeof(*sg) + sizeof(u64); in otx2_sqe_tso_add_sg()
803 sg->segs++; in otx2_sqe_tso_add_sg()
880 sq->sg[first_sqe].skb = (u64)skb; in otx2_sq_append_tso()
997 otx2_dma_unmap_skb_frags(pfvf, &sq->sg[sq->head]); in otx2_sq_append_skb()
1033 if (cqe->sg.segs > 1) { in otx2_cleanup_rx_cqes()
1037 iova = cqe->sg.seg_addr - OTX2_HEAD_ROOM; in otx2_cleanup_rx_cqes()
1054 struct sg_list *sg; in otx2_cleanup_tx_cqes() local
1068 sg = &sq->sg[cqe->comp.sqe_id]; in otx2_cleanup_tx_cqes()
1069 skb = (struct sk_buff *)sg->skb; in otx2_cleanup_tx_cqes()
1071 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_cleanup_tx_cqes()
1073 sg->skb = (u64)NULL; in otx2_cleanup_tx_cqes()
1106 struct nix_sqe_sg_s *sg = NULL; in otx2_xdp_sqe_add_sg() local
1109 sg = (struct nix_sqe_sg_s *)(sq->sqe_base + *offset); in otx2_xdp_sqe_add_sg()
1110 sg->ld_type = NIX_SEND_LDTYPE_LDD; in otx2_xdp_sqe_add_sg()
1111 sg->subdc = NIX_SUBDC_SG; in otx2_xdp_sqe_add_sg()
1112 sg->segs = 1; in otx2_xdp_sqe_add_sg()
1113 sg->seg1_size = len; in otx2_xdp_sqe_add_sg()
1114 iova = (void *)sg + sizeof(*sg); in otx2_xdp_sqe_add_sg()
1116 *offset += sizeof(*sg) + sizeof(u64); in otx2_xdp_sqe_add_sg()
1118 sq->sg[sq->head].dma_addr[0] = dma_addr; in otx2_xdp_sqe_add_sg()
1119 sq->sg[sq->head].size[0] = len; in otx2_xdp_sqe_add_sg()
1120 sq->sg[sq->head].num_segs = 1; in otx2_xdp_sqe_add_sg()
1169 iova = cqe->sg.seg_addr - OTX2_HEAD_ROOM; in otx2_xdp_rcv_pkt_handler()
1178 cqe->sg.seg_size, false); in otx2_xdp_rcv_pkt_handler()
1189 cqe->sg.seg_size, qidx); in otx2_xdp_rcv_pkt_handler()