Skip to content

Commit

Permalink
reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
kaajalbgupta committed May 13, 2023
1 parent 7e55f69 commit b1436ea
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 37 deletions.
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
__pycache__
*.pyc

Expand Down
2 changes: 1 addition & 1 deletion software/examples/l2_forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ int main(int argc, const char* argv[]) {
}

return 0;
}
}
52 changes: 21 additions & 31 deletions software/include/enso/pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,21 +367,21 @@ class RxPipe {
* iterating over the batch will result in fewer bytes than
* `available_bytes()`. After iterating over the batch, the total number of
* bytes iterated over can be obtained by calling `processed_bytes()`.
*
*
* @return The number of bytes available in the batch.
*/
uint32_t available_bytes() const { return available_bytes_; }

/**
* @brief Returns maximum number of messages in the batch.
*
*
* @return The maximum number of messages in the batch.
*/
int32_t message_limit() const { return message_limit_; }

/**
* @brief Returns a pointer to the start of the batch.
*
*
* @return A pointer to the start of the batch.
*/
uint8_t* buf() const { return buf_; }
Expand Down Expand Up @@ -533,7 +533,7 @@ class RxPipe {

/**
* @brief Prefetches the next batch of bytes to be received on the RxPipe.
*
*
* @warning Explicit prefetching from the application cannot be used in
* conjunction with the `NextRxPipeToRecv` and `NextRxTxPipeToRecv`
* functions. To use prefetching with these functions, compile the
Expand Down Expand Up @@ -573,28 +573,24 @@ class RxPipe {

/**
* @brief Returns the context associated with the pipe.
*
*
* Applications can use context to associate arbitrary pointers with a given
* pipe that can later be retrieved in a different point. For instance, when
* using Device::NextRxPipeToRecv(), the application may use the context to
* retrieve application data associated with the returned pipe.
*
*
* @see RxPipe::set_context()
*
* @return The context associated with the pipe.
*/
inline void* context() const {
return context_;
}
inline void* context() const { return context_; }

/**
* @brief Sets the context associated with the pipe.
*
*
* @see RxPipe::context()
*/
inline void set_context(void* new_context) {
context_ = new_context;
}
inline void set_context(void* new_context) { context_ = new_context; }

/**
* The size of a "buffer quantum" in bytes. This is the minimum unit that can
Expand Down Expand Up @@ -636,9 +632,9 @@ class RxPipe {

friend class Device;

bool next_pipe_ = false; ///< Whether this pipe is the next pipe to be
///< processed by the device. This is used in
///< conjunction with NextRxPipe().
bool next_pipe_ = false; ///< Whether this pipe is the next pipe to be
///< processed by the device. This is used in
///< conjunction with NextRxPipe().
const enso_pipe_id_t kId; ///< The ID of the pipe.
void* context_;
struct RxEnsoPipeInternal internal_rx_pipe_;
Expand Down Expand Up @@ -822,26 +818,22 @@ class TxPipe {

/**
* @brief Returns the context associated with the pipe.
*
*
* Applications can use context to associate arbitrary pointers with a given
* pipe that can later be retrieved in a different point.
*
*
* @see TxPipe::set_context()
*
* @return The context associated with the pipe.
*/
inline void* context() const {
return context_;
}
inline void* context() const { return context_; }

/**
* @brief Sets the context associated with the pipe.
*
*
* @see TxPipe::context()
*/
inline void set_context(void* new_context) {
context_ = new_context;
}
inline void set_context(void* new_context) { context_ = new_context; }

/**
* The size of a "buffer quantum" in bytes. This is the minimum unit that can
Expand Down Expand Up @@ -893,7 +885,6 @@ class TxPipe {
}

friend class Device;
friend RxTxPipe; // FIXME(sadok): Should not need this.

const enso_pipe_id_t kId; ///< The ID of the pipe.
void* context_;
Expand All @@ -903,7 +894,6 @@ class TxPipe {
uint32_t app_begin_ = 0; // The next byte to be sent.
uint32_t app_end_ = 0; // The next byte to be allocated.
uint64_t buf_phys_addr_;
uint64_t buf_virt_addr_;

static constexpr uint32_t kBufMask = (kMaxCapacity + kQuantumSize) - 1;
static_assert((kBufMask & (kBufMask + 1)) == 0,
Expand Down Expand Up @@ -1082,12 +1072,12 @@ class RxTxPipe {

/**
* @brief Returns the context associated with the pipe.
*
*
* Applications can use context to associate arbitrary pointers with a given
* pipe that can later be retrieved in a different point. For instance, when
* using Device::NextRxTxPipeToRecv(), the application may use the context to
* retrieve application data associated with the returned pipe.
*
*
* @see RxTxPipe::set_context()
*
* @return The context associated with the pipe.
Expand All @@ -1096,7 +1086,7 @@ class RxTxPipe {

/**
* @brief Sets the context associated with the pipe.
*
*
* @see RxTxPipe::context()
*/
inline void set_context(void* new_context) {
Expand Down Expand Up @@ -1295,4 +1285,4 @@ class PeekPktIterator : public MessageIteratorBase<PeekPktIterator> {

} // namespace enso

#endif // SOFTWARE_INCLUDE_ENSO_PIPE_H_
#endif // SOFTWARE_INCLUDE_ENSO_PIPE_H_
4 changes: 1 addition & 3 deletions software/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ inc = include_directories('include')
subdir('include')
subdir('src')

pcap_dep = dependency('pcap', version : '>=1.0')

enso_lib = library('enso', project_sources, install: true,
include_directories: inc)
pkg_mod = import('pkgconfig')
pkg_mod.generate(enso_lib)

subdir('examples')
subdir('examples')
2 changes: 1 addition & 1 deletion software/src/mock_pcie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ __consume_queue(struct RxEnsoPipeInternal* e,
struct NotificationBufPair* notification_buf_pair, void** buf,
bool peek = false) {
std::cout << "Consume queue" << std::endl;
(void)(e);
(void)e;
(void)notification_buf_pair;
(void)peek;

Expand Down

0 comments on commit b1436ea

Please sign in to comment.