Lines Matching refs:sg
90 static void otx2_dma_unmap_skb_frags(struct otx2_nic *pfvf, struct sg_list *sg) in otx2_dma_unmap_skb_frags() argument
94 for (seg = 0; seg < sg->num_segs; seg++) { in otx2_dma_unmap_skb_frags()
95 otx2_dma_unmap_page(pfvf, sg->dma_addr[seg], in otx2_dma_unmap_skb_frags()
96 sg->size[seg], DMA_TO_DEVICE); in otx2_dma_unmap_skb_frags()
98 sg->num_segs = 0; in otx2_dma_unmap_skb_frags()
111 struct sg_list *sg; in otx2_snd_pkt_handler() local
119 sg = &sq->sg[snd_comp->sqe_id]; in otx2_snd_pkt_handler()
120 skb = (struct sk_buff *)sg->skb; in otx2_snd_pkt_handler()
138 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_snd_pkt_handler()
140 sg->skb = (u64)NULL; in otx2_snd_pkt_handler()
214 struct nix_rx_sg_s *sg = &cqe->sg; in otx2_free_rcv_seg() local
219 start = (void *)sg; in otx2_free_rcv_seg()
222 sg = (struct nix_rx_sg_s *)start; in otx2_free_rcv_seg()
223 seg_addr = &sg->seg_addr; in otx2_free_rcv_seg()
224 for (seg = 0; seg < sg->segs; seg++, seg_addr++) in otx2_free_rcv_seg()
227 start += sizeof(*sg); in otx2_free_rcv_seg()
290 if (cqe->sg.segs) in otx2_check_rcv_errors()
301 struct nix_rx_sg_s *sg = &cqe->sg; in otx2_rcv_pkt_handler() local
317 start = (void *)sg; in otx2_rcv_pkt_handler()
320 sg = (struct nix_rx_sg_s *)start; in otx2_rcv_pkt_handler()
321 seg_addr = &sg->seg_addr; in otx2_rcv_pkt_handler()
322 seg_size = (void *)sg; in otx2_rcv_pkt_handler()
323 for (seg = 0; seg < sg->segs; seg++, seg_addr++) { in otx2_rcv_pkt_handler()
328 start += sizeof(*sg); in otx2_rcv_pkt_handler()
356 !cqe->sg.seg_addr) { in otx2_rx_napi_handler()
367 cqe->sg.seg_addr = 0x00; in otx2_rx_napi_handler()
511 struct nix_sqe_sg_s *sg = NULL; in otx2_sqe_add_sg() local
516 sq->sg[sq->head].num_segs = 0; in otx2_sqe_add_sg()
520 sg = (struct nix_sqe_sg_s *)(sq->sqe_base + *offset); in otx2_sqe_add_sg()
521 sg->ld_type = NIX_SEND_LDTYPE_LDD; in otx2_sqe_add_sg()
522 sg->subdc = NIX_SUBDC_SG; in otx2_sqe_add_sg()
523 sg->segs = 0; in otx2_sqe_add_sg()
524 sg_lens = (void *)sg; in otx2_sqe_add_sg()
525 iova = (void *)sg + sizeof(*sg); in otx2_sqe_add_sg()
530 *offset += sizeof(*sg) + (3 * sizeof(u64)); in otx2_sqe_add_sg()
532 *offset += sizeof(*sg) + sizeof(u64); in otx2_sqe_add_sg()
539 sg->segs++; in otx2_sqe_add_sg()
543 sq->sg[sq->head].dma_addr[seg] = dma_addr; in otx2_sqe_add_sg()
544 sq->sg[sq->head].size[seg] = len; in otx2_sqe_add_sg()
545 sq->sg[sq->head].num_segs++; in otx2_sqe_add_sg()
548 sq->sg[sq->head].skb = (u64)skb; in otx2_sqe_add_sg()
688 struct sg_list *sg = &sq->sg[sqe]; in otx2_dma_map_tso_skb() local
692 sg->num_segs = 0; in otx2_dma_map_tso_skb()
706 sg->dma_addr[sg->num_segs] = dma_addr; in otx2_dma_map_tso_skb()
707 sg->size[sg->num_segs] = len; in otx2_dma_map_tso_skb()
708 sg->num_segs++; in otx2_dma_map_tso_skb()
712 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_dma_map_tso_skb()
720 struct sg_list *sg = &sq->sg[sqe]; in otx2_tso_frag_dma_addr() local
725 return sg->dma_addr[0] + (seg_addr - (u64)skb->data); in otx2_tso_frag_dma_addr()
731 return sg->dma_addr[seg] + offset; in otx2_tso_frag_dma_addr()
737 struct nix_sqe_sg_s *sg = NULL; in otx2_sqe_tso_add_sg() local
745 sg = (struct nix_sqe_sg_s *)(sq->sqe_base + *offset); in otx2_sqe_tso_add_sg()
746 sg->ld_type = NIX_SEND_LDTYPE_LDD; in otx2_sqe_tso_add_sg()
747 sg->subdc = NIX_SUBDC_SG; in otx2_sqe_tso_add_sg()
748 sg->segs = 0; in otx2_sqe_tso_add_sg()
749 sg_lens = (void *)sg; in otx2_sqe_tso_add_sg()
750 iova = (void *)sg + sizeof(*sg); in otx2_sqe_tso_add_sg()
755 *offset += sizeof(*sg) + (3 * sizeof(u64)); in otx2_sqe_tso_add_sg()
757 *offset += sizeof(*sg) + sizeof(u64); in otx2_sqe_tso_add_sg()
761 sg->segs++; in otx2_sqe_tso_add_sg()
838 sq->sg[first_sqe].skb = (u64)skb; in otx2_sq_append_tso()
955 otx2_dma_unmap_skb_frags(pfvf, &sq->sg[sq->head]); in otx2_sq_append_skb()
988 if (cqe->sg.segs > 1) { in otx2_cleanup_rx_cqes()
992 iova = cqe->sg.seg_addr - OTX2_HEAD_ROOM; in otx2_cleanup_rx_cqes()
1009 struct sg_list *sg; in otx2_cleanup_tx_cqes() local
1023 sg = &sq->sg[cqe->comp.sqe_id]; in otx2_cleanup_tx_cqes()
1024 skb = (struct sk_buff *)sg->skb; in otx2_cleanup_tx_cqes()
1026 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_cleanup_tx_cqes()
1028 sg->skb = (u64)NULL; in otx2_cleanup_tx_cqes()