hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/include/net/pkt_sched.h
....@@ -20,12 +20,9 @@
2020 int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *);
2121 };
2222
23
-#define QDISC_ALIGNTO 64
24
-#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1))
25
-
2623 static inline void *qdisc_priv(struct Qdisc *q)
2724 {
28
- return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc));
25
+ return &q->privdata;
2926 }
3027
3128 /*
....@@ -76,7 +73,15 @@
7673 void qdisc_watchdog_init_clockid(struct qdisc_watchdog *wd, struct Qdisc *qdisc,
7774 clockid_t clockid);
7875 void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
79
-void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
76
+
77
+void qdisc_watchdog_schedule_range_ns(struct qdisc_watchdog *wd, u64 expires,
78
+ u64 delta_ns);
79
+
80
+static inline void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd,
81
+ u64 expires)
82
+{
83
+ return qdisc_watchdog_schedule_range_ns(wd, expires, 0ULL);
84
+}
8085
8186 static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
8287 psched_time_t expires)
....@@ -124,12 +129,14 @@
124129 }
125130 }
126131
132
+extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
133
+
127134 /* Calculate maximal size of packet seen by hard_start_xmit
128135 routine of this device.
129136 */
130137 static inline unsigned int psched_mtu(const struct net_device *dev)
131138 {
132
- return dev->mtu + dev->hard_header_len;
139
+ return READ_ONCE(dev->mtu) + dev->hard_header_len;
133140 }
134141
135142 static inline struct net *qdisc_net(struct Qdisc *q)
....@@ -151,4 +158,36 @@
151158 s32 queue;
152159 };
153160
161
+struct tc_taprio_sched_entry {
162
+ u8 command; /* TC_TAPRIO_CMD_* */
163
+
164
+ /* The gate_mask in the offloading side refers to traffic classes */
165
+ u32 gate_mask;
166
+ u32 interval;
167
+};
168
+
169
+struct tc_taprio_qopt_offload {
170
+ u8 enable;
171
+ ktime_t base_time;
172
+ u64 cycle_time;
173
+ u64 cycle_time_extension;
174
+
175
+ size_t num_entries;
176
+ struct tc_taprio_sched_entry entries[];
177
+};
178
+
179
+/* Reference counting */
180
+struct tc_taprio_qopt_offload *taprio_offload_get(struct tc_taprio_qopt_offload
181
+ *offload);
182
+void taprio_offload_free(struct tc_taprio_qopt_offload *offload);
183
+
184
+/* Ensure skb_mstamp_ns, which might have been populated with the txtime, is
185
+ * not mistaken for a software timestamp, because this will otherwise prevent
186
+ * the dispatch of hardware timestamps to the socket.
187
+ */
188
+static inline void skb_txtime_consumed(struct sk_buff *skb)
189
+{
190
+ skb->tstamp = ktime_set(0, 0);
191
+}
192
+
154193 #endif