Skip to content

Commit 087b24d

Browse files
minadavem330
authored andcommitted
queue_api: define queue api
This API enables the net stack to reset the queues used for devmem TCP. Signed-off-by: Mina Almasry <almasrymina@google.com> Signed-off-by: Shailend Chand <shailend@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 173e762 commit 087b24d

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

include/linux/netdevice.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,7 @@ enum netdev_reg_state {
19571957
* @sysfs_rx_queue_group: Space for optional per-rx queue attributes
19581958
* @rtnl_link_ops: Rtnl_link_ops
19591959
* @stat_ops: Optional ops for queue-aware statistics
1960+
* @queue_mgmt_ops: Optional ops for queue management
19601961
*
19611962
* @gso_max_size: Maximum size of generic segmentation offload
19621963
* @tso_max_size: Device (as in HW) limit on the max TSO request size
@@ -2340,6 +2341,8 @@ struct net_device {
23402341

23412342
const struct netdev_stat_ops *stat_ops;
23422343

2344+
const struct netdev_queue_mgmt_ops *queue_mgmt_ops;
2345+
23432346
/* for setting kernel sock attribute on TCP connection setup */
23442347
#define GSO_MAX_SEGS 65535u
23452348
#define GSO_LEGACY_MAX_SIZE 65536u

include/net/netdev_queues.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,37 @@ struct netdev_stat_ops {
8787
struct netdev_queue_stats_tx *tx);
8888
};
8989

90+
/**
91+
* struct netdev_queue_mgmt_ops - netdev ops for queue management
92+
*
93+
* @ndo_queue_mem_size: Size of the struct that describes a queue's memory.
94+
*
95+
* @ndo_queue_mem_alloc: Allocate memory for an RX queue at the specified index.
96+
* The new memory is written at the specified address.
97+
*
98+
* @ndo_queue_mem_free: Free memory from an RX queue.
99+
*
100+
* @ndo_queue_start: Start an RX queue with the specified memory and at the
101+
* specified index.
102+
*
103+
* @ndo_queue_stop: Stop the RX queue at the specified index. The stopped
104+
* queue's memory is written at the specified address.
105+
*/
106+
struct netdev_queue_mgmt_ops {
107+
size_t ndo_queue_mem_size;
108+
int (*ndo_queue_mem_alloc)(struct net_device *dev,
109+
void *per_queue_mem,
110+
int idx);
111+
void (*ndo_queue_mem_free)(struct net_device *dev,
112+
void *per_queue_mem);
113+
int (*ndo_queue_start)(struct net_device *dev,
114+
void *per_queue_mem,
115+
int idx);
116+
int (*ndo_queue_stop)(struct net_device *dev,
117+
void *per_queue_mem,
118+
int idx);
119+
};
120+
90121
/**
91122
* DOC: Lockless queue stopping / waking helpers.
92123
*

0 commit comments

Comments
 (0)