diff options
author | Bailey Forrest <bcf@google.com> | 2021-06-24 21:06:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-24 22:47:38 +0300 |
commit | 1f6228e459f8bcfcda2f6a157bbd1ceb57b566f4 (patch) | |
tree | 457eee849ad0752279554990408e8cfc0a3057e6 /drivers/net/ethernet/google/gve/gve_ethtool.c | |
parent | a4aa1f1e69df5612bcc0d7cf2ca23b9fae79941b (diff) | |
download | linux-1f6228e459f8bcfcda2f6a157bbd1ceb57b566f4.tar.xz |
gve: Update adminq commands to support DQO queues
DQO queue creation requires additional parameters:
- TX completion/RX buffer queue size
- TX completion/RX buffer queue address
- TX/RX queue size
- RX buffer size
Signed-off-by: Bailey Forrest <bcf@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/google/gve/gve_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/google/gve/gve_ethtool.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c index 5fb05cf36b49..ccaf68562312 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: (GPL-2.0 OR MIT) /* Google virtual Ethernet (gve) driver * - * Copyright (C) 2015-2019 Google, Inc. + * Copyright (C) 2015-2021 Google, Inc. */ #include <linux/ethtool.h> @@ -453,11 +453,16 @@ static int gve_set_tunable(struct net_device *netdev, switch (etuna->id) { case ETHTOOL_RX_COPYBREAK: + { + u32 max_copybreak = gve_is_gqi(priv) ? + (PAGE_SIZE / 2) : priv->data_buffer_size_dqo; + len = *(u32 *)value; - if (len > PAGE_SIZE / 2) + if (len > max_copybreak) return -EINVAL; priv->rx_copybreak = len; return 0; + } default: return -EOPNOTSUPP; } |