w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11RdmaDisk.hpp
Go to the documentation of this file.
1// $Id: Rw11RdmaDisk.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-15 1083 1.0.2 for std::function setups: use rval ref and move
8// 2017-04-02 865 1.0.1 Dump(): add detail arg
9// 2015-01-04 627 1.0 Initial version
10// ---------------------------------------------------------------------------
11
12
17#ifndef included_Retro_Rw11RdmaDisk
18#define included_Retro_Rw11RdmaDisk 1
19
20#include <vector>
21
22#include "Rw11Rdma.hpp"
23#include "Rw11UnitDisk.hpp"
24
25namespace Retro {
26
27 class Rw11RdmaDisk : public Rw11Rdma {
28 public:
29 Rw11RdmaDisk(Rw11Cntl* pcntl, precb_t&& precb,
30 postcb_t&& postcb);
32
33 void QueueDiskRead(uint32_t addr, size_t size, uint16_t mode,
34 uint32_t lba, Rw11UnitDisk* punit);
35 void QueueDiskWrite(uint32_t addr, size_t size, uint16_t mode,
36 uint32_t lba, Rw11UnitDisk* punit);
37 void QueueDiskWriteCheck(uint32_t addr, size_t size,
38 uint16_t mode, uint32_t lba,
39 Rw11UnitDisk* punit);
40
41 size_t WriteCheck(size_t nwdone);
42
43 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
44 int detail=0) const;
45
46 // statistics counter indices
47 enum stats {
51 };
52
53 protected:
54 // function code values
55 enum func {
59 };
60
61 void SetupDisk(size_t size, uint32_t lba, Rw11UnitDisk* punit,
63 virtual void PreRdmaHook();
64 virtual void PostRdmaHook(size_t nwdone);
65
66 protected:
67 std::vector<uint16_t> fBuf;
69 size_t fNWord;
70 size_t fNBlock;
71 size_t fLba;
72 enum func fFunc;
73 };
74
75} // end namespace Retro
76
77#include "Rw11RdmaDisk.ipp"
78
79#endif
FIXME_docs.
Definition: Rw11Cntl.hpp:42
~Rw11RdmaDisk()
Destructor.
std::vector< uint16_t > fBuf
data buffer
Rw11UnitDisk * fpUnit
UnitDisk to read VirtDisk.
size_t fNWord
words to transfer
virtual void PreRdmaHook()
FIXME_docs.
size_t fNBlock
disk blocks to transfer
virtual void PostRdmaHook(size_t nwdone)
FIXME_docs.
size_t fLba
disk lba
void QueueDiskWrite(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
void SetupDisk(size_t size, uint32_t lba, Rw11UnitDisk *punit, Rw11RdmaDisk::func func)
FIXME_docs.
@ kFuncWriteCheck
write check function
@ kFuncRead
read function
@ kFuncWrite
write function
@ kStatNWritePadded
padded disk write
@ kStatNWChkFail
write check failed
void QueueDiskWriteCheck(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t WriteCheck(size_t nwdone)
FIXME_docs.
void QueueDiskRead(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
enum func fFunc
current function
FIXME_docs.
Definition: Rw11Rdma.hpp:34
std::function< void(int, size_t, RlinkCommandList &, size_t)> postcb_t
Definition: Rw11Rdma.hpp:40
std::function< void(int, size_t, size_t, RlinkCommandList &)> precb_t
Definition: Rw11Rdma.hpp:38
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47