Skip to content

Commit be389d8

Browse files
committed
tgupdate: merge t/selftests-bpf-Add-bpf_red-scheduler base into t/selftests-bpf-Add-bpf_red-scheduler
2 parents 164be3a + 6ede257 commit be389d8

File tree

108 files changed

+2585
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2585
-284
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/realtek,rtl9301-mdio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Realtek RTL9300 MDIO Controller
8+
9+
maintainers:
10+
- Chris Packham <[email protected]>
11+
12+
properties:
13+
compatible:
14+
oneOf:
15+
- items:
16+
- enum:
17+
- realtek,rtl9302b-mdio
18+
- realtek,rtl9302c-mdio
19+
- realtek,rtl9303-mdio
20+
- const: realtek,rtl9301-mdio
21+
- const: realtek,rtl9301-mdio
22+
23+
'#address-cells':
24+
const: 1
25+
26+
'#size-cells':
27+
const: 0
28+
29+
reg:
30+
maxItems: 1
31+
32+
patternProperties:
33+
'^mdio-bus@[0-3]$':
34+
$ref: mdio.yaml#
35+
36+
properties:
37+
reg:
38+
maxItems: 1
39+
40+
required:
41+
- reg
42+
43+
patternProperties:
44+
'^ethernet-phy@[a-f0-9]+$':
45+
type: object
46+
$ref: ethernet-phy.yaml#
47+
unevaluatedProperties: false
48+
49+
unevaluatedProperties: false
50+
51+
required:
52+
- compatible
53+
- reg
54+
55+
unevaluatedProperties: false
56+
57+
examples:
58+
- |
59+
mdio-controller@ca00 {
60+
compatible = "realtek,rtl9301-mdio";
61+
reg = <0xca00 0x200>;
62+
#address-cells = <1>;
63+
#size-cells = <0>;
64+
65+
mdio-bus@0 {
66+
reg = <0>;
67+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
70+
ethernet-phy@0 {
71+
compatible = "ethernet-phy-ieee802.3-c45";
72+
reg = <0>;
73+
};
74+
};
75+
76+
mdio-bus@1 {
77+
reg = <1>;
78+
#address-cells = <1>;
79+
#size-cells = <0>;
80+
81+
ethernet-phy@0 {
82+
compatible = "ethernet-phy-ieee802.3-c45";
83+
reg = <0>;
84+
};
85+
};
86+
};

Documentation/devicetree/bindings/mfd/realtek,rtl9301-switch.yaml renamed to Documentation/devicetree/bindings/net/realtek,rtl9301-switch.yaml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/mfd/realtek,rtl9301-switch.yaml#
4+
$id: http://devicetree.org/schemas/net/realtek,rtl9301-switch.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: Realtek Switch with Internal CPU
@@ -14,6 +14,8 @@ description:
1414
number of different peripherals are accessed through a common register block,
1515
represented here as a syscon node.
1616

17+
$ref: ethernet-switch.yaml#/$defs/ethernet-ports
18+
1719
properties:
1820
compatible:
1921
items:
@@ -28,22 +30,38 @@ properties:
2830
reg:
2931
maxItems: 1
3032

33+
interrupts:
34+
maxItems: 2
35+
36+
interrupt-names:
37+
items:
38+
- const: switch
39+
- const: nic
40+
3141
'#address-cells':
3242
const: 1
3343

3444
'#size-cells':
3545
const: 1
3646

47+
ethernet-ports:
48+
type: object
49+
3750
patternProperties:
3851
'reboot@[0-9a-f]+$':
3952
$ref: /schemas/power/reset/syscon-reboot.yaml#
4053

4154
'i2c@[0-9a-f]+$':
4255
$ref: /schemas/i2c/realtek,rtl9301-i2c.yaml#
4356

57+
'mdio-controller@[0-9a-f]+$':
58+
$ref: realtek,rtl9301-mdio.yaml#
59+
4460
required:
4561
- compatible
4662
- reg
63+
- interrupts
64+
- interrupt-names
4765

4866
additionalProperties: false
4967

@@ -52,6 +70,9 @@ examples:
5270
ethernet-switch@1b000000 {
5371
compatible = "realtek,rtl9301-switch", "syscon", "simple-mfd";
5472
reg = <0x1b000000 0x10000>;
73+
interrupt-parent = <&intc>;
74+
interrupts = <23>, <24>;
75+
interrupt-names = "switch", "nic";
5576
#address-cells = <1>;
5677
#size-cells = <1>;
5778
@@ -110,5 +131,45 @@ examples:
110131
};
111132
};
112133
};
134+
135+
mdio-controller@ca00 {
136+
compatible = "realtek,rtl9301-mdio";
137+
reg = <0xca00 0x200>;
138+
#address-cells = <1>;
139+
#size-cells = <0>;
140+
141+
mdio-bus@0 {
142+
reg = <0>;
143+
#address-cells = <1>;
144+
#size-cells = <0>;
145+
146+
phy1: ethernet-phy@0 {
147+
reg = <0>;
148+
};
149+
};
150+
mdio-bus@1 {
151+
reg = <1>;
152+
#address-cells = <1>;
153+
#size-cells = <0>;
154+
155+
phy2: ethernet-phy@0 {
156+
reg = <0>;
157+
};
158+
};
159+
};
160+
161+
ethernet-ports {
162+
#address-cells = <1>;
163+
#size-cells = <0>;
164+
165+
port@0 {
166+
reg = <0>;
167+
phy-handle = <&phy1>;
168+
};
169+
port@1 {
170+
reg = <1>;
171+
phy-handle = <&phy2>;
172+
};
173+
};
113174
};
114175

Documentation/netlink/specs/netdev.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ definitions:
7070
name: tx-checksum
7171
doc:
7272
L3 checksum HW offload is supported by the driver.
73+
-
74+
name: tx-launch-time-fifo
75+
doc:
76+
Launch time HW offload is supported by the driver.
7377
-
7478
name: queue-type
7579
type: enum

Documentation/netlink/specs/rt_rule.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ attribute-sets:
190190
name: dport-mask
191191
type: u16
192192
display-hint: hex
193+
-
194+
name: dscp-mask
195+
type: u8
196+
display-hint: hex
193197

194198
operations:
195199
enum-model: directional
@@ -225,6 +229,7 @@ operations:
225229
- flowlabel-mask
226230
- sport-mask
227231
- dport-mask
232+
- dscp-mask
228233
-
229234
name: newrule-ntf
230235
doc: Notify a rule creation

Documentation/networking/xsk-tx-metadata.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ The flags field enables the particular offload:
5050
checksum. ``csum_start`` specifies byte offset of where the checksumming
5151
should start and ``csum_offset`` specifies byte offset where the
5252
device should store the computed checksum.
53+
- ``XDP_TXMD_FLAGS_LAUNCH_TIME``: requests the device to schedule the
54+
packet for transmission at a pre-determined time called launch time. The
55+
value of launch time is indicated by ``launch_time`` field of
56+
``union xsk_tx_metadata``.
5357

5458
Besides the flags above, in order to trigger the offloads, the first
5559
packet's ``struct xdp_desc`` descriptor should set ``XDP_TX_METADATA``
@@ -65,6 +69,63 @@ In this case, when running in ``XDK_COPY`` mode, the TX checksum
6569
is calculated on the CPU. Do not enable this option in production because
6670
it will negatively affect performance.
6771

72+
Launch Time
73+
===========
74+
75+
The value of the requested launch time should be based on the device's PTP
76+
Hardware Clock (PHC) to ensure accuracy. AF_XDP takes a different data path
77+
compared to the ETF queuing discipline, which organizes packets and delays
78+
their transmission. Instead, AF_XDP immediately hands off the packets to
79+
the device driver without rearranging their order or holding them prior to
80+
transmission. Since the driver maintains FIFO behavior and does not perform
81+
packet reordering, a packet with a launch time request will block other
82+
packets in the same Tx Queue until it is sent. Therefore, it is recommended
83+
to allocate separate queue for scheduling traffic that is intended for
84+
future transmission.
85+
86+
In scenarios where the launch time offload feature is disabled, the device
87+
driver is expected to disregard the launch time request. For correct
88+
interpretation and meaningful operation, the launch time should never be
89+
set to a value larger than the farthest programmable time in the future
90+
(the horizon). Different devices have different hardware limitations on the
91+
launch time offload feature.
92+
93+
stmmac driver
94+
-------------
95+
96+
For stmmac, TSO and launch time (TBS) features are mutually exclusive for
97+
each individual Tx Queue. By default, the driver configures Tx Queue 0 to
98+
support TSO and the rest of the Tx Queues to support TBS. The launch time
99+
hardware offload feature can be enabled or disabled by using the tc-etf
100+
command to call the driver's ndo_setup_tc() callback.
101+
102+
The value of the launch time that is programmed in the Enhanced Normal
103+
Transmit Descriptors is a 32-bit value, where the most significant 8 bits
104+
represent the time in seconds and the remaining 24 bits represent the time
105+
in 256 ns increments. The programmed launch time is compared against the
106+
PTP time (bits[39:8]) and rolls over after 256 seconds. Therefore, the
107+
horizon of the launch time for dwmac4 and dwxlgmac2 is 128 seconds in the
108+
future.
109+
110+
igc driver
111+
----------
112+
113+
For igc, all four Tx Queues support the launch time feature. The launch
114+
time hardware offload feature can be enabled or disabled by using the
115+
tc-etf command to call the driver's ndo_setup_tc() callback. When entering
116+
TSN mode, the igc driver will reset the device and create a default Qbv
117+
schedule with a 1-second cycle time, with all Tx Queues open at all times.
118+
119+
The value of the launch time that is programmed in the Advanced Transmit
120+
Context Descriptor is a relative offset to the starting time of the Qbv
121+
transmission window of the queue. The Frst flag of the descriptor can be
122+
set to schedule the packet for the next Qbv cycle. Therefore, the horizon
123+
of the launch time for i225 and i226 is the ending time of the next cycle
124+
of the Qbv transmission window of the queue. For example, when the Qbv
125+
cycle time is set to 1 second, the horizon of the launch time ranges
126+
from 1 second to 2 seconds, depending on where the Qbv cycle is currently
127+
running.
128+
68129
Querying Device Capabilities
69130
============================
70131

@@ -74,6 +135,7 @@ Refer to ``xsk-flags`` features bitmask in
74135

75136
- ``tx-timestamp``: device supports ``XDP_TXMD_FLAGS_TIMESTAMP``
76137
- ``tx-checksum``: device supports ``XDP_TXMD_FLAGS_CHECKSUM``
138+
- ``tx-launch-time-fifo``: device supports ``XDP_TXMD_FLAGS_LAUNCH_TIME``
77139

78140
See ``tools/net/ynl/samples/netdev.c`` on how to query this information.
79141

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13896,6 +13896,7 @@ L: [email protected]
1389613896
S: Maintained
1389713897
F: Documentation/networking/mctp.rst
1389813898
F: drivers/net/mctp/
13899+
F: include/linux/usb/mctp-usb.h
1389913900
F: include/net/mctp.h
1390013901
F: include/net/mctpdevice.h
1390113902
F: include/net/netns/mctp.h

drivers/infiniband/ulp/ipoib/ipoib_netlink.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ static int ipoib_changelink(struct net_device *dev, struct nlattr *tb[],
9797
return ret;
9898
}
9999

100-
static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
101-
struct nlattr *tb[], struct nlattr *data[],
100+
static int ipoib_new_child_link(struct net_device *dev,
101+
struct rtnl_newlink_params *params,
102102
struct netlink_ext_ack *extack)
103103
{
104+
struct net *link_net = rtnl_newlink_link_net(params);
105+
struct nlattr **data = params->data;
106+
struct nlattr **tb = params->tb;
104107
struct net_device *pdev;
105108
struct ipoib_dev_priv *ppriv;
106109
u16 child_pkey;
@@ -109,7 +112,7 @@ static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
109112
if (!tb[IFLA_LINK])
110113
return -EINVAL;
111114

112-
pdev = __dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
115+
pdev = __dev_get_by_index(link_net, nla_get_u32(tb[IFLA_LINK]));
113116
if (!pdev || pdev->type != ARPHRD_INFINIBAND)
114117
return -ENODEV;
115118

drivers/net/amt.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,14 +3161,17 @@ static int amt_validate(struct nlattr *tb[], struct nlattr *data[],
31613161
return 0;
31623162
}
31633163

3164-
static int amt_newlink(struct net *net, struct net_device *dev,
3165-
struct nlattr *tb[], struct nlattr *data[],
3164+
static int amt_newlink(struct net_device *dev,
3165+
struct rtnl_newlink_params *params,
31663166
struct netlink_ext_ack *extack)
31673167
{
3168+
struct net *link_net = rtnl_newlink_link_net(params);
31683169
struct amt_dev *amt = netdev_priv(dev);
3170+
struct nlattr **data = params->data;
3171+
struct nlattr **tb = params->tb;
31693172
int err = -EINVAL;
31703173

3171-
amt->net = net;
3174+
amt->net = link_net;
31723175
amt->mode = nla_get_u32(data[IFLA_AMT_MODE]);
31733176

31743177
if (data[IFLA_AMT_MAX_TUNNELS] &&
@@ -3183,7 +3186,7 @@ static int amt_newlink(struct net *net, struct net_device *dev,
31833186
amt->hash_buckets = AMT_HSIZE;
31843187
amt->nr_tunnels = 0;
31853188
get_random_bytes(&amt->hash_seed, sizeof(amt->hash_seed));
3186-
amt->stream_dev = dev_get_by_index(net,
3189+
amt->stream_dev = dev_get_by_index(link_net,
31873190
nla_get_u32(data[IFLA_AMT_LINK]));
31883191
if (!amt->stream_dev) {
31893192
NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_AMT_LINK],

0 commit comments

Comments
 (0)