xref: /illumos-gate/usr/src/man/man9f/mac_maxsdu_update.9f (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2016 Joyent, Inc.
13.\"
14.Dd June 02, 2016
15.Dt MAC_MAXSDU_UPDATE 9F
16.Os
17.Sh NAME
18.Nm mac_maxsdu_update
19.Nd indicate that a device's maximum data size has changed
20.Sh SYNOPSIS
21.In sys/mac_provider.h
22.Ft int
23.Fo mac_maxsdu_update
24.Fa "mac_handle_t mh"
25.Fa "uint_t sdu"
26.Fc
27.Sh INTERFACE LEVEL
28illumos DDI specific
29.Sh PARAMETERS
30.Bl -tag -width Fa
31.It Fa mh
32The MAC handle obtained from a call to
33.Xr mac_register 9F .
34.It Fa sdu
35An integer representing the maximum size data payload.
36.El
37.Sh DESCRIPTION
38The
39.Fn mac_maxsdu_update
40function is used to inform the MAC layer that the device represented by
41the handle
42.Fa mh
43has changed the largest size frame that it can transmit, also known as
44its Send Data Unit (SDU).
45This should be called when the device's MTU has been requested to be changed
46when a driver's
47.Xr mc_setprop 9E
48entry point has been called with the property
49.Sy MAC_PROP_MTU
50or some other device-related event occurring.
51.Pp
52The
53.Fa sdu
54represents the size of the largest payload ignoring the size of its own
55headers or any margin.
56For example, for an Ethernet-based device, this size should not include the
57Ethernet header or any VLAN tags.
58.Pp
59Through VNICs and other virtual data links, many different devices may
60be using a single physical device and have their own MTUs.
61The system takes care of those concerns and will not ask a device driver to
62update the MTU without verifying this.
63.Sh RETURN VALUES
64Upon successful completion, the
65.Fn mac_maxsdu_update
66function returns
67.Sy 0 .
68Otherwise, a non-negative error is returned.
69.Sh EXAMPLES
70For an example of how a device driver should use the
71.Fn mac_maxsdu_update
72function, see the
73.Sx EXAMPLES
74section in
75.Xr mc_setprop 9E .
76.Sh ERRORS
77The
78.Fn max_maxsdu_update
79function may fail if:
80.Bl -tag -width Er
81.It Er EINVAL
82The specified
83.Fa sdu
84is lower than the minimum SDU of the device.
85.El
86.Sh SEE ALSO
87.Xr mac 9E ,
88.Xr mc_setprop 9E ,
89.Xr mac_register 9F
90