diff options
author | imarom <imarom@cisco.com> | 2017-01-11 18:19:47 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2017-01-11 18:19:47 +0200 |
commit | ac2e93d4247b2db94cd07301b274336bb08dec46 (patch) | |
tree | 8dfe8250526cd797ab9af46f4b54cfbec0832fc0 /src/stateless/cp | |
parent | 5257dbb8253fe5b70b75f9c064c4593ca7aee99f (diff) |
capture - draft commit
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless/cp')
-rw-r--r-- | src/stateless/cp/trex_stateless.cpp | 31 | ||||
-rw-r--r-- | src/stateless/cp/trex_stateless.h | 12 | ||||
-rw-r--r-- | src/stateless/cp/trex_stateless_port.h | 15 |
3 files changed, 6 insertions, 52 deletions
diff --git a/src/stateless/cp/trex_stateless.cpp b/src/stateless/cp/trex_stateless.cpp index 32babbf7..6ab9b417 100644 --- a/src/stateless/cp/trex_stateless.cpp +++ b/src/stateless/cp/trex_stateless.cpp @@ -19,7 +19,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -//#include <sched.h> #include <iostream> #include <unistd.h> @@ -142,35 +141,11 @@ TrexStateless::get_dp_core_count() { return m_platform_api->get_dp_core_count(); } -capture_id_t -TrexStateless::start_capture(const CaptureFilter &filter, uint64_t limit) { - static MsgReply<capture_id_t> reply; - - reply.reset(); - - CNodeRing *ring = CMsgIns::Ins()->getCpRx()->getRingCpToDp(0); - TrexStatelessRxStartCapture *msg = new TrexStatelessRxStartCapture(filter, limit, reply); - - ring->Enqueue((CGenNode *)msg); - - capture_id_t new_id = reply.wait_for_reply(); - - return (new_id); -} +void +TrexStateless::send_msg_to_rx(TrexStatelessCpToRxMsgBase *msg) const { -capture_id_t -TrexStateless::stop_capture(capture_id_t capture_id) { - static MsgReply<capture_id_t> reply; - - reply.reset(); - CNodeRing *ring = CMsgIns::Ins()->getCpRx()->getRingCpToDp(0); - TrexStatelessRxStopCapture *msg = new TrexStatelessRxStopCapture(capture_id, reply); - ring->Enqueue((CGenNode *)msg); - - capture_id_t rc = reply.wait_for_reply(); - - return (rc); } + diff --git a/src/stateless/cp/trex_stateless.h b/src/stateless/cp/trex_stateless.h index 33f16ce9..87d227f6 100644 --- a/src/stateless/cp/trex_stateless.h +++ b/src/stateless/cp/trex_stateless.h @@ -102,7 +102,6 @@ public: * defines the TRex stateless operation mode * */ -class CaptureFilter; class TrexStateless { public: @@ -133,16 +132,9 @@ public: /** - * starts a capture on a 'filter' of ports - * with a limit of packets + * send a message to the RX core */ - capture_id_t start_capture(const CaptureFilter &filter, uint64_t limit); - - /** - * stops an active capture - * - */ - capture_id_t stop_capture(capture_id_t capture_id); + void send_msg_to_rx(TrexStatelessCpToRxMsgBase *msg) const; /** * shutdown the server diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h index 2cc1b9ca..0ef8ae60 100644 --- a/src/stateless/cp/trex_stateless_port.h +++ b/src/stateless/cp/trex_stateless_port.h @@ -140,7 +140,7 @@ public: } if (TrexStatelessCaptureMngr::getInstance().is_active(m_port_id)) { - throw TrexException("unable to disable service - an active capture on port " + std::to_string(m_port_id) + " exists"); + throw TrexException("unable to disable service mode - an active capture on port " + std::to_string(m_port_id) + " exists"); } m_port_attr->set_rx_filter_mode(RX_FILTER_MODE_HW); @@ -439,19 +439,6 @@ public: void get_pci_info(std::string &pci_addr, int &numa_node); - - /** - * starts capturing packets - * - */ - void start_capture(capture_mode_e mode, uint64_t limit); - - /** - * stops capturing packets - * - */ - void stop_capture(); - /** * start RX queueing of packets * |