LCOV - code coverage report
Current view: top level - app/test-pmd - macfwd.h (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 21 0.0 %
Date: 2025-01-02 22:41:34 Functions: 0 1 0.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) 2010-2014 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #ifndef _MACFWD_H_
       6                 :            : #define _MACFWD_H_
       7                 :            : 
       8                 :            : static inline void
       9                 :          0 : do_macfwd(struct rte_mbuf *pkts_burst[], uint16_t nb_rx,
      10                 :            :           struct fwd_stream *fs)
      11                 :            : {
      12                 :            :         struct rte_ether_hdr *eth_hdr;
      13                 :            :         uint64_t ol_flags = 0;
      14                 :            :         uint64_t tx_offloads;
      15                 :            :         struct rte_mbuf  *mb;
      16                 :          0 :         struct rte_port *txp = &ports[fs->tx_port];
      17                 :            :         uint16_t i;
      18                 :            : 
      19                 :          0 :         tx_offloads = txp->dev_conf.txmode.offloads;
      20                 :          0 :         if (tx_offloads & RTE_ETH_TX_OFFLOAD_VLAN_INSERT)
      21                 :            :                 ol_flags = RTE_MBUF_F_TX_VLAN;
      22                 :          0 :         if (tx_offloads & RTE_ETH_TX_OFFLOAD_QINQ_INSERT)
      23                 :          0 :                 ol_flags |= RTE_MBUF_F_TX_QINQ;
      24                 :          0 :         if (tx_offloads & RTE_ETH_TX_OFFLOAD_MACSEC_INSERT)
      25                 :          0 :                 ol_flags |= RTE_MBUF_F_TX_MACSEC;
      26                 :          0 :         for (i = 0; i < nb_rx; i++) {
      27                 :          0 :                 if (likely(i < nb_rx - 1))
      28                 :          0 :                         rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
      29                 :            :                                                        void *));
      30                 :          0 :                 mb = pkts_burst[i];
      31                 :          0 :                 eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);
      32                 :          0 :                 rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
      33                 :            :                                     &eth_hdr->dst_addr);
      34                 :            :                 rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
      35                 :            :                                     &eth_hdr->src_addr);
      36                 :          0 :                 mb->ol_flags &= RTE_MBUF_F_INDIRECT | RTE_MBUF_F_EXTERNAL;
      37                 :          0 :                 mb->ol_flags |= ol_flags;
      38                 :          0 :                 mb->l2_len = sizeof(struct rte_ether_hdr);
      39                 :          0 :                 mb->l3_len = sizeof(struct rte_ipv4_hdr);
      40                 :          0 :                 mb->vlan_tci = txp->tx_vlan_id;
      41                 :          0 :                 mb->vlan_tci_outer = txp->tx_vlan_id_outer;
      42                 :            :         }
      43                 :          0 : }
      44                 :            : 
      45                 :            : #endif /* _MACFWD_H_ */

Generated by: LCOV version 1.14