666dec77b38e2dd00d644366f78e51c56ce16b0b
[vpp.git] / src / plugins / vmxnet3 / vmxnet3.h
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef __included_vmnet_vmnet_h__
17 #define __included_vmnet_vmnet_h__
18
19 #define foreach_vmxnet3_tx_func_error          \
20   _(ERROR_PACKETS, "error packets") \
21   _(NO_FREE_SLOTS, "no free tx slots")
22
23 typedef enum
24 {
25 #define _(f,s) VMXNET3_TX_ERROR_##f,
26   foreach_vmxnet3_tx_func_error
27 #undef _
28     VMXNET3_TX_N_ERROR,
29 } vmxnet3_tx_func_error_t;
30
31 #define foreach_vmxnet3_rxmode_flags \
32   _(0, UCAST, "unicast") \
33   _(1, MCAST, "multicast")                 \
34   _(2, BCAST, "broadcast") \
35   _(3, ALL_MULTI, "all multicast") \
36   _(4, PROMISC, "promiscuous")
37
38 enum
39 {
40 #define _(a, b, c) VMXNET3_RXMODE_##b = (1 << a),
41   foreach_vmxnet3_rxmode_flags
42 #undef _
43 };
44
45 /* BAR 0 */
46 #define VMXNET3_REG_IMR     0x0000      /* Interrupt Mask Register */
47 #define VMXNET3_REG_TXPROD  0x0600      /* Tx Producer Index */
48 #define VMXNET3_REG_RXPROD  0x0800      /* Rx Producer Index for ring 1 */
49 #define VMXNET3_REG_RXPROD2 0x0A00      /* Rx Producer Index for ring 2 */
50
51
52 /* BAR 1 */
53 #define VMXNET3_REG_VRRS 0x0000 /* VMXNET3 Revision Report Selection */
54 #define VMXNET3_REG_UVRS 0x0008 /* UPT Version Report Selection */
55 #define VMXNET3_REG_DSAL 0x0010 /* Driver Shared Address Low */
56 #define VMXNET3_REG_DSAH 0x0018 /* Driver Shared Address High */
57 #define VMXNET3_REG_CMD  0x0020 /* Command */
58 #define VMXNET3_REG_MACL 0x0028 /* MAC Address Low */
59 #define VMXNET3_REG_MACH 0x0030 /* MAC Address High */
60 #define VMXNET3_REG_ICR  0x0038 /* Interrupt Cause Register */
61 #define VMXNET3_REG_ECR  0x0040 /* Event Cause Register */
62
63 #define VMXNET3_VLAN_LEN 4
64 #define VMXNET3_FCS_LEN  4
65 #define VMXNET3_MTU (1514 + VMXNET3_VLAN_LEN + VMXNET3_FCS_LEN)
66
67 #define VMXNET3_RXF_BTYPE (1 << 14)     /* rx body buffer type */
68 #define VMXNET3_RXF_GEN   (1 << 31)     /* rx generation */
69 #define VMXNET3_RXCF_IP6  (1 << 20)     /* rx ip6 packet */
70 #define VMXNET3_RXCF_IP4  (1 << 21)     /* rx ip4 packet */
71 #define VMXNET3_RXCF_GEN  (1 << 31)     /* rx completion generation */
72 #define VMXNET3_RXC_INDEX (0xFFF)       /* rx completion index mask */
73
74 #define VMXNET3_TXF_GEN  (1 << 14)      /* tx generation */
75 #define VMXNET3_TXF_EOP  (1 << 12)      /* tx end of packet */
76 #define VMXNET3_TXF_CQ   (1 << 13)      /* tx completion request */
77 #define VMXNET3_TXCF_GEN (1 << 31)      /* tx completion generation */
78 #define VMXNET3_TXC_INDEX (0xFFF)       /* tx completion index mask */
79
80 #define VMXNET3_RX_RING_SIZE 2
81 #define VMXNET3_INPUT_REFILL_THRESHOLD 32
82 #define VMXNET3_NUM_TX_DESC 1024
83 #define VMXNET3_NUM_TX_COMP VMXNET3_NUM_TX_DESC
84 #define VMXNET3_NUM_RX_DESC 1024
85 #define VMXNET3_NUM_RX_COMP VMXNET3_NUM_RX_DESC
86
87 #define VMXNET3_VERSION_MAGIC 0x69505845
88 #define VMXNET3_SHARED_MAGIC  0xbabefee1
89 #define VMXNET3_VERSION_SELECT     1
90 #define VMXNET3_UPT_VERSION_SELECT 1
91 #define VMXNET3_MAX_INTRS          25
92 #define VMXNET3_IC_DISABLE_ALL     0x1
93
94 #define VMXNET3_GOS_BITS_32     (1 << 0)
95 #define VMXNET3_GOS_BITS_64     (2 << 0)
96 #define VMXNET3_GOS_TYPE_LINUX  (1 << 2)
97 #define VMXNET3_RXCL_LEN_MASK   (0x3FFF)        // 14 bits
98 #define VMXNET3_RXCL_ERROR      (1 << 14)
99 #define VMXNET3_RXCI_EOP        (1 << 14)
100 #define VMXNET3_RXCI_SOP        (1 << 15)
101
102 #define foreach_vmxnet3_device_flags \
103   _(0, INITIALIZED, "initialized") \
104   _(1, ERROR, "error")             \
105   _(2, ADMIN_UP, "admin-up") \
106   _(3, IOVA, "iova") \
107   _(4, LINK_UP, "link-up") \
108   _(5, SHARED_TXQ_LOCK, "shared-txq-lock") \
109   _(6, ELOG, "elog")
110
111 enum
112 {
113 #define _(a, b, c) VMXNET3_DEVICE_F_##b = (1 << a),
114   foreach_vmxnet3_device_flags
115 #undef _
116 };
117
118 #define foreach_vmxnet3_set_cmds \
119   _(0, ACTIVATE_DEV, "activate device") \
120   _(1, QUIESCE_DEV, "quiesce device") \
121   _(2, RESET_DEV, "reset device") \
122   _(3, UPDATE_RX_MODE, "update rx mode") \
123   _(4, UPDATE_MAC_FILTERS, "update mac filters") \
124   _(5, UPDATE_VLAN_FILTERS, "update vlan filters") \
125   _(6, UPDATE_RSSIDT, "update rss idt") \
126   _(7, UPDATE_IML, "update iml") \
127   _(8, UPDATE_PMCFG, "update pm cfg") \
128   _(9, UPDATE_FEATURE, "update feature") \
129   _(10, STOP_EMULATION, "stop emulation") \
130   _(11, LOAD_PLUGIN, "load plugin") \
131   _(12, ACTIVATE_VF, "activate vf") \
132   _(13, RESERVED3, "reserved 3") \
133   _(14, RESERVED4, "reservced 4") \
134   _(15, REGISTER_MEMREGS, "register mem regs")
135
136 enum
137 {
138 #define _(a, b, c) VMXNET3_CMD_##b = (a + 0xCAFE0000),
139   foreach_vmxnet3_set_cmds
140 #undef _
141 };
142
143 #define foreach_vmxnet3_get_cmds \
144   _(0, GET_QUEUE_STATUS, "get queue status") \
145   _(1, GET_STATS, "get stats") \
146   _(2, GET_LINK, "get link") \
147   _(3, GET_PERM_MAC_LO, "get perm mac lo") \
148   _(4, GET_PERM_MAC_HI, "get perm mac hi") \
149   _(5, GET_DID_LO, "get did lo") \
150   _(6, GET_DID_HI, "get did hi") \
151   _(7, GET_DEV_EXTRA_INFO, "get dev extra info") \
152   _(8, GET_CONF_INTR, "get conf intr") \
153   _(9, GET_ADAPTIVE_RING_INFO, "get adaptive ring info") \
154   _(10, GET_TXDATA_DESC_SIZE, "gte txdata desc size") \
155   _(11, RESERVED5, "reserved5")
156
157 enum
158 {
159 #define _(a, b, c) VMXNET3_CMD_##b = (a + 0xF00D0000),
160   foreach_vmxnet3_get_cmds
161 #undef _
162 };
163
164 typedef CLIB_PACKED (struct
165                      {
166                      u32 version; u32 guest_info; u32 version_support;
167                      u32 upt_version_support; u64 upt_features;
168                      u64 driver_data_address; u64 queue_desc_address;
169                      u32 driver_data_len; u32 queue_desc_len;
170                      u32 mtu;
171                      u16 max_num_rx_sg; u8 num_tx_queues; u8 num_rx_queues;
172                      u32 pad[4];
173                      }) vmxnet3_misc_config;
174
175 typedef CLIB_PACKED (struct
176                      {
177                      u8 mask_mode;
178                      u8 num_intrs;
179                      u8 event_intr_index;
180                      u8 moderation_level[VMXNET3_MAX_INTRS]; u32 control;
181                      u32 pad[2];
182                      }) vmxnet3_interrupt_config;
183
184 typedef CLIB_PACKED (struct
185                      {
186                      u32 mode;
187                      u16 multicast_len;
188                      u16 pad; u64 multicast_address; u8 vlan_filter[512];
189                      }) vmxnet3_rx_filter_config;
190
191 typedef CLIB_PACKED (struct
192                      {
193                      u32 version; u32 length;
194                      u64 address;
195                      }) vmxnet3_variable_config;
196
197 typedef CLIB_PACKED (struct
198                      {
199                      u32 magic;
200                      u32 pad;
201                      vmxnet3_misc_config misc;
202                      vmxnet3_interrupt_config interrupt;
203                      vmxnet3_rx_filter_config rx_filter;
204                      vmxnet3_variable_config rss;
205                      vmxnet3_variable_config pattern;
206                      vmxnet3_variable_config plugin; u32 ecr;
207                      u32 pad1[5];
208                      }) vmxnet3_shared;
209
210 typedef CLIB_PACKED (struct
211                      {
212                      u8 stopped;
213                      u8 pad[3];
214                      u32 error;
215                      }) vmxnet3_queue_status;
216
217 typedef CLIB_PACKED (struct
218                      {
219                      u32 num_deferred; u32 threshold;
220                      u64 pad;
221                      }) vmxnet3_tx_queue_control;
222
223 typedef CLIB_PACKED (struct
224                      {
225                      u64 desc_address;
226                      u64 data_address;
227                      u64 comp_address; u64 driver_data_address; u64 pad;
228                      u32 num_desc;
229                      u32 num_data;
230                      u32 num_comp; u32 driver_data_len; u8 intr_index;
231                      u8 pad1[7];
232                      }) vmxnet3_tx_queue_config;
233
234 typedef CLIB_PACKED (struct
235                      {
236                      u64 tso_pkts;
237                      u64 tso_bytes;
238                      u64 ucast_pkts; u64 ucast_bytes; u64 mcast_pkts;
239                      u64 mcast_bytes;
240                      u64 bcast_pkts; u64 bcast_bytes; u64 error_pkts;
241                      u64 discard_pkts;
242                      }) vmxnet3_tx_stats;
243
244 typedef CLIB_PACKED (struct
245                      {
246                      vmxnet3_tx_queue_control ctrl;
247                      vmxnet3_tx_queue_config cfg;
248                      vmxnet3_queue_status status; vmxnet3_tx_stats stats;
249                      u8 pad[88];
250                      }) vmxnet3_tx_queue;
251
252 typedef CLIB_PACKED (struct
253                      {
254                      u8 update_prod; u8 pad[7];
255                      u64 pad1;
256                      }) vmxnet3_rx_queue_control;
257
258 typedef CLIB_PACKED (struct
259                      {
260                      u64 desc_address[2];
261                      u64 comp_address; u64 driver_data_address; u64 pad;
262                      u32 num_desc[2];
263                      u32 num_comp; u32 driver_data_len; u8 intr_index;
264                      u8 pad1[7];
265                      }) vmxnet3_rx_queue_config;
266
267 typedef CLIB_PACKED (struct
268                      {
269                      u64 lro_pkts;
270                      u64 lro_bytes;
271                      u64 ucast_pkts; u64 ucast_bytes; u64 mcast_pkts;
272                      u64 mcast_bytes;
273                      u64 bcast_pkts; u64 bcast_bytes; u64 nobuf_pkts;
274                      u64 error_pkts;
275                      }) vmxnet3_rx_stats;
276
277 typedef CLIB_PACKED (struct
278                      {
279                      vmxnet3_rx_queue_control ctrl;
280                      vmxnet3_rx_queue_config cfg;
281                      vmxnet3_queue_status status; vmxnet3_rx_stats stats;
282                      u8 pad[88];
283                      }) vmxnet3_rx_queue;
284
285 typedef CLIB_PACKED (struct
286                      {
287                      vmxnet3_tx_queue tx; vmxnet3_rx_queue rx;
288                      }) vmxnet3_queues;
289
290 /*
291  * flags:
292  *   buffer length   -- bits 0-13
293  *   buffer type     -- bit  14
294  *   descriptor type -- bit  15
295  *   reserved        -- bits 16-30
296  *   generation      -- bit  31
297  */
298 typedef CLIB_PACKED (struct
299                      {
300                      u64 address;
301                      u32 flags;
302                      u32 pad;
303                      }) vmxnet3_rx_desc;
304
305 /*
306  * index:
307  *   RX desc index           -- bits 0-11
308  *   ext1                    -- bits 12-13
309  *   end of packet           -- bit  14
310  *   start of packet         -- bit  15
311  *   ring ID                 -- bits 16-25
312  *   RSS hash type           -- bits 26-29
313  *   checksum not calculated -- bit  30
314  *   ext2                    -- bit  31
315  *
316  * rss: RSS hash value
317  *
318  * len:
319  *   data length             -- bits 0-13
320  *   error                   -- bit  14
321  *   tag is stripped         -- bit  15
322  *   tag stripped            -- bits 16-31
323  *
324  * flags:
325  *   checksum                -- bits 0 - 15
326  *   tcp/udp checksum correct-- bit  16
327  *   udp packet              -- bit  17
328  *   tcp packet              -- bit  18
329  *   ip checksum correct     -- bit  19
330  *   ipv6                    -- bit  20
331  *   ipv4                    -- bit  21
332  *   ip fragment             -- bit  22
333  *   frame crc correct       -- bit  23
334  *   completion type         -- bits 24-30
335  *   generation              -- bit  31
336  */
337 typedef CLIB_PACKED (struct
338                      {
339                      u32 index; u32 rss;
340                      u32 len;
341                      u32 flags;
342                      }) vmxnet3_rx_comp;
343
344 /*
345  * index:
346  *   TX desc index           -- bits 0-11
347  *   ext1                    -- bits 12-31
348  *
349  * flags:
350  *   reserved                -- bits 0-23
351  *   completion type         -- bits 24-30
352  *   generation              -- bit  31
353  */
354 typedef CLIB_PACKED (struct
355                      {
356                      u32 index;
357                      u32 pad[2];
358                      u32 flags;
359                      }) vmxnet3_tx_comp;
360
361 /*
362  * flags[0]:
363  *   length                  -- bits 0-13
364  *   generation              -- bit  14
365  *   reserved                -- bit  15
366  *   descriptor type         -- bit  16
367  *   ext1                    -- bit  17
368  *   MSS, checksum offset    -- bits 18-31
369  * flags[1]:
370  *   header length           -- bits 0-9
371  *   offload mode            -- bits 10-11
372  *   end of packet           -- bit  12
373  *   completion request      -- bit  13
374  *   ext2                    -- bit  14
375  *   vlan tag insertion      -- bit  15
376  *   tag to insert           -- bits 16-31
377  */
378 typedef CLIB_PACKED (struct
379                      {
380                      u64 address;
381                      u32 flags[2];
382                      }) vmxnet3_tx_desc;
383
384 typedef struct
385 {
386   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
387   u32 *bufs;
388   u32 gen;
389   u16 fill;
390   u16 rid;
391   u16 produce;
392   u16 consume;
393 } vmxnet3_rx_ring;
394
395 typedef struct
396 {
397   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
398   u64 next;
399   u32 gen;
400 } vmxnet3_rx_comp_ring;
401
402 typedef struct
403 {
404   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
405   u16 size;
406   u8 int_mode;
407   vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE];
408   vmxnet3_rx_desc *rx_desc[VMXNET3_RX_RING_SIZE];
409   vmxnet3_rx_comp *rx_comp;
410   vmxnet3_rx_comp_ring rx_comp_ring;
411 } vmxnet3_rxq_t;
412
413 typedef struct
414 {
415   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
416   u32 *bufs;
417   u32 gen;
418   u16 produce;
419   u16 consume;
420 } vmxnet3_tx_ring;
421
422 typedef struct
423 {
424   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
425   u64 next;
426   u32 gen;
427 } vmxnet3_tx_comp_ring;
428
429 typedef struct
430 {
431   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
432   u16 size;
433   clib_spinlock_t lock;
434
435   vmxnet3_tx_desc *tx_desc;
436   vmxnet3_tx_comp *tx_comp;
437   vmxnet3_tx_ring tx_ring;
438   vmxnet3_tx_comp_ring tx_comp_ring;
439 } vmxnet3_txq_t;
440
441 typedef CLIB_PACKED (struct
442                      {
443                      vmxnet3_queues queues; vmxnet3_shared shared;
444                      }) vmxnet3_dma;
445
446 typedef struct
447 {
448   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
449   u32 flags;
450   u32 per_interface_next_index;
451
452   u32 dev_instance;
453   u32 sw_if_index;
454   u32 hw_if_index;
455   vlib_pci_dev_handle_t pci_dev_handle;
456   vlib_pci_addr_t pci_addr;
457   void *bar[2];
458
459   /* queues */
460   vmxnet3_rxq_t *rxqs;
461   vmxnet3_txq_t *txqs;
462
463   u16 num_tx_queues;
464   u16 num_rx_queues;
465   u16 num_intrs;
466
467   u8 version;
468   u8 mac_addr[6];
469
470   /* error */
471   clib_error_t *error;
472
473   vmxnet3_dma *dma;
474
475 } vmxnet3_device_t;
476
477 typedef struct
478 {
479   vmxnet3_device_t *devices;
480   vlib_physmem_region_index_t physmem_region;
481   u32 physmem_region_alloc;
482   u16 msg_id_base;
483 } vmxnet3_main_t;
484
485 extern vmxnet3_main_t vmxnet3_main;
486
487 typedef struct
488 {
489   vlib_pci_addr_t addr;
490   u32 enable_elog;
491   u16 rxq_size;
492   u16 txq_size;
493   /* return */
494   i32 rv;
495   u32 sw_if_index;
496   clib_error_t *error;
497 } vmxnet3_create_if_args_t;
498
499 typedef struct
500 {
501   u32 next_index;
502   u32 hw_if_index;
503   vlib_buffer_t buffer;
504 } vmxnet3_input_trace_t;
505
506 void vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args);
507 void vmxnet3_delete_if (vlib_main_t * vm, vmxnet3_device_t * ad);
508
509 extern clib_error_t *vmxnet3_plugin_api_hookup (vlib_main_t * vm);
510 extern vlib_node_registration_t vmxnet3_input_node;
511 extern vnet_device_class_t vmxnet3_device_class;
512
513 /* format.c */
514 format_function_t format_vmxnet3_device;
515 format_function_t format_vmxnet3_device_name;
516 format_function_t format_vmxnet3_input_trace;
517
518 static_always_inline void
519 vmxnet3_reg_write (vmxnet3_device_t * vd, u8 bar, u32 addr, u32 val)
520 {
521   *(volatile u32 *) ((u8 *) vd->bar[bar] + addr) = val;
522 }
523
524 static_always_inline u32
525 vmxnet3_reg_read (vmxnet3_device_t * vd, u8 bar, u32 addr)
526 {
527   return *(volatile u32 *) (vd->bar[bar] + addr);
528 }
529
530 static_always_inline uword
531 vmxnet3_dma_addr (vlib_main_t * vm, vmxnet3_device_t * vd, void *p)
532 {
533   vmxnet3_main_t *vmxm = &vmxnet3_main;
534
535   return (vd->flags & VMXNET3_DEVICE_F_IOVA) ? pointer_to_uword (p) :
536     vlib_physmem_virtual_to_physical (vm, vmxm->physmem_region, p);
537 }
538
539 static_always_inline void
540 vmxnet3_rx_ring_advance_produce (vmxnet3_rxq_t * rxq, vmxnet3_rx_ring * ring)
541 {
542   ring->produce++;
543   if (PREDICT_FALSE (ring->produce == rxq->size))
544     {
545       ring->produce = 0;
546       ring->gen ^= VMXNET3_RXF_GEN;
547     }
548 }
549
550 static_always_inline clib_error_t *
551 vmxnet3_rxq_refill_ring0 (vlib_main_t * vm, vmxnet3_device_t * vd,
552                           vmxnet3_rxq_t * rxq)
553 {
554   vmxnet3_rx_desc *rxd;
555   u16 n_refill, n_alloc;
556   vmxnet3_rx_ring *ring;
557
558   ring = &rxq->rx_ring[0];
559   n_refill = rxq->size - ring->fill;
560
561   if (PREDICT_TRUE (n_refill <= VMXNET3_INPUT_REFILL_THRESHOLD))
562     return 0;
563
564   n_alloc =
565     vlib_buffer_alloc_to_ring (vm, ring->bufs, ring->produce, rxq->size,
566                                n_refill);
567   if (PREDICT_FALSE (n_alloc != n_refill))
568     {
569       if (n_alloc)
570         vlib_buffer_free_from_ring (vm, ring->bufs, ring->produce, rxq->size,
571                                     n_alloc);
572       return clib_error_return (0, "buffer alloc failed");
573     }
574
575   while (n_alloc)
576     {
577       rxd = &rxq->rx_desc[0][ring->produce];
578       rxd->address =
579         vlib_get_buffer_data_physical_address (vm, ring->bufs[ring->produce]);
580       rxd->flags = ring->gen | VLIB_BUFFER_DATA_SIZE;
581
582       vmxnet3_rx_ring_advance_produce (rxq, ring);
583       ring->fill++;
584       n_alloc--;
585     }
586
587   vmxnet3_reg_write (vd, 0, VMXNET3_REG_RXPROD, ring->produce);
588
589   return 0;
590 }
591
592 static_always_inline clib_error_t *
593 vmxnet3_rxq_refill_ring1 (vlib_main_t * vm, vmxnet3_device_t * vd,
594                           vmxnet3_rxq_t * rxq)
595 {
596   vmxnet3_rx_desc *rxd;
597   u16 n_refill, n_alloc;
598   vmxnet3_rx_ring *ring;
599
600   ring = &rxq->rx_ring[1];
601   n_refill = rxq->size - ring->fill;
602
603   if (PREDICT_TRUE (n_refill <= VMXNET3_INPUT_REFILL_THRESHOLD))
604     return 0;
605
606   n_alloc =
607     vlib_buffer_alloc_to_ring (vm, ring->bufs, ring->produce, rxq->size,
608                                n_refill);
609   if (PREDICT_FALSE (n_alloc != n_refill))
610     {
611       if (n_alloc)
612         vlib_buffer_free_from_ring (vm, ring->bufs, ring->produce, rxq->size,
613                                     n_alloc);
614       return clib_error_return (0, "buffer alloc failed");
615     }
616
617   while (n_alloc)
618     {
619       rxd = &rxq->rx_desc[1][ring->produce];
620       rxd->address =
621         vlib_get_buffer_data_physical_address (vm, ring->bufs[ring->produce]);
622       rxd->flags = ring->gen | VLIB_BUFFER_DATA_SIZE | VMXNET3_RXF_BTYPE;
623
624       vmxnet3_rx_ring_advance_produce (rxq, ring);
625       ring->fill++;
626       n_alloc--;
627     }
628
629   vmxnet3_reg_write (vd, 0, VMXNET3_REG_RXPROD2, ring->produce);
630
631   return 0;
632 }
633
634 #endif /* __included_vmnet_vmnet_h__ */
635 /*
636  * fd.io coding-style-patch-verification: ON
637  *
638  * Local Variables:
639  * eval: (c-set-style "gnu")
640  * End:
641  */