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 */
|
2017-01-09 23:55:16 +08:00
|
|
|
/*
|
|
|
|
* Shared Memory Communications over RDMA (SMC-R) and RoCE
|
|
|
|
*
|
|
|
|
* CLC (connection layer control) handshake over initial TCP socket to
|
|
|
|
* prepare for RDMA traffic
|
|
|
|
*
|
|
|
|
* Copyright IBM Corp. 2016
|
|
|
|
*
|
|
|
|
* Author(s): Ursula Braun <ubraun@linux.vnet.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SMC_CLC_H
|
|
|
|
#define _SMC_CLC_H
|
|
|
|
|
|
|
|
#include <rdma/ib_verbs.h>
|
|
|
|
|
|
|
|
#include "smc.h"
|
|
|
|
|
|
|
|
#define SMC_CLC_PROPOSAL 0x01
|
|
|
|
#define SMC_CLC_ACCEPT 0x02
|
|
|
|
#define SMC_CLC_CONFIRM 0x03
|
|
|
|
#define SMC_CLC_DECLINE 0x04
|
|
|
|
|
|
|
|
#define SMC_CLC_V1 0x1 /* SMC version */
|
2018-06-29 01:05:09 +08:00
|
|
|
#define SMC_TYPE_R 0 /* SMC-R only */
|
|
|
|
#define SMC_TYPE_D 1 /* SMC-D only */
|
2020-07-08 23:05:15 +08:00
|
|
|
#define SMC_TYPE_N 2 /* neither SMC-R nor SMC-D */
|
2018-06-29 01:05:09 +08:00
|
|
|
#define SMC_TYPE_B 3 /* SMC-R and SMC-D */
|
2017-01-09 23:55:16 +08:00
|
|
|
#define CLC_WAIT_TIME (6 * HZ) /* max. wait time on clcsock */
|
2018-11-22 17:26:39 +08:00
|
|
|
#define CLC_WAIT_TIME_SHORT HZ /* short wait time on clcsock */
|
2017-01-09 23:55:16 +08:00
|
|
|
#define SMC_CLC_DECL_MEM 0x01010000 /* insufficient memory resources */
|
2018-07-25 22:35:32 +08:00
|
|
|
#define SMC_CLC_DECL_TIMEOUT_CL 0x02010000 /* timeout w4 QP confirm link */
|
|
|
|
#define SMC_CLC_DECL_TIMEOUT_AL 0x02020000 /* timeout w4 QP add link */
|
2017-01-09 23:55:16 +08:00
|
|
|
#define SMC_CLC_DECL_CNFERR 0x03000000 /* configuration error */
|
2018-07-25 22:35:32 +08:00
|
|
|
#define SMC_CLC_DECL_PEERNOSMC 0x03010000 /* peer did not indicate SMC */
|
|
|
|
#define SMC_CLC_DECL_IPSEC 0x03020000 /* IPsec usage */
|
2019-04-12 18:57:29 +08:00
|
|
|
#define SMC_CLC_DECL_NOSMCDEV 0x03030000 /* no SMC device found (R or D) */
|
|
|
|
#define SMC_CLC_DECL_NOSMCDDEV 0x03030001 /* no SMC-D device found */
|
|
|
|
#define SMC_CLC_DECL_NOSMCRDEV 0x03030002 /* no SMC-R device found */
|
|
|
|
#define SMC_CLC_DECL_SMCDNOTALK 0x03030003 /* SMC-D dev can't talk to peer */
|
2018-07-25 22:35:32 +08:00
|
|
|
#define SMC_CLC_DECL_MODEUNSUPP 0x03040000 /* smc modes do not match (R or D)*/
|
|
|
|
#define SMC_CLC_DECL_RMBE_EC 0x03050000 /* peer has eyecatcher in RMBE */
|
|
|
|
#define SMC_CLC_DECL_OPTUNSUPP 0x03060000 /* fastopen sockopt not supported */
|
2019-04-12 18:57:25 +08:00
|
|
|
#define SMC_CLC_DECL_DIFFPREFIX 0x03070000 /* IP prefix / subnet mismatch */
|
2019-04-12 18:57:27 +08:00
|
|
|
#define SMC_CLC_DECL_GETVLANERR 0x03080000 /* err to get vlan id of ip device*/
|
2019-04-12 18:57:30 +08:00
|
|
|
#define SMC_CLC_DECL_ISMVLANERR 0x03090000 /* err to reg vlan id on ism dev */
|
2020-04-29 23:10:41 +08:00
|
|
|
#define SMC_CLC_DECL_NOACTLINK 0x030a0000 /* no active smc-r link in lgr */
|
2020-04-30 21:55:43 +08:00
|
|
|
#define SMC_CLC_DECL_NOSRVLINK 0x030b0000 /* SMC-R link from srv not found */
|
2020-07-08 23:05:15 +08:00
|
|
|
#define SMC_CLC_DECL_VERSMISMAT 0x030c0000 /* SMC version mismatch */
|
2017-01-09 23:55:16 +08:00
|
|
|
#define SMC_CLC_DECL_SYNCERR 0x04000000 /* synchronization error */
|
2018-07-25 22:35:32 +08:00
|
|
|
#define SMC_CLC_DECL_PEERDECL 0x05000000 /* peer declined during handshake */
|
2019-04-12 18:57:24 +08:00
|
|
|
#define SMC_CLC_DECL_INTERR 0x09990000 /* internal error */
|
|
|
|
#define SMC_CLC_DECL_ERR_RTOK 0x09990001 /* rtoken handling failed */
|
|
|
|
#define SMC_CLC_DECL_ERR_RDYLNK 0x09990002 /* ib ready link failed */
|
|
|
|
#define SMC_CLC_DECL_ERR_REGRMB 0x09990003 /* reg rmb failed */
|
2017-01-09 23:55:16 +08:00
|
|
|
|
|
|
|
struct smc_clc_msg_hdr { /* header1 of clc messages */
|
|
|
|
u8 eyecatcher[4]; /* eye catcher */
|
|
|
|
u8 type; /* proposal / accept / confirm / decline */
|
|
|
|
__be16 length;
|
|
|
|
#if defined(__BIG_ENDIAN_BITFIELD)
|
|
|
|
u8 version : 4,
|
|
|
|
flag : 1,
|
2018-06-29 01:05:09 +08:00
|
|
|
rsvd : 1,
|
|
|
|
path : 2;
|
2017-01-09 23:55:16 +08:00
|
|
|
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
2018-06-29 01:05:09 +08:00
|
|
|
u8 path : 2,
|
|
|
|
rsvd : 1,
|
2017-01-09 23:55:16 +08:00
|
|
|
flag : 1,
|
|
|
|
version : 4;
|
|
|
|
#endif
|
|
|
|
} __packed; /* format defined in RFC7609 */
|
|
|
|
|
|
|
|
struct smc_clc_msg_trail { /* trailer of clc messages */
|
|
|
|
u8 eyecatcher[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct smc_clc_msg_local { /* header2 of clc messages */
|
|
|
|
u8 id_for_peer[SMC_SYSTEMID_LEN]; /* unique system id */
|
|
|
|
u8 gid[16]; /* gid of ib_device port */
|
|
|
|
u8 mac[6]; /* mac of ib_device port */
|
|
|
|
};
|
|
|
|
|
2018-03-16 22:06:40 +08:00
|
|
|
#define SMC_CLC_MAX_V6_PREFIX 8
|
|
|
|
|
|
|
|
/* Struct would be 4 byte aligned, but it is used in an array that is sent
|
|
|
|
* to peers and must conform to RFC7609, hence we need to use packed here.
|
|
|
|
*/
|
2017-12-07 20:38:49 +08:00
|
|
|
struct smc_clc_ipv6_prefix {
|
2018-03-16 22:06:40 +08:00
|
|
|
struct in6_addr prefix;
|
2017-12-07 20:38:49 +08:00
|
|
|
u8 prefix_len;
|
2018-03-16 22:06:40 +08:00
|
|
|
} __packed; /* format defined in RFC7609 */
|
2017-12-07 20:38:49 +08:00
|
|
|
|
|
|
|
struct smc_clc_msg_proposal_prefix { /* prefix part of clc proposal message*/
|
2017-01-09 23:55:16 +08:00
|
|
|
__be32 outgoing_subnet; /* subnet mask */
|
|
|
|
u8 prefix_len; /* number of significant bits in mask */
|
|
|
|
u8 reserved[2];
|
|
|
|
u8 ipv6_prefixes_cnt; /* number of IPv6 prefixes in prefix array */
|
|
|
|
} __aligned(4);
|
|
|
|
|
2018-06-29 01:05:09 +08:00
|
|
|
struct smc_clc_msg_smcd { /* SMC-D GID information */
|
|
|
|
u64 gid; /* ISM GID of requestor */
|
|
|
|
u8 res[32];
|
|
|
|
};
|
|
|
|
|
2017-12-07 20:38:49 +08:00
|
|
|
struct smc_clc_msg_proposal { /* clc proposal message sent by Linux */
|
|
|
|
struct smc_clc_msg_hdr hdr;
|
|
|
|
struct smc_clc_msg_local lcl;
|
|
|
|
__be16 iparea_offset; /* offset to IP address information area */
|
|
|
|
} __aligned(4);
|
|
|
|
|
|
|
|
#define SMC_CLC_PROPOSAL_MAX_OFFSET 0x28
|
2018-03-16 22:06:40 +08:00
|
|
|
#define SMC_CLC_PROPOSAL_MAX_PREFIX (SMC_CLC_MAX_V6_PREFIX * \
|
|
|
|
sizeof(struct smc_clc_ipv6_prefix))
|
2017-12-07 20:38:49 +08:00
|
|
|
#define SMC_CLC_MAX_LEN (sizeof(struct smc_clc_msg_proposal) + \
|
|
|
|
SMC_CLC_PROPOSAL_MAX_OFFSET + \
|
2018-03-16 22:06:40 +08:00
|
|
|
sizeof(struct smc_clc_msg_proposal_prefix) + \
|
2017-12-07 20:38:49 +08:00
|
|
|
SMC_CLC_PROPOSAL_MAX_PREFIX + \
|
|
|
|
sizeof(struct smc_clc_msg_trail))
|
|
|
|
|
2017-01-09 23:55:16 +08:00
|
|
|
struct smc_clc_msg_accept_confirm { /* clc accept / confirm message */
|
|
|
|
struct smc_clc_msg_hdr hdr;
|
2018-06-29 01:05:09 +08:00
|
|
|
union {
|
|
|
|
struct { /* SMC-R */
|
|
|
|
struct smc_clc_msg_local lcl;
|
|
|
|
u8 qpn[3]; /* QP number */
|
|
|
|
__be32 rmb_rkey; /* RMB rkey */
|
|
|
|
u8 rmbe_idx; /* Index of RMBE in RMB */
|
|
|
|
__be32 rmbe_alert_token;/* unique connection id */
|
2017-01-09 23:55:16 +08:00
|
|
|
#if defined(__BIG_ENDIAN_BITFIELD)
|
2018-06-29 01:05:09 +08:00
|
|
|
u8 rmbe_size : 4, /* buf size (compressed) */
|
|
|
|
qp_mtu : 4; /* QP mtu */
|
2017-01-09 23:55:16 +08:00
|
|
|
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
2018-06-29 01:05:09 +08:00
|
|
|
u8 qp_mtu : 4,
|
|
|
|
rmbe_size : 4;
|
2017-01-09 23:55:16 +08:00
|
|
|
#endif
|
2018-06-29 01:05:09 +08:00
|
|
|
u8 reserved;
|
|
|
|
__be64 rmb_dma_addr; /* RMB virtual address */
|
|
|
|
u8 reserved2;
|
|
|
|
u8 psn[3]; /* packet sequence number */
|
|
|
|
struct smc_clc_msg_trail smcr_trl;
|
|
|
|
/* eye catcher "SMCR" EBCDIC */
|
|
|
|
} __packed;
|
|
|
|
struct { /* SMC-D */
|
|
|
|
u64 gid; /* Sender GID */
|
|
|
|
u64 token; /* DMB token */
|
|
|
|
u8 dmbe_idx; /* DMBE index */
|
|
|
|
#if defined(__BIG_ENDIAN_BITFIELD)
|
|
|
|
u8 dmbe_size : 4, /* buf size (compressed) */
|
|
|
|
reserved3 : 4;
|
|
|
|
#elif defined(__LITTLE_ENDIAN_BITFIELD)
|
|
|
|
u8 reserved3 : 4,
|
|
|
|
dmbe_size : 4;
|
|
|
|
#endif
|
|
|
|
u16 reserved4;
|
|
|
|
u32 linkid; /* Link identifier */
|
|
|
|
u32 reserved5[3];
|
|
|
|
struct smc_clc_msg_trail smcd_trl;
|
|
|
|
/* eye catcher "SMCD" EBCDIC */
|
|
|
|
} __packed;
|
|
|
|
};
|
2017-01-09 23:55:16 +08:00
|
|
|
} __packed; /* format defined in RFC7609 */
|
|
|
|
|
|
|
|
struct smc_clc_msg_decline { /* clc decline message */
|
|
|
|
struct smc_clc_msg_hdr hdr;
|
|
|
|
u8 id_for_peer[SMC_SYSTEMID_LEN]; /* sender peer_id */
|
|
|
|
__be32 peer_diagnosis; /* diagnosis information */
|
|
|
|
u8 reserved2[4];
|
|
|
|
struct smc_clc_msg_trail trl; /* eye catcher "SMCR" EBCDIC */
|
|
|
|
} __aligned(4);
|
|
|
|
|
2017-12-07 20:38:49 +08:00
|
|
|
/* determine start of the prefix area within the proposal message */
|
|
|
|
static inline struct smc_clc_msg_proposal_prefix *
|
|
|
|
smc_clc_proposal_get_prefix(struct smc_clc_msg_proposal *pclc)
|
|
|
|
{
|
|
|
|
return (struct smc_clc_msg_proposal_prefix *)
|
|
|
|
((u8 *)pclc + sizeof(*pclc) + ntohs(pclc->iparea_offset));
|
|
|
|
}
|
|
|
|
|
2018-06-29 01:05:09 +08:00
|
|
|
/* get SMC-D info from proposal message */
|
|
|
|
static inline struct smc_clc_msg_smcd *
|
|
|
|
smc_get_clc_msg_smcd(struct smc_clc_msg_proposal *prop)
|
|
|
|
{
|
|
|
|
if (ntohs(prop->iparea_offset) != sizeof(struct smc_clc_msg_smcd))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return (struct smc_clc_msg_smcd *)(prop + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct smcd_dev;
|
2019-04-12 18:57:26 +08:00
|
|
|
struct smc_init_info;
|
2018-06-29 01:05:09 +08:00
|
|
|
|
2018-03-16 22:06:39 +08:00
|
|
|
int smc_clc_prfx_match(struct socket *clcsock,
|
|
|
|
struct smc_clc_msg_proposal_prefix *prop);
|
2017-01-09 23:55:16 +08:00
|
|
|
int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
|
2018-11-22 17:26:39 +08:00
|
|
|
u8 expected_type, unsigned long timeout);
|
2017-09-21 15:16:32 +08:00
|
|
|
int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info);
|
2018-06-29 01:05:09 +08:00
|
|
|
int smc_clc_send_proposal(struct smc_sock *smc, int smc_type,
|
2019-04-12 18:57:26 +08:00
|
|
|
struct smc_init_info *ini);
|
2017-01-09 23:55:16 +08:00
|
|
|
int smc_clc_send_confirm(struct smc_sock *smc);
|
2017-01-09 23:55:17 +08:00
|
|
|
int smc_clc_send_accept(struct smc_sock *smc, int srv_first_contact);
|
2017-01-09 23:55:16 +08:00
|
|
|
|
|
|
|
#endif
|