diff options
author | Vratko Polak <vrpolak@cisco.com> | 2023-11-22 13:39:47 +0100 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2023-11-22 13:39:47 +0100 |
commit | 20e37d2639d54f7bf6ec28e80f3da1f7316f16a2 (patch) | |
tree | ec3f106979dd7525eae263dd0a5cb7f9cdaf23c0 /src | |
parent | 9375266bd373ea3c86160d3262445607445a90d7 (diff) |
avf: put sentinel at correct place
The previous fix was adding the sentinel before refilling rx,
which gave the NIC time to overwrite it with a new descriptor.
Ticket: VPP-2087
Type: fix
Fixes: 8b4d474abd62c623502ad9a4a279a9b4535ca0c1
Change-Id: I32bde4a763a62fb66c5c3871d9f10af6066e2d47
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/avf/input.c | 6 | ||||
-rw-r--r-- | src/plugins/dev_iavf/rx_node.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c index 3c3d6c07c2d..ca69407fc59 100644 --- a/src/plugins/avf/input.c +++ b/src/plugins/avf/input.c @@ -125,6 +125,9 @@ avf_rxq_refill (vlib_main_t * vm, vlib_node_runtime_t * node, avf_rxq_t * rxq, n_alloc -= 8; } + /* RXQ can be smaller than 256 packets, especially if jumbo. */ + rxq->descs[slot].qword[1] = 0; + avf_tail_write (rxq->qrx_tail, slot); } @@ -423,9 +426,6 @@ no_more_desc: rxq->next = next; rxq->n_enqueued -= n_rx_packets + n_tail_desc; - /* avoid eating our own tail */ - rxq->descs[(next + rxq->n_enqueued) & mask].qword[1] = 0; - #if defined(CLIB_HAVE_VEC256) || defined(CLIB_HAVE_VEC128) or_qw1 |= or_q1x4[0] | or_q1x4[1] | or_q1x4[2] | or_q1x4[3]; #endif diff --git a/src/plugins/dev_iavf/rx_node.c b/src/plugins/dev_iavf/rx_node.c index 946adb1df1b..ee6d7e8def0 100644 --- a/src/plugins/dev_iavf/rx_node.c +++ b/src/plugins/dev_iavf/rx_node.c @@ -111,6 +111,9 @@ iavf_rxq_refill (vlib_main_t *vm, vlib_node_runtime_t *node, n_alloc -= 8; } + /* RXQ can be smaller than 256 packets, especially if jumbo. */ + arq->descs[slot].qword[1] = 0; + __atomic_store_n (arq->qrx_tail, slot, __ATOMIC_RELEASE); } @@ -399,9 +402,6 @@ no_more_desc: arq->next = next; arq->n_enqueued -= n_rx_packets + n_tail_desc; - /* avoid eating our own tail */ - arq->descs[(next + arq->n_enqueued) & mask].qword[1] = 0; - #if defined(CLIB_HAVE_VEC256) || defined(CLIB_HAVE_VEC128) or_qw1 |= or_q1x4[0] | or_q1x4[1] | or_q1x4[2] | or_q1x4[3]; #endif |