A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dpdk-net-device-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 NITK Surathkal
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Harsh Patel <thadodaharsh10@gmail.com>
18 * Hrishikesh Hiraskar <hrishihiraskar@gmail.com>
19 */
20
21#ifndef DPDK_NET_DEVICE_HELPER_H
22#define DPDK_NET_DEVICE_HELPER_H
23
25
26namespace ns3
27{
28
29/**
30 * \ingroup fd-net-device
31 * \brief build a DpdkNetDevice object attached to a physical network
32 * interface
33 */
35{
36 public:
37 /**
38 * Construct a DpdkNetDeviceHelper and initialize DPDK EAL
39 */
41
43 {
44 }
45
46 /**
47 * \brief Sets list of logical cores to use
48 *
49 * \param lCoreList Comma separated logical core list (e.g., "0,1")
50 */
51 void SetLCoreList(std::string lCoreList);
52
53 /**
54 * \brief Sets PMD Library to be used for the NIC
55 *
56 * \param pmdLibrary The PMD Library
57 */
58 void SetPmdLibrary(std::string pmdLibrary);
59
60 /**
61 * \brief Sets DPDK Driver to bind NIC to
62 *
63 * \param dpdkDriver The DPDK Driver
64 */
65 void SetDpdkDriver(std::string dpdkDriver);
66
67 protected:
68 /**
69 * \brief This method creates an ns3::FdNetDevice attached to a physical network
70 * interface
71 *
72 * \param node The node to install the device in
73 * \returns A container holding the added net device.
74 */
75 Ptr<NetDevice> InstallPriv(Ptr<Node> node) const override;
76
77 /**
78 * Logical cores to use
79 */
80 std::string m_lCoreList;
81
82 /**
83 * PMD Library to be used for NIC
84 */
85 std::string m_pmdLibrary;
86
87 /**
88 * DPDK Driver to bind NIC to
89 */
90 std::string m_dpdkDriver;
91};
92
93} // namespace ns3
94
95#endif /* DPDK_NET_DEVICE_HELPER_H */
build a DpdkNetDevice object attached to a physical network interface
void SetPmdLibrary(std::string pmdLibrary)
Sets PMD Library to be used for the NIC.
std::string m_lCoreList
Logical cores to use.
void SetDpdkDriver(std::string dpdkDriver)
Sets DPDK Driver to bind NIC to.
std::string m_dpdkDriver
DPDK Driver to bind NIC to.
std::string m_pmdLibrary
PMD Library to be used for NIC.
void SetLCoreList(std::string lCoreList)
Sets list of logical cores to use.
Ptr< NetDevice > InstallPriv(Ptr< Node > node) const override
This method creates an ns3::FdNetDevice attached to a physical network interface.
DpdkNetDeviceHelper()
Construct a DpdkNetDeviceHelper and initialize DPDK EAL.
build a set of FdNetDevice objects attached to a physical network interface
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.