LCOV - code coverage report
Current view: top level - lib/stack - rte_stack_std.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 6 6 100.0 %
Date: 2025-03-01 20:23:48 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2019 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #include "rte_stack.h"
       6                 :            : 
       7                 :            : void
       8                 :          4 : rte_stack_std_init(struct rte_stack *s)
       9                 :            : {
      10                 :            :         rte_spinlock_init(&s->stack_std.lock);
      11                 :          4 : }
      12                 :            : 
      13                 :            : ssize_t
      14                 :          6 : rte_stack_std_get_memsize(unsigned int count)
      15                 :            : {
      16                 :            :         ssize_t sz = sizeof(struct rte_stack);
      17                 :            : 
      18                 :          6 :         sz += RTE_CACHE_LINE_ROUNDUP(count * sizeof(void *));
      19                 :            : 
      20                 :            :         /* Add padding to avoid false sharing conflicts caused by
      21                 :            :          * next-line hardware prefetchers.
      22                 :            :          */
      23                 :          6 :         sz += 2 * RTE_CACHE_LINE_SIZE;
      24                 :            : 
      25                 :          6 :         return sz;
      26                 :            : }

Generated by: LCOV version 1.14