.. | .. |
---|
20 | 20 | int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *); |
---|
21 | 21 | }; |
---|
22 | 22 | |
---|
23 | | -#define QDISC_ALIGNTO 64 |
---|
24 | | -#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) |
---|
25 | | - |
---|
26 | 23 | static inline void *qdisc_priv(struct Qdisc *q) |
---|
27 | 24 | { |
---|
28 | | - return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc)); |
---|
| 25 | + return &q->privdata; |
---|
29 | 26 | } |
---|
30 | 27 | |
---|
31 | 28 | /* |
---|
.. | .. |
---|
76 | 73 | void qdisc_watchdog_init_clockid(struct qdisc_watchdog *wd, struct Qdisc *qdisc, |
---|
77 | 74 | clockid_t clockid); |
---|
78 | 75 | 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 | +} |
---|
80 | 85 | |
---|
81 | 86 | static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, |
---|
82 | 87 | psched_time_t expires) |
---|
.. | .. |
---|
124 | 129 | } |
---|
125 | 130 | } |
---|
126 | 131 | |
---|
| 132 | +extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1]; |
---|
| 133 | + |
---|
127 | 134 | /* Calculate maximal size of packet seen by hard_start_xmit |
---|
128 | 135 | routine of this device. |
---|
129 | 136 | */ |
---|
130 | 137 | static inline unsigned int psched_mtu(const struct net_device *dev) |
---|
131 | 138 | { |
---|
132 | | - return dev->mtu + dev->hard_header_len; |
---|
| 139 | + return READ_ONCE(dev->mtu) + dev->hard_header_len; |
---|
133 | 140 | } |
---|
134 | 141 | |
---|
135 | 142 | static inline struct net *qdisc_net(struct Qdisc *q) |
---|
.. | .. |
---|
151 | 158 | s32 queue; |
---|
152 | 159 | }; |
---|
153 | 160 | |
---|
| 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 | + |
---|
154 | 193 | #endif |
---|