numam-dpdk/drivers/net/enic
Aaron Conole f7a58af502 net/enic: fix crash when freeing 0 packet to mempool
Occasionally, the amount of packets to free from the work queue ends
perfectly on a boundary to have nb_free = 0 and pool = 0.  This causes
a segfault as follows:

  (gdb) bt
  #0  rte_mempool_default_cache
  #1  rte_mempool_put_bulk (n=0, obj_table=0x7f10deff2530, mp=0x0)
  #2  enic_free_wq_bufs (wq=wq@entry=0x7efabffcd5b0,
      completed_index=completed_index@entry=33)
  #3  0x00007f11e9c86e17 in enic_cleanup_wq (enic=<optimized out>,
      wq=wq@entry=0x7efabffcd5b0)
      at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/drivers/net/enic/enic_rxtx.c:442
  #4  0x00007f11e9c86e5f in enic_xmit_pkts (tx_queue=0x7efabffcd5b0,
      tx_pkts=0x7f10deffb1a8, nb_pkts=<optimized out>)
      at /usr/src/debug/openvswitch-2.6.1/dpdk-16.11/drivers/net/enic/enic_rxtx.c:470
  #5  0x00007f11e9e147ad in rte_eth_tx_burst (nb_pkts=<optimized out>,
      tx_pkts=0x7f10deffb1a8, queue_id=0, port_id=<optimized out>)

This commit makes the enic wq driver match other drivers who call the
bulk free, by checking that there are actual packets to free.

Fixes: 36935afbc5 ("net/enic: refactor Tx mbuf recycling")
CC: stable@dpdk.org

Reported-by: Vincent S. Cojot <vcojot@redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1468631
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: John Daley <johndale@cisco.com>
2017-08-03 22:55:32 +02:00
..
base net/enic: fix build with gcc 7.1 2017-06-14 22:54:31 +02:00
enic_clsf.c net/enic: replace check for SSE4 with check for x86 2017-07-04 14:39:18 +02:00
enic_compat.h net/enic: use I/O device memory read/write API 2017-01-18 17:18:26 +01:00
enic_ethdev.c net/enic: flow API skeleton 2017-06-12 10:41:26 +01:00
enic_flow.c net/enic: flow API debug 2017-06-12 10:41:26 +01:00
enic_main.c ethdev: add return values to callback process API 2017-07-01 17:19:55 +02:00
enic_res.c net/enic: flow API for NICs with advanced filters enabled 2017-06-12 10:41:26 +01:00
enic_res.h net/enic: fix memory leak with oversized Tx packets 2017-02-10 12:25:49 +01:00
enic_rxtx.c net/enic: fix crash when freeing 0 packet to mempool 2017-08-03 22:55:32 +02:00
enic.h net/enic: flow API for NICs with advanced filters enabled 2017-06-12 10:41:26 +01:00
LICENSE enic: move to drivers/net/ 2015-05-22 16:05:52 +02:00
Makefile net/enic: flow API skeleton 2017-06-12 10:41:26 +01:00
rte_pmd_enic_version.map enic: move to drivers/net/ 2015-05-22 16:05:52 +02:00