Handle mbufs which are not segmented (non SG) */
| 899 | |
| 900 | /* Handle mbufs which are not segmented (non SG) */ |
| 901 | static inline void |
| 902 | tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, |
| 903 | struct dpaa_bp_info *bp_info, |
| 904 | struct qm_fd *fd_arr, |
| 905 | struct dpaa_sw_buf_free *buf_to_free, |
| 906 | uint32_t *free_count, |
| 907 | uint32_t pkt_id) |
| 908 | { |
| 909 | struct rte_mbuf *mi = NULL; |
| 910 | |
| 911 | if (RTE_MBUF_DIRECT(mbuf)) { |
| 912 | if (rte_mbuf_refcnt_read(mbuf) > 1) { |
| 913 | /* In case of direct mbuf and mbuf being cloned, |
| 914 | * BMAN should _not_ release buffer. |
| 915 | */ |
| 916 | DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, 0xff); |
| 917 | /* Buffer should be releasd by EAL */ |
| 918 | rte_mbuf_refcnt_update(mbuf, -1); |
| 919 | } else { |
| 920 | /* In case of direct mbuf and no cloning, mbuf can be |
| 921 | * released by BMAN. |
| 922 | */ |
| 923 | DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid); |
| 924 | } |
| 925 | } else if (RTE_MBUF_HAS_EXTBUF(mbuf)) { |
| 926 | buf_to_free[*free_count].seg = mbuf; |
| 927 | buf_to_free[*free_count].pkt_id = pkt_id; |
| 928 | ++*free_count; |
| 929 | DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, |
| 930 | bp_info ? bp_info->bpid : 0xff); |
| 931 | } else { |
| 932 | /* This is data-containing core mbuf: 'mi' */ |
| 933 | mi = rte_mbuf_from_indirect(mbuf); |
| 934 | if (rte_mbuf_refcnt_read(mi) > 1) { |
| 935 | /* In case of indirect mbuf, and mbuf being cloned, |
| 936 | * BMAN should _not_ release it and let EAL release |
| 937 | * it through pktmbuf_free below. |
| 938 | */ |
| 939 | DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, 0xff); |
| 940 | } else { |
| 941 | /* In case of indirect mbuf, and no cloning, core mbuf |
| 942 | * should be released by BMAN. |
| 943 | * Increate refcnt of core mbuf so that when |
| 944 | * pktmbuf_free is called and mbuf is released, EAL |
| 945 | * doesn't try to release core mbuf which would have |
| 946 | * been released by BMAN. |
| 947 | */ |
| 948 | rte_mbuf_refcnt_update(mi, 1); |
| 949 | DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, |
| 950 | bp_info ? bp_info->bpid : 0xff); |
| 951 | } |
| 952 | buf_to_free[*free_count].seg = mbuf; |
| 953 | buf_to_free[*free_count].pkt_id = pkt_id; |
| 954 | ++*free_count; |
| 955 | } |
| 956 | |
| 957 | if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) |
| 958 | dpaa_unsegmented_checksum(mbuf, fd_arr); |
no test coverage detected