Skip to content

Commit ed13b01

Browse files
authored
Merge pull request #75 from GoogleCloudPlatform/dkms-fix
gve: update dkms.conf to use yes instead of Y
2 parents d4e3772 + 93fa350 commit ed13b01

File tree

9 files changed

+38
-39
lines changed

9 files changed

+38
-39
lines changed

build/README

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,20 @@ Where gve-dkms_1.1.0_all.deb is the driver deb package that you have been suppli
154154
```shell
155155
modprobe gve
156156
```
157-
This loads the driver until you remove it with rmmod or you reboot.
157+
158+
This loads the driver until you remove it with rmmod or you reboot. If a driver
159+
was already installed or came with the kernel and `modprobe` does not update the
160+
driver version, you need to manually remove the module and point to the `gve.ko`
161+
file installed from the debian package (you can find the path in the output of
162+
the command in step 1). You can use this command to do so:
163+
164+
> [!WARNING]
165+
> Run this as a single line, as running `rmmod` alone will remove the existing
166+
> driver and disconnect you if connected over SSH.
167+
168+
```bash
169+
sudo rmmod gve; sudo insmod /path/to/gve.ko
170+
```
158171

159172
3. To have the driver automatically load on boot if you are using systemd run:
160173
```shell

build/gve.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static inline int gve_get_enable_header_split(struct gve_priv *priv)
901901
{
902902
return test_bit(GVE_PRIV_FLAGS_ENABLE_HEADER_SPLIT, &priv->ethtool_flags);
903903
}
904-
static inline int gve_get_enable_max_rx_buffer_size(struct gve_priv *priv){
904+
static inline int gve_get_enable_max_rx_buffer_size(struct gve_priv *priv) {
905905
return test_bit(GVE_PRIV_FLAGS_ENABLE_MAX_RX_BUFFER_SIZE, &priv->ethtool_flags);
906906
}
907907
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0) */

build/gve_adminq.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ int gve_adminq_configure_rss(struct gve_priv *priv, struct ethtool_rxfh_param *r
13881388
}
13891389
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
13901390
int gve_adminq_configure_rss(struct gve_priv *priv, const u32 *indir,
1391-
const u8 *hash_key, const u8 hfunc){
1391+
const u8 *hash_key, const u8 hfunc) {
13921392
dma_addr_t lut_bus = 0, key_bus = 0;
13931393
u16 key_size = 0, lut_size = 0;
13941394
union gve_adminq_command cmd;
@@ -1413,7 +1413,6 @@ default: return -EOPNOTSUPP;
14131413
if (!lut)
14141414
return -ENOMEM;
14151415

1416-
14171416
for(i = 0;i < priv->rss_lut_size;i++)
14181417
lut[i] = cpu_to_be32(indir[i]);
14191418
}
@@ -1569,7 +1568,7 @@ static int gve_adminq_process_rss_query(struct gve_priv *priv,
15691568
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
15701569
static int gve_adminq_process_rss_query(struct gve_priv *priv,
15711570
struct gve_query_rss_descriptor *descriptor,
1572-
u32 *indir, u8 *key, u8 *hfunc){
1571+
u32 *indir, u8 *key, u8 *hfunc) {
15731572
u32 total_memory_length;
15741573
u16 hash_lut_length;
15751574
void *rss_info_addr;
@@ -1588,12 +1587,10 @@ static int gve_adminq_process_rss_query(struct gve_priv *priv,
15881587
if (hfunc)
15891588
*hfunc = descriptor->hash_alg;
15901589

1591-
15921590
rss_info_addr = (void *)(descriptor + 1);
15931591
if (key)
15941592
memcpy(key, rss_info_addr, priv->rss_key_size);
15951593

1596-
15971594
rss_info_addr += priv->rss_key_size;
15981595
lut = (__be32 *)rss_info_addr;
15991596
if (indir) {
@@ -1635,7 +1632,7 @@ int gve_adminq_query_rss_config(struct gve_priv *priv, struct ethtool_rxfh_param
16351632
}
16361633
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
16371634
int gve_adminq_query_rss_config(struct gve_priv *priv, u32 *indir, u8 *key,
1638-
u8 *hfunc){
1635+
u8 *hfunc) {
16391636
struct gve_query_rss_descriptor *descriptor;
16401637
union gve_adminq_command cmd;
16411638
dma_addr_t descriptor_bus;
@@ -1646,7 +1643,6 @@ int gve_adminq_query_rss_config(struct gve_priv *priv, u32 *indir, u8 *key,
16461643
if (!descriptor)
16471644
return -ENOMEM;
16481645

1649-
16501646
memset(&cmd, 0, sizeof(cmd));
16511647
cmd.opcode = cpu_to_be32(GVE_ADMINQ_QUERY_RSS);
16521648
cmd.query_rss = (struct gve_adminq_query_rss){
@@ -1657,7 +1653,6 @@ int gve_adminq_query_rss_config(struct gve_priv *priv, u32 *indir, u8 *key,
16571653
if (err)
16581654
goto out;
16591655

1660-
16611656
err = gve_adminq_process_rss_query(priv, descriptor, indir, key,
16621657
hfunc);
16631658

build/gve_buffer_mgmt_dqo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int gve_buf_ref_cnt(struct gve_rx_buf_state_dqo *bs)
1414

1515
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,7,0))
1616
void gve_free_page_dqo(struct gve_priv *priv, struct gve_rx_buf_state_dqo *bs,
17-
bool free_page){
17+
bool free_page) {
1818
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
1919
page_ref_sub(bs->page_info.page, bs->page_info.pagecnt_bias - 1);
2020
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) */
@@ -137,7 +137,7 @@ struct gve_rx_buf_state_dqo *gve_get_recycled_buf_state(struct gve_rx_ring *rx)
137137

138138
return NULL;
139139
#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(6,7,0)) */
140-
if (rx->dqo.qpl)return NULL;
140+
if (rx->dqo.qpl) return NULL;
141141
/* If there are no free buf states discard an entry from
142142
* `used_buf_states` so it can be used.
143143
*/
@@ -147,7 +147,6 @@ struct gve_rx_buf_state_dqo *gve_get_recycled_buf_state(struct gve_rx_ring *rx)
147147
if (gve_buf_ref_cnt(buf_state) == 0)
148148
return buf_state;
149149

150-
151150
gve_free_page_dqo(rx->gve, buf_state, true);
152151
gve_free_buf_state(rx, buf_state);
153152
}
@@ -209,7 +208,7 @@ void gve_free_qpl_page_dqo(struct gve_rx_buf_state_dqo *buf_state)
209208

210209
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,7,0))
211210
int gve_alloc_page_dqo(struct gve_rx_ring *rx,
212-
struct gve_rx_buf_state_dqo *buf_state){
211+
struct gve_rx_buf_state_dqo *buf_state) {
213212
struct gve_priv *priv = rx->gve;
214213
u32 idx;
215214

build/gve_ethtool.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ static int gve_set_priv_flags(struct net_device *netdev, u32 flags)
802802
else
803803
new_packet_buffer_size = GVE_DEFAULT_RX_BUFFER_SIZE;
804804

805-
806805
err = gve_set_buffer_size_config(priv, enable_hdr_split,
807806
new_packet_buffer_size);
808807
if (err)
@@ -1006,13 +1005,12 @@ static int gve_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rx
10061005
}
10071006
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
10081007
static int gve_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
1009-
u8 *hfunc){
1008+
u8 *hfunc) {
10101009
struct gve_priv *priv = netdev_priv(netdev);
10111010

10121011
if (!priv->rss_key_size || !priv->rss_lut_size)
10131012
return -EOPNOTSUPP;
10141013

1015-
10161014
return gve_adminq_query_rss_config(priv, indir, key, hfunc);
10171015
}
10181016
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
@@ -1030,13 +1028,12 @@ static int gve_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rx
10301028
}
10311029
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */
10321030
static int gve_set_rxfh(struct net_device *netdev, const u32 *indir,
1033-
const u8 *key, const u8 hfunc){
1031+
const u8 *key, const u8 hfunc) {
10341032
struct gve_priv *priv = netdev_priv(netdev);
10351033

10361034
if (!priv->rss_key_size || !priv->rss_lut_size)
10371035
return -EOPNOTSUPP;
10381036

1039-
10401037
return gve_adminq_configure_rss(priv, indir, key, hfunc);
10411038
}
10421039
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,5) */

build/gve_main.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#define GVE_DEFAULT_RX_COPYBREAK (256)
3939

4040
#define DEFAULT_MSG_LEVEL (NETIF_MSG_DRV | NETIF_MSG_LINK)
41-
#define GVE_VERSION "1.4.5-0--b95625d-oot"
41+
#define GVE_VERSION "1.4.5.1-0-d3ec7a0-d3ec7a0-oot"
4242
#define GVE_VERSION_PREFIX "GVE-"
4343

4444
// Minimum amount of time between queue kicks in msec (10 seconds)
@@ -151,7 +151,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
151151
}
152152
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)) && (RHEL_RELEASE_CODE <= RHEL_RELEASE_VERSION(7,6))
153153
static struct rtnl_link_stats64 *
154-
backport_gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s){
154+
backport_gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) {
155155
gve_get_stats(dev, s);
156156
return s;
157157
}
@@ -270,7 +270,7 @@ static void gve_stats_report_schedule(struct gve_priv *priv)
270270
}
271271

272272
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
273-
static void gve_stats_report_timer(unsigned long data){
273+
static void gve_stats_report_timer(unsigned long data) {
274274
struct gve_priv *priv = (struct gve_priv *)data;
275275
mod_timer(&priv->stats_report_timer,
276276
round_jiffies(jiffies + msecs_to_jiffies(priv->stats_report_timer_period)));
@@ -1480,7 +1480,7 @@ static void gve_drain_page_cache(struct gve_priv *priv)
14801480
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6,9,0) || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(10,0) */
14811481
int i;
14821482
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,9,0) || RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(10,0)
1483-
for (i = 0; i < priv->rx_cfg.num_queues; i++) {
1483+
for (i = 0;i < priv->rx_cfg.num_queues;i++) {
14841484
nc = &priv->rx[i].page_cache;
14851485
if (nc->va) {
14861486
__page_frag_cache_drain(virt_to_page(nc->va),
@@ -2279,7 +2279,7 @@ static void gve_tx_timeout(struct net_device *dev, unsigned int txqueue)
22792279
}
22802280
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8, 3) || UBUNTU_VERSION_CODE >= UBUNTU_VERSION(5,4,0,1071) || defined(KUNIT_KERNEL)) */
22812281
static void
2282-
backport_gve_tx_timeout(struct net_device *dev){
2282+
backport_gve_tx_timeout(struct net_device *dev) {
22832283
struct gve_priv *priv = netdev_priv(dev);
22842284
gve_schedule_reset(priv);
22852285
priv->tx_timeo_cnt++;
@@ -2288,13 +2288,9 @@ backport_gve_tx_timeout(struct net_device *dev){
22882288

22892289
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0))
22902290
int gve_set_buffer_size_config(struct gve_priv *priv, bool enable_hdr_split,
2291-
int new_pkt_buf_size){
2292-
struct gve_tx_alloc_rings_cfg tx_alloc_cfg = {
2293-
0
2294-
};
2295-
struct gve_rx_alloc_rings_cfg rx_alloc_cfg = {
2296-
0
2297-
};
2291+
int new_pkt_buf_size) {
2292+
struct gve_tx_alloc_rings_cfg tx_alloc_cfg = { 0 };
2293+
struct gve_rx_alloc_rings_cfg rx_alloc_cfg = { 0 };
22982294
int err = 0;
22992295

23002296
gve_get_curr_alloc_cfgs(priv, &tx_alloc_cfg, &rx_alloc_cfg);
@@ -2391,7 +2387,7 @@ static int gve_set_features(struct net_device *netdev,
23912387
}
23922388

23932389
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
2394-
int gve_change_mtu(struct net_device *dev, int new_mtu){
2390+
int gve_change_mtu(struct net_device *dev, int new_mtu) {
23952391
struct gve_priv *priv = netdev_priv(dev);
23962392

23972393
if (new_mtu < ETH_MIN_MTU || new_mtu > priv->max_mtu)

build/gve_rx_dqo.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ static void gve_rx_reset_ring_dqo(struct gve_priv *priv, int idx)
102102
else
103103
gve_free_qpl_page_dqo(bs);
104104
#else
105-
if (bs->page_info.page)gve_free_page_dqo(priv, bs,
106-
!rx->dqo.qpl);
105+
if (bs->page_info.page) gve_free_page_dqo(priv, bs,
106+
!rx->dqo.qpl);
107107
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)) */
108108
}
109109
}
@@ -153,8 +153,8 @@ void gve_rx_free_ring_dqo(struct gve_priv *priv, struct gve_rx_ring *rx,
153153
else
154154
gve_free_qpl_page_dqo(bs);
155155
#else
156-
if (bs->page_info.page)gve_free_page_dqo(priv, bs,
157-
!rx->dqo.qpl);
156+
if (bs->page_info.page) gve_free_page_dqo(priv, bs,
157+
!rx->dqo.qpl);
158158
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)) */
159159
}
160160

@@ -427,7 +427,6 @@ void gve_rx_post_buffers_dqo(struct gve_rx_ring *rx)
427427
if (unlikely(!buf_state))
428428
break;
429429

430-
431430
if (unlikely(gve_alloc_page_dqo(rx, buf_state))) {
432431
u64_stats_update_begin(&rx->statss);
433432
rx->rx_buf_alloc_fail++;

dkms.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ DEST_MODULE_LOCATION="/updates"
55
PACKAGE_NAME=gve
66
PACKAGE_VERSION=
77
REMAKE_INITRD=no
8-
AUTOINSTALL=Y
8+
AUTOINSTALL=yes

google/gve/gve_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define GVE_DEFAULT_RX_COPYBREAK (256)
3030

3131
#define DEFAULT_MSG_LEVEL (NETIF_MSG_DRV | NETIF_MSG_LINK)
32-
#define GVE_VERSION "1.4.5"
32+
#define GVE_VERSION "1.4.5.1"
3333
#define GVE_VERSION_PREFIX "GVE-"
3434

3535
// Minimum amount of time between queue kicks in msec (10 seconds)

0 commit comments

Comments
 (0)