License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __NET_PKT_SCHED_H
|
|
|
|
#define __NET_PKT_SCHED_H
|
|
|
|
|
2006-01-09 14:12:03 +08:00
|
|
|
#include <linux/jiffies.h>
|
2007-03-16 16:18:42 +08:00
|
|
|
#include <linux/ktime.h>
|
2015-01-14 00:13:43 +08:00
|
|
|
#include <linux/if_vlan.h>
|
2017-10-13 20:00:58 +08:00
|
|
|
#include <linux/netdevice.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <net/sch_generic.h>
|
2017-10-13 20:00:58 +08:00
|
|
|
#include <net/net_namespace.h>
|
2017-08-09 20:30:31 +08:00
|
|
|
#include <uapi/linux/pkt_sched.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-11-03 21:56:01 +08:00
|
|
|
#define DEFAULT_TX_QUEUE_LEN 1000
|
|
|
|
|
2009-11-03 11:26:03 +08:00
|
|
|
struct qdisc_walker {
|
2005-04-17 06:20:36 +08:00
|
|
|
int stop;
|
|
|
|
int skip;
|
|
|
|
int count;
|
|
|
|
int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *);
|
|
|
|
};
|
|
|
|
|
2010-03-31 15:06:04 +08:00
|
|
|
#define QDISC_ALIGNTO 64
|
2005-07-06 05:15:09 +08:00
|
|
|
#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1))
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
static inline void *qdisc_priv(struct Qdisc *q)
|
|
|
|
{
|
2005-07-06 05:15:09 +08:00
|
|
|
return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc));
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Timer resolution MUST BE < 10% of min_schedulable_packet_size/bandwidth
|
|
|
|
|
|
|
|
Normal IP packet size ~ 512byte, hence:
|
|
|
|
|
|
|
|
0.5Kbyte/1Mbyte/sec = 0.5msec, so that we need 50usec timer for
|
|
|
|
10Mbit ethernet.
|
|
|
|
|
|
|
|
10msec resolution -> <50Kbit/sec.
|
|
|
|
|
|
|
|
The result: [34]86 is not good choice for QoS router :-(
|
|
|
|
|
2011-03-31 09:57:33 +08:00
|
|
|
The things are not so bad, because we may use artificial
|
2005-04-17 06:20:36 +08:00
|
|
|
clock evaluated by integration of network data flow
|
|
|
|
in the most critical places.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef u64 psched_time_t;
|
|
|
|
typedef long psched_tdiff_t;
|
|
|
|
|
2009-06-09 06:05:13 +08:00
|
|
|
/* Avoid doing 64 bit divide */
|
|
|
|
#define PSCHED_SHIFT 6
|
2009-06-15 17:31:47 +08:00
|
|
|
#define PSCHED_TICKS2NS(x) ((s64)(x) << PSCHED_SHIFT)
|
|
|
|
#define PSCHED_NS2TICKS(x) ((x) >> PSCHED_SHIFT)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-06-15 17:31:47 +08:00
|
|
|
#define PSCHED_TICKS_PER_SEC PSCHED_NS2TICKS(NSEC_PER_SEC)
|
2007-03-24 02:28:30 +08:00
|
|
|
#define PSCHED_PASTPERFECT 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-03-24 02:29:25 +08:00
|
|
|
static inline psched_time_t psched_get_time(void)
|
|
|
|
{
|
2014-08-23 09:32:09 +08:00
|
|
|
return PSCHED_NS2TICKS(ktime_get_ns());
|
2007-03-24 02:29:25 +08:00
|
|
|
}
|
|
|
|
|
2007-03-24 02:29:11 +08:00
|
|
|
static inline psched_tdiff_t
|
|
|
|
psched_tdiff_bounded(psched_time_t tv1, psched_time_t tv2, psched_time_t bound)
|
|
|
|
{
|
|
|
|
return min(tv1 - tv2, bound);
|
|
|
|
}
|
|
|
|
|
2007-03-16 16:19:15 +08:00
|
|
|
struct qdisc_watchdog {
|
2016-05-24 05:24:56 +08:00
|
|
|
u64 last_expires;
|
2007-03-16 16:19:15 +08:00
|
|
|
struct hrtimer timer;
|
|
|
|
struct Qdisc *qdisc;
|
|
|
|
};
|
|
|
|
|
2013-07-31 13:47:13 +08:00
|
|
|
void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
|
2016-06-11 07:41:39 +08:00
|
|
|
void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
|
2013-02-12 08:12:04 +08:00
|
|
|
|
|
|
|
static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
|
|
|
|
psched_time_t expires)
|
|
|
|
{
|
2016-06-11 07:41:39 +08:00
|
|
|
qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
|
2013-02-12 08:12:04 +08:00
|
|
|
}
|
|
|
|
|
2013-07-31 13:47:13 +08:00
|
|
|
void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
|
2007-03-16 16:19:15 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
extern struct Qdisc_ops pfifo_qdisc_ops;
|
|
|
|
extern struct Qdisc_ops bfifo_qdisc_ops;
|
2010-01-24 20:30:59 +08:00
|
|
|
extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2013-07-31 13:47:13 +08:00
|
|
|
int fifo_set_limit(struct Qdisc *q, unsigned int limit);
|
|
|
|
struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
|
2017-12-21 01:35:21 +08:00
|
|
|
unsigned int limit,
|
|
|
|
struct netlink_ext_ack *extack);
|
2013-07-31 13:47:13 +08:00
|
|
|
|
|
|
|
int register_qdisc(struct Qdisc_ops *qops);
|
|
|
|
int unregister_qdisc(struct Qdisc_ops *qops);
|
2013-08-28 07:19:08 +08:00
|
|
|
void qdisc_get_default(char *id, size_t len);
|
|
|
|
int qdisc_set_default(const char *id);
|
|
|
|
|
2017-03-08 23:03:32 +08:00
|
|
|
void qdisc_hash_add(struct Qdisc *q, bool invisible);
|
2016-08-10 17:05:15 +08:00
|
|
|
void qdisc_hash_del(struct Qdisc *q);
|
2013-07-31 13:47:13 +08:00
|
|
|
struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
|
|
|
|
struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
|
2017-12-21 01:35:18 +08:00
|
|
|
struct nlattr *tab,
|
|
|
|
struct netlink_ext_ack *extack);
|
2013-07-31 13:47:13 +08:00
|
|
|
void qdisc_put_rtab(struct qdisc_rate_table *tab);
|
|
|
|
void qdisc_put_stab(struct qdisc_size_table *tab);
|
2014-06-12 02:35:18 +08:00
|
|
|
void qdisc_warn_nonwc(const char *txt, struct Qdisc *qdisc);
|
2017-12-08 01:54:47 +08:00
|
|
|
bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
|
|
|
|
struct net_device *dev, struct netdev_queue *txq,
|
|
|
|
spinlock_t *root_lock, bool validate);
|
2013-07-31 13:47:13 +08:00
|
|
|
|
|
|
|
void __qdisc_run(struct Qdisc *q);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-07-16 17:15:04 +08:00
|
|
|
static inline void qdisc_run(struct Qdisc *q)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2017-12-08 01:54:06 +08:00
|
|
|
if (qdisc_run_begin(q)) {
|
2008-07-16 17:15:04 +08:00
|
|
|
__qdisc_run(q);
|
2017-12-08 01:54:06 +08:00
|
|
|
qdisc_run_end(q);
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2015-01-14 00:13:43 +08:00
|
|
|
static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
|
|
|
|
{
|
|
|
|
/* We need to take extra care in case the skb came via
|
|
|
|
* vlan accelerated path. In that case, use skb->vlan_proto
|
|
|
|
* as the original vlan header was already stripped.
|
|
|
|
*/
|
2015-01-14 00:13:44 +08:00
|
|
|
if (skb_vlan_tag_present(skb))
|
2015-01-14 00:13:43 +08:00
|
|
|
return skb->vlan_proto;
|
|
|
|
return skb->protocol;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Calculate maximal size of packet seen by hard_start_xmit
|
|
|
|
routine of this device.
|
|
|
|
*/
|
2012-04-15 13:58:06 +08:00
|
|
|
static inline unsigned int psched_mtu(const struct net_device *dev)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2007-10-09 16:40:57 +08:00
|
|
|
return dev->mtu + dev->hard_header_len;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2017-10-13 20:00:58 +08:00
|
|
|
static inline struct net *qdisc_net(struct Qdisc *q)
|
|
|
|
{
|
|
|
|
return dev_net(q->dev_queue->dev);
|
|
|
|
}
|
|
|
|
|
2017-10-17 09:01:27 +08:00
|
|
|
struct tc_cbs_qopt_offload {
|
|
|
|
u8 enable;
|
|
|
|
s32 queue;
|
|
|
|
s32 hicredit;
|
|
|
|
s32 locredit;
|
|
|
|
s32 idleslope;
|
|
|
|
s32 sendslope;
|
|
|
|
};
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|