]> git.proxmox.com Git - ceph.git/blob - ceph/src/msg/async/dpdk/EventDPDK.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / msg / async / dpdk / EventDPDK.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 /*
3 * Ceph - scalable distributed file system
4 *
5 * Copyright (C) 2015 XSky <haomai@xsky.com>
6 *
7 * Author: Haomai Wang <haomaiwang@gmail.com>
8 *
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
13 *
14 */
15
16 #ifndef CEPH_EVENTDPDK_H
17 #define CEPH_EVENTDPDK_H
18
19 #include "msg/async/Event.h"
20 #include "msg/async/Stack.h"
21 #include "UserspaceEvent.h"
22
23 class DPDKDriver : public EventDriver {
24 CephContext *cct;
25
26 public:
27 UserspaceEventManager manager;
28
29 explicit DPDKDriver(CephContext *c): cct(c), manager(c) {}
30 virtual ~DPDKDriver() { }
31
32 int init(EventCenter *c, int nevent) override;
33 int add_event(int fd, int cur_mask, int add_mask) override;
34 int del_event(int fd, int cur_mask, int del_mask) override;
35 int resize_events(int newsize) override;
36 int event_wait(std::vector<FiredFileEvent> &fired_events, struct timeval *tp) override;
37 bool need_wakeup() override { return false; }
38 };
39
40 #endif //CEPH_EVENTDPDK_H