aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dev/dev.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-11-08 19:12:27 +0000
committerDamjan Marion <damarion@cisco.com>2023-11-13 12:21:45 +0000
commite596ca1b51d25c24bd06132f9824d4bd0c6a5ecc (patch)
tree9d44c3ede674ef6f8822328117a2561ec10c1f1d /src/vnet/dev/dev.c
parent64d6463d2eac0c0fe434f3a7aa56fe4d85c046d9 (diff)
dev: add change_max_rx_frame_size capability
Type: improvement Change-Id: I922e216818b78f2fe7689c21a1d27d74a0ae28b8 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/dev/dev.c')
-rw-r--r--src/vnet/dev/dev.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/vnet/dev/dev.c b/src/vnet/dev/dev.c
index bedc7fb9aec..9b99fe432a4 100644
--- a/src/vnet/dev/dev.c
+++ b/src/vnet/dev/dev.c
@@ -92,14 +92,18 @@ vnet_dev_init (vlib_main_t *vm, vnet_dev_t *dev)
if ((rv = bus->ops.device_open (vm, dev)) != VNET_DEV_OK)
return rv;
- if ((rv = dev->ops.alloc (vm, dev)) != VNET_DEV_OK)
+ if (dev->ops.alloc)
{
- log_err (dev, "device init failed [rv %d]", rv);
- if (dev->ops.deinit)
- dev->ops.deinit (vm, dev);
- if (dev->ops.free)
- dev->ops.free (vm, dev);
- return rv;
+ rv = dev->ops.alloc (vm, dev);
+ if (rv != VNET_DEV_OK)
+ {
+ log_err (dev, "device init failed [rv %d]", rv);
+ if (dev->ops.deinit)
+ dev->ops.deinit (vm, dev);
+ if (dev->ops.free)
+ dev->ops.free (vm, dev);
+ return rv;
+ }
}
if ((rv = dev->ops.init (vm, dev)) != VNET_DEV_OK)