diff options
author | Catherine Sullivan <csully@google.com> | 2020-12-07 14:45:24 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-12-08 16:06:28 -0800 |
commit | ede3fcf5ec67f717e297f060ad00b524a074c4e0 (patch) | |
tree | 0f5217467597c45d4092e8ccbe9d2d28866c0200 /drivers/net/ethernet/google/gve/gve_desc.h | |
parent | 4944db80ac1133fe4acb0c9756758da088338b26 (diff) |
gve: Add support for raw addressing to the rx path
Add support to use raw dma addresses in the rx path. Due to this new
support we can alloc a new buffer instead of making a copy.
RX buffers are handed to the networking stack and are
re-allocated as needed, avoiding the need to use
skb_copy_to_linear_data() as in "qpl" mode.
Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/google/gve/gve_desc.h')
-rw-r--r-- | drivers/net/ethernet/google/gve/gve_desc.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/google/gve/gve_desc.h b/drivers/net/ethernet/google/gve/gve_desc.h index 54779871d52e..a1c0aaa60139 100644 --- a/drivers/net/ethernet/google/gve/gve_desc.h +++ b/drivers/net/ethernet/google/gve/gve_desc.h @@ -72,12 +72,15 @@ struct gve_rx_desc { } __packed; static_assert(sizeof(struct gve_rx_desc) == 64); -/* As with the Tx ring format, the qpl_offset entries below are offsets into an - * ordered list of registered pages. +/* If the device supports raw dma addressing then the addr in data slot is + * the dma address of the buffer. + * If the device only supports registered segments then the addr is a byte + * offset into the registered segment (an ordered list of pages) where the + * buffer is. */ -struct gve_rx_data_slot { - /* byte offset into the rx registered segment of this slot */ +union gve_rx_data_slot { __be64 qpl_offset; + __be64 addr; }; /* GVE Recive Packet Descriptor Seq No */ |