[dpdk-dev] [Bug 643] af_xdp驱动造成rte_rx_queue_setup的coredump问题

bugzilla at dpdk.org bugzilla at dpdk.org
Fri Feb 26 07:32:03 CET 2021


https://bugs.dpdk.org/show_bug.cgi?id=643

            Bug ID: 643
           Summary: af_xdp驱动造成rte_rx_queue_setup的coredump问题
           Product: DPDK
           Version: 20.05
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: other
          Assignee: dev at dpdk.org
          Reporter: huangying-c at 360.cn
  Target Milestone: ---

driver/net/af_xdp/rte_eth_af_xdp.c
xsk_configure中调用了rte_pktmbuf_alloc_bulk,当rte_pktmbuf_alloc_bulk调用失败后xsk_configure仍然返回0,造成调用rte_eth_rx_queue_setup时不会返回失败,但是在xsk_configure中已经调用了xdp_umem_destroy回收了内存,当再次调用rte_eth_rx_queue_setup时造成coredump,代码如下:
static int
xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq,
          int ring_size)
{
    struct xsk_socket_config cfg;
    struct pkt_tx_queue *txq = rxq->pair;
    int ret = 0;
    ...........
#if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
    if (rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size)) {
        AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n");
        goto err;
    }
#endif
err:
    xdp_umem_destroy(rxq->umem);

    return ret;
}
这让使用这在使用rte_eth_rx_queue_setup时无法根据返回的错误进行相应的异常处理

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the dev mailing list