mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 22:04:47 +08:00
37149e9374
This enables the driver to receive RX packets spread across multiple buffers: For a given multi-fragment packet the "packet continuation" bit is set on all descriptors except the last one. These descriptors' payloads are combined into a single SKB before the SKB is handed to the networking stack. This change adds a "packet buffer size" notion for RX queues. The CreateRxQueue AdminQueue command sent to the device now includes the packet_buffer_size. We opt for a packet_buffer_size of PAGE_SIZE / 2 to give the driver the opportunity to flip pages where we can instead of copying. Signed-off-by: David Awogbemila <awogbemila@google.com> Signed-off-by: Jeroen de Borst <jeroendb@google.com> Reviewed-by: Catherine Sullivan <csully@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
29 lines
840 B
C
29 lines
840 B
C
/* SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
|
* Google virtual Ethernet (gve) driver
|
|
*
|
|
* Copyright (C) 2015-2021 Google, Inc.
|
|
*/
|
|
|
|
#ifndef _GVE_UTILS_H
|
|
#define _GVE_UTILS_H
|
|
|
|
#include <linux/etherdevice.h>
|
|
|
|
#include "gve.h"
|
|
|
|
void gve_tx_remove_from_block(struct gve_priv *priv, int queue_idx);
|
|
void gve_tx_add_to_block(struct gve_priv *priv, int queue_idx);
|
|
|
|
void gve_rx_remove_from_block(struct gve_priv *priv, int queue_idx);
|
|
void gve_rx_add_to_block(struct gve_priv *priv, int queue_idx);
|
|
|
|
struct sk_buff *gve_rx_copy(struct net_device *dev, struct napi_struct *napi,
|
|
struct gve_rx_slot_page_info *page_info, u16 len,
|
|
u16 pad, struct gve_rx_ctx *ctx);
|
|
|
|
/* Decrement pagecnt_bias. Set it back to INT_MAX if it reached zero. */
|
|
void gve_dec_pagecnt_bias(struct gve_rx_slot_page_info *page_info);
|
|
|
|
#endif /* _GVE_UTILS_H */
|
|
|