diff mbox series

[net-next,12/12] net: homa: create Makefile and Kconfig

Message ID 20241028213541.1529-13-ouster@cs.stanford.edu (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Begin upstreaming Homa transport protocol | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 5 this patch: 10
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 4 maintainers not CCed: horms@kernel.org kuba@kernel.org pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 4 this patch: 4
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 58 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

John Ousterhout Oct. 28, 2024, 9:35 p.m. UTC
Before this commit the Homa code is "inert": it won't be compiled
in kernel builds. This commit adds Homa's Makefile and Kconfig, and
also links Homa into net/Makefile and net/Kconfig, so that Homa
will be built during kernel builds if enabled (it is disabled by
default).

This commit also adds an entry in the MAINTAINERS file.

Signed-off-by: John Ousterhout <ouster@cs.stanford.edu>
---
 MAINTAINERS       |  7 +++++++
 net/Kconfig       |  1 +
 net/Makefile      |  1 +
 net/homa/Kconfig  | 17 +++++++++++++++++
 net/homa/Makefile | 14 ++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 net/homa/Kconfig
 create mode 100644 net/homa/Makefile

Comments

kernel test robot Oct. 29, 2024, 2 p.m. UTC | #1
Hi John,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20241029/202410292151.ozZhCbRL-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241029/202410292151.ozZhCbRL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410292151.ozZhCbRL-lkp@intel.com/

All errors (new ones prefixed by >>):

   net/homa/homa_incoming.c: In function 'homa_incoming_sysctl_changed':
>> net/homa/homa_incoming.c:1078:22: error: 'cpu_khz' undeclared (first use in this function)
    1078 |         tmp = (tmp * cpu_khz) / 1000;
         |                      ^~~~~~~
   net/homa/homa_incoming.c:1078:22: note: each undeclared identifier is reported only once for each function it appears in
--
   net/homa/homa_outgoing.c: In function 'homa_outgoing_sysctl_changed':
>> net/homa/homa_outgoing.c:579:46: error: 'cpu_khz' undeclared (first use in this function)
     579 |         homa->cycles_per_kbyte = (8 * (__u64)cpu_khz) / homa->link_mbps;
         |                                              ^~~~~~~
   net/homa/homa_outgoing.c:579:46: note: each undeclared identifier is reported only once for each function it appears in
--
   net/homa/homa_peer.c: In function 'homa_dst_refresh':
>> net/homa/homa_peer.c:189:48: error: 'cpu_khz' undeclared (first use in this function)
     189 |                         dead->gc_time = now + (cpu_khz << 7);
         |                                                ^~~~~~~
   net/homa/homa_peer.c:189:48: note: each undeclared identifier is reported only once for each function it appears in
--
   net/homa/homa_plumbing.c: In function 'homa_softirq':
>> net/homa/homa_plumbing.c:712:61: error: 'cpu_khz' undeclared (first use in this function)
     712 |                 int scaled_ms = (int)(10 * (start - last) / cpu_khz);
         |                                                             ^~~~~~~
   net/homa/homa_plumbing.c:712:61: note: each undeclared identifier is reported only once for each function it appears in
--
   net/homa/homa_utils.c: In function 'homa_spin':
>> net/homa/homa_utils.c:122:36: error: 'cpu_khz' undeclared (first use in this function)
     122 |         end = get_cycles() + (ns * cpu_khz) / 1000000;
         |                                    ^~~~~~~
   net/homa/homa_utils.c:122:36: note: each undeclared identifier is reported only once for each function it appears in


vim +/cpu_khz +1078 net/homa/homa_incoming.c

223bab41c36796 John Ousterhout 2024-10-28  1063  
223bab41c36796 John Ousterhout 2024-10-28  1064  /**
223bab41c36796 John Ousterhout 2024-10-28  1065   * homa_incoming_sysctl_changed() - Invoked whenever a sysctl value is changed;
223bab41c36796 John Ousterhout 2024-10-28  1066   * any input-related parameters that depend on sysctl-settable values.
223bab41c36796 John Ousterhout 2024-10-28  1067   * @homa:    Overall data about the Homa protocol implementation.
223bab41c36796 John Ousterhout 2024-10-28  1068   */
223bab41c36796 John Ousterhout 2024-10-28  1069  void homa_incoming_sysctl_changed(struct homa *homa)
223bab41c36796 John Ousterhout 2024-10-28  1070  {
223bab41c36796 John Ousterhout 2024-10-28  1071  	__u64 tmp;
223bab41c36796 John Ousterhout 2024-10-28  1072  
223bab41c36796 John Ousterhout 2024-10-28  1073  	/* Code below is written carefully to avoid integer underflow or
223bab41c36796 John Ousterhout 2024-10-28  1074  	 * overflow under expected usage patterns. Be careful when changing!
223bab41c36796 John Ousterhout 2024-10-28  1075  	 */
223bab41c36796 John Ousterhout 2024-10-28  1076  
223bab41c36796 John Ousterhout 2024-10-28  1077  	tmp = homa->busy_usecs;
223bab41c36796 John Ousterhout 2024-10-28 @1078  	tmp = (tmp * cpu_khz) / 1000;
kernel test robot Oct. 29, 2024, 2:21 p.m. UTC | #2
Hi John,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241029/202410292232.sT4alx5x-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241029/202410292232.sT4alx5x-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410292232.sT4alx5x-lkp@intel.com/

All warnings (new ones prefixed by >>):

   net/homa/homa_pool.c: In function 'homa_pool_init':
>> net/homa/homa_pool.c:55:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      55 |         if (((__u64)region) & ~PAGE_MASK)
         |              ^

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [m]:
   - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +55 net/homa/homa_pool.c

2076aa7e789765 John Ousterhout 2024-10-28   40  
2076aa7e789765 John Ousterhout 2024-10-28   41  /**
2076aa7e789765 John Ousterhout 2024-10-28   42   * homa_pool_init() - Initialize a homa_pool; any previous contents of the
2076aa7e789765 John Ousterhout 2024-10-28   43   * objects are overwritten.
2076aa7e789765 John Ousterhout 2024-10-28   44   * @hsk:          Socket containing the pool to initialize.
2076aa7e789765 John Ousterhout 2024-10-28   45   * @region:       First byte of the memory region for the pool, allocated
2076aa7e789765 John Ousterhout 2024-10-28   46   *                by the application; must be page-aligned.
2076aa7e789765 John Ousterhout 2024-10-28   47   * @region_size:  Total number of bytes available at @buf_region.
2076aa7e789765 John Ousterhout 2024-10-28   48   * Return: Either zero (for success) or a negative errno for failure.
2076aa7e789765 John Ousterhout 2024-10-28   49   */
2076aa7e789765 John Ousterhout 2024-10-28   50  int homa_pool_init(struct homa_sock *hsk, void *region, __u64 region_size)
2076aa7e789765 John Ousterhout 2024-10-28   51  {
2076aa7e789765 John Ousterhout 2024-10-28   52  	struct homa_pool *pool = hsk->buffer_pool;
2076aa7e789765 John Ousterhout 2024-10-28   53  	int i, result;
2076aa7e789765 John Ousterhout 2024-10-28   54  
2076aa7e789765 John Ousterhout 2024-10-28  @55  	if (((__u64)region) & ~PAGE_MASK)
2076aa7e789765 John Ousterhout 2024-10-28   56  		return -EINVAL;
2076aa7e789765 John Ousterhout 2024-10-28   57  	pool->hsk = hsk;
2076aa7e789765 John Ousterhout 2024-10-28   58  	pool->region = (char *)region;
2076aa7e789765 John Ousterhout 2024-10-28   59  	pool->num_bpages = region_size >> HOMA_BPAGE_SHIFT;
2076aa7e789765 John Ousterhout 2024-10-28   60  	pool->descriptors = NULL;
2076aa7e789765 John Ousterhout 2024-10-28   61  	pool->cores = NULL;
2076aa7e789765 John Ousterhout 2024-10-28   62  	if (pool->num_bpages < MIN_POOL_SIZE) {
2076aa7e789765 John Ousterhout 2024-10-28   63  		result = -EINVAL;
2076aa7e789765 John Ousterhout 2024-10-28   64  		goto error;
2076aa7e789765 John Ousterhout 2024-10-28   65  	}
2076aa7e789765 John Ousterhout 2024-10-28   66  	pool->descriptors = kmalloc_array(pool->num_bpages,
2076aa7e789765 John Ousterhout 2024-10-28   67  					  sizeof(struct homa_bpage), GFP_ATOMIC);
2076aa7e789765 John Ousterhout 2024-10-28   68  	if (!pool->descriptors) {
2076aa7e789765 John Ousterhout 2024-10-28   69  		result = -ENOMEM;
2076aa7e789765 John Ousterhout 2024-10-28   70  		goto error;
2076aa7e789765 John Ousterhout 2024-10-28   71  	}
2076aa7e789765 John Ousterhout 2024-10-28   72  	for (i = 0; i < pool->num_bpages; i++) {
2076aa7e789765 John Ousterhout 2024-10-28   73  		struct homa_bpage *bp = &pool->descriptors[i];
2076aa7e789765 John Ousterhout 2024-10-28   74  
2076aa7e789765 John Ousterhout 2024-10-28   75  		spin_lock_init(&bp->lock);
2076aa7e789765 John Ousterhout 2024-10-28   76  		atomic_set(&bp->refs, 0);
2076aa7e789765 John Ousterhout 2024-10-28   77  		bp->owner = -1;
2076aa7e789765 John Ousterhout 2024-10-28   78  		bp->expiration = 0;
2076aa7e789765 John Ousterhout 2024-10-28   79  	}
2076aa7e789765 John Ousterhout 2024-10-28   80  	atomic_set(&pool->free_bpages, pool->num_bpages);
2076aa7e789765 John Ousterhout 2024-10-28   81  	pool->bpages_needed = INT_MAX;
2076aa7e789765 John Ousterhout 2024-10-28   82  
2076aa7e789765 John Ousterhout 2024-10-28   83  	/* Allocate and initialize core-specific data. */
2076aa7e789765 John Ousterhout 2024-10-28   84  	pool->cores = kmalloc_array(nr_cpu_ids, sizeof(struct homa_pool_core),
2076aa7e789765 John Ousterhout 2024-10-28   85  				    GFP_ATOMIC);
2076aa7e789765 John Ousterhout 2024-10-28   86  	if (!pool->cores) {
2076aa7e789765 John Ousterhout 2024-10-28   87  		result = -ENOMEM;
2076aa7e789765 John Ousterhout 2024-10-28   88  		goto error;
2076aa7e789765 John Ousterhout 2024-10-28   89  	}
2076aa7e789765 John Ousterhout 2024-10-28   90  	pool->num_cores = nr_cpu_ids;
2076aa7e789765 John Ousterhout 2024-10-28   91  	for (i = 0; i < pool->num_cores; i++) {
2076aa7e789765 John Ousterhout 2024-10-28   92  		pool->cores[i].page_hint = 0;
2076aa7e789765 John Ousterhout 2024-10-28   93  		pool->cores[i].allocated = 0;
2076aa7e789765 John Ousterhout 2024-10-28   94  		pool->cores[i].next_candidate = 0;
2076aa7e789765 John Ousterhout 2024-10-28   95  	}
2076aa7e789765 John Ousterhout 2024-10-28   96  	pool->check_waiting_invoked = 0;
2076aa7e789765 John Ousterhout 2024-10-28   97  
2076aa7e789765 John Ousterhout 2024-10-28   98  	return 0;
2076aa7e789765 John Ousterhout 2024-10-28   99  
2076aa7e789765 John Ousterhout 2024-10-28  100  error:
2076aa7e789765 John Ousterhout 2024-10-28  101  	kfree(pool->descriptors);
2076aa7e789765 John Ousterhout 2024-10-28  102  	kfree(pool->cores);
2076aa7e789765 John Ousterhout 2024-10-28  103  	pool->region = NULL;
2076aa7e789765 John Ousterhout 2024-10-28  104  	return result;
2076aa7e789765 John Ousterhout 2024-10-28  105  }
2076aa7e789765 John Ousterhout 2024-10-28  106
kernel test robot Oct. 29, 2024, 6:42 p.m. UTC | #3
Hi John,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
config: csky-randconfig-r053-20241029 (https://download.01.org/0day-ci/archive/20241030/202410300216.L9BJCLPZ-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241030/202410300216.L9BJCLPZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410300216.L9BJCLPZ-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   net/homa/homa_incoming.c: In function 'homa_dispatch_pkts':
>> net/homa/homa_incoming.c:291:25: error: implicit declaration of function 'icmp6_send'; did you mean 'icmp_send'? [-Wimplicit-function-declaration]
     291 |                         icmp6_send(skb, ICMPV6_DEST_UNREACH,
         |                         ^~~~~~~~~~
         |                         icmp_send
   net/homa/homa_incoming.c: In function 'homa_incoming_sysctl_changed':
   net/homa/homa_incoming.c:1078:22: error: 'cpu_khz' undeclared (first use in this function)
    1078 |         tmp = (tmp * cpu_khz) / 1000;
         |                      ^~~~~~~
   net/homa/homa_incoming.c:1078:22: note: each undeclared identifier is reported only once for each function it appears in
--
   net/homa/homa_peer.c: In function 'homa_dst_refresh':
   net/homa/homa_peer.c:189:48: error: 'cpu_khz' undeclared (first use in this function)
     189 |                         dead->gc_time = now + (cpu_khz << 7);
         |                                                ^~~~~~~
   net/homa/homa_peer.c:189:48: note: each undeclared identifier is reported only once for each function it appears in
   net/homa/homa_peer.c: In function 'homa_peer_get_dst':
>> net/homa/homa_peer.c:235:38: error: 'struct inet_sock' has no member named 'pinet6'
     235 |         peer->flow.u.ip6.saddr = inet->pinet6->saddr;
         |                                      ^~
--
>> net/homa/homa_plumbing.c:167:15: error: variable 'homav6_protocol' has initializer but incomplete type
     167 | static struct inet6_protocol homav6_protocol = {
         |               ^~~~~~~~~~~~~~
>> net/homa/homa_plumbing.c:168:10: error: 'struct inet6_protocol' has no member named 'handler'
     168 |         .handler =      homa_softirq,
         |          ^~~~~~~
>> net/homa/homa_plumbing.c:168:25: warning: excess elements in struct initializer
     168 |         .handler =      homa_softirq,
         |                         ^~~~~~~~~~~~
   net/homa/homa_plumbing.c:168:25: note: (near initialization for 'homav6_protocol')
>> net/homa/homa_plumbing.c:169:10: error: 'struct inet6_protocol' has no member named 'err_handler'
     169 |         .err_handler =  homa_err_handler_v6,
         |          ^~~~~~~~~~~
   net/homa/homa_plumbing.c:169:25: warning: excess elements in struct initializer
     169 |         .err_handler =  homa_err_handler_v6,
         |                         ^~~~~~~~~~~~~~~~~~~
   net/homa/homa_plumbing.c:169:25: note: (near initialization for 'homav6_protocol')
>> net/homa/homa_plumbing.c:170:10: error: 'struct inet6_protocol' has no member named 'flags'
     170 |         .flags =        INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
         |          ^~~~~
>> net/homa/homa_plumbing.c:170:25: error: 'INET6_PROTO_NOPOLICY' undeclared here (not in a function)
     170 |         .flags =        INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
         |                         ^~~~~~~~~~~~~~~~~~~~
>> net/homa/homa_plumbing.c:170:48: error: 'INET6_PROTO_FINAL' undeclared here (not in a function)
     170 |         .flags =        INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
         |                                                ^~~~~~~~~~~~~~~~~
   net/homa/homa_plumbing.c:170:25: warning: excess elements in struct initializer
     170 |         .flags =        INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
         |                         ^~~~~~~~~~~~~~~~~~~~
   net/homa/homa_plumbing.c:170:25: note: (near initialization for 'homav6_protocol')
   net/homa/homa_plumbing.c: In function 'homa_load':
>> net/homa/homa_plumbing.c:226:9: error: implicit declaration of function 'inet6_register_protosw'; did you mean 'inet_register_protosw'? [-Wimplicit-function-declaration]
     226 |         inet6_register_protosw(&homav6_protosw);
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         inet_register_protosw
>> net/homa/homa_plumbing.c:233:18: error: implicit declaration of function 'inet6_add_protocol'; did you mean 'inet_add_protocol'? [-Wimplicit-function-declaration]
     233 |         status = inet6_add_protocol(&homav6_protocol, IPPROTO_HOMA);
         |                  ^~~~~~~~~~~~~~~~~~
         |                  inet_add_protocol
>> net/homa/homa_plumbing.c:259:9: error: implicit declaration of function 'inet6_del_protocol'; did you mean 'inet_del_protocol'? [-Wimplicit-function-declaration]
     259 |         inet6_del_protocol(&homav6_protocol, IPPROTO_HOMA);
         |         ^~~~~~~~~~~~~~~~~~
         |         inet_del_protocol
>> net/homa/homa_plumbing.c:260:9: error: implicit declaration of function 'inet6_unregister_protosw'; did you mean 'inet_unregister_protosw'? [-Wimplicit-function-declaration]
     260 |         inet6_unregister_protosw(&homav6_protosw);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
         |         inet_unregister_protosw
   net/homa/homa_plumbing.c: In function 'homa_softirq':
   net/homa/homa_plumbing.c:712:61: error: 'cpu_khz' undeclared (first use in this function)
     712 |                 int scaled_ms = (int)(10 * (start - last) / cpu_khz);
         |                                                             ^~~~~~~
   net/homa/homa_plumbing.c:712:61: note: each undeclared identifier is reported only once for each function it appears in
   net/homa/homa_plumbing.c: At top level:
>> net/homa/homa_plumbing.c:167:30: error: storage size of 'homav6_protocol' isn't known
     167 | static struct inet6_protocol homav6_protocol = {
         |                              ^~~~~~~~~~~~~~~


vim +291 net/homa/homa_incoming.c

223bab41c36796 John Ousterhout 2024-10-28  256  
223bab41c36796 John Ousterhout 2024-10-28  257  /**
223bab41c36796 John Ousterhout 2024-10-28  258   * homa_dispatch_pkts() - Top-level function that processes a batch of packets,
223bab41c36796 John Ousterhout 2024-10-28  259   * all related to the same RPC.
223bab41c36796 John Ousterhout 2024-10-28  260   * @skb:       First packet in the batch, linked through skb->next.
223bab41c36796 John Ousterhout 2024-10-28  261   * @homa:      Overall information about the Homa transport.
223bab41c36796 John Ousterhout 2024-10-28  262   */
223bab41c36796 John Ousterhout 2024-10-28  263  void homa_dispatch_pkts(struct sk_buff *skb, struct homa *homa)
223bab41c36796 John Ousterhout 2024-10-28  264  {
223bab41c36796 John Ousterhout 2024-10-28  265  #ifdef __UNIT_TEST__
223bab41c36796 John Ousterhout 2024-10-28  266  #define MAX_ACKS 2
223bab41c36796 John Ousterhout 2024-10-28  267  #else
223bab41c36796 John Ousterhout 2024-10-28  268  #define MAX_ACKS 10
223bab41c36796 John Ousterhout 2024-10-28  269  #endif
223bab41c36796 John Ousterhout 2024-10-28  270  	const struct in6_addr saddr = skb_canonical_ipv6_saddr(skb);
223bab41c36796 John Ousterhout 2024-10-28  271  	struct data_header *h = (struct data_header *)skb->data;
223bab41c36796 John Ousterhout 2024-10-28  272  	__u64 id = homa_local_id(h->common.sender_id);
223bab41c36796 John Ousterhout 2024-10-28  273  	int dport = ntohs(h->common.dport);
223bab41c36796 John Ousterhout 2024-10-28  274  
223bab41c36796 John Ousterhout 2024-10-28  275  	/* Used to collect acks from data packets so we can process them
223bab41c36796 John Ousterhout 2024-10-28  276  	 * all at the end (can't process them inline because that may
223bab41c36796 John Ousterhout 2024-10-28  277  	 * require locking conflicting RPCs). If we run out of space just
223bab41c36796 John Ousterhout 2024-10-28  278  	 * ignore the extra acks; they'll be regenerated later through the
223bab41c36796 John Ousterhout 2024-10-28  279  	 * explicit mechanism.
223bab41c36796 John Ousterhout 2024-10-28  280  	 */
223bab41c36796 John Ousterhout 2024-10-28  281  	struct homa_ack acks[MAX_ACKS];
223bab41c36796 John Ousterhout 2024-10-28  282  	struct homa_rpc *rpc = NULL;
223bab41c36796 John Ousterhout 2024-10-28  283  	struct homa_sock *hsk;
223bab41c36796 John Ousterhout 2024-10-28  284  	struct sk_buff *next;
223bab41c36796 John Ousterhout 2024-10-28  285  	int num_acks = 0;
223bab41c36796 John Ousterhout 2024-10-28  286  
223bab41c36796 John Ousterhout 2024-10-28  287  	/* Find the appropriate socket.*/
223bab41c36796 John Ousterhout 2024-10-28  288  	hsk = homa_sock_find(homa->port_map, dport);
223bab41c36796 John Ousterhout 2024-10-28  289  	if (!hsk) {
223bab41c36796 John Ousterhout 2024-10-28  290  		if (skb_is_ipv6(skb))
223bab41c36796 John Ousterhout 2024-10-28 @291  			icmp6_send(skb, ICMPV6_DEST_UNREACH,
223bab41c36796 John Ousterhout 2024-10-28  292  				   ICMPV6_PORT_UNREACH, 0, NULL, IP6CB(skb));
223bab41c36796 John Ousterhout 2024-10-28  293  		else
223bab41c36796 John Ousterhout 2024-10-28  294  			icmp_send(skb, ICMP_DEST_UNREACH,
223bab41c36796 John Ousterhout 2024-10-28  295  				  ICMP_PORT_UNREACH, 0);
223bab41c36796 John Ousterhout 2024-10-28  296  		while (skb) {
223bab41c36796 John Ousterhout 2024-10-28  297  			next = skb->next;
223bab41c36796 John Ousterhout 2024-10-28  298  			kfree_skb(skb);
223bab41c36796 John Ousterhout 2024-10-28  299  			skb = next;
223bab41c36796 John Ousterhout 2024-10-28  300  		}
223bab41c36796 John Ousterhout 2024-10-28  301  		return;
223bab41c36796 John Ousterhout 2024-10-28  302  	}
223bab41c36796 John Ousterhout 2024-10-28  303  
223bab41c36796 John Ousterhout 2024-10-28  304  	/* Each iteration through the following loop processes one packet. */
223bab41c36796 John Ousterhout 2024-10-28  305  	for (; skb; skb = next) {
223bab41c36796 John Ousterhout 2024-10-28  306  		h = (struct data_header *)skb->data;
223bab41c36796 John Ousterhout 2024-10-28  307  		next = skb->next;
223bab41c36796 John Ousterhout 2024-10-28  308  
223bab41c36796 John Ousterhout 2024-10-28  309  		/* Relinquish the RPC lock temporarily if it's needed
223bab41c36796 John Ousterhout 2024-10-28  310  		 * elsewhere.
223bab41c36796 John Ousterhout 2024-10-28  311  		 */
223bab41c36796 John Ousterhout 2024-10-28  312  		if (rpc) {
223bab41c36796 John Ousterhout 2024-10-28  313  			int flags = atomic_read(&rpc->flags);
223bab41c36796 John Ousterhout 2024-10-28  314  
223bab41c36796 John Ousterhout 2024-10-28  315  			if (flags & APP_NEEDS_LOCK) {
223bab41c36796 John Ousterhout 2024-10-28  316  				homa_rpc_unlock(rpc);
223bab41c36796 John Ousterhout 2024-10-28  317  				homa_spin(200);
223bab41c36796 John Ousterhout 2024-10-28  318  				rpc = NULL;
223bab41c36796 John Ousterhout 2024-10-28  319  			}
223bab41c36796 John Ousterhout 2024-10-28  320  		}
223bab41c36796 John Ousterhout 2024-10-28  321  
223bab41c36796 John Ousterhout 2024-10-28  322  		/* Find and lock the RPC if we haven't already done so. */
223bab41c36796 John Ousterhout 2024-10-28  323  		if (!rpc) {
223bab41c36796 John Ousterhout 2024-10-28  324  			if (!homa_is_client(id)) {
223bab41c36796 John Ousterhout 2024-10-28  325  				/* We are the server for this RPC. */
223bab41c36796 John Ousterhout 2024-10-28  326  				if (h->common.type == DATA) {
223bab41c36796 John Ousterhout 2024-10-28  327  					int created;
223bab41c36796 John Ousterhout 2024-10-28  328  
223bab41c36796 John Ousterhout 2024-10-28  329  					/* Create a new RPC if one doesn't
223bab41c36796 John Ousterhout 2024-10-28  330  					 * already exist.
223bab41c36796 John Ousterhout 2024-10-28  331  					 */
223bab41c36796 John Ousterhout 2024-10-28  332  					rpc = homa_rpc_new_server(hsk, &saddr,
223bab41c36796 John Ousterhout 2024-10-28  333  								  h, &created);
223bab41c36796 John Ousterhout 2024-10-28  334  					if (IS_ERR(rpc)) {
223bab41c36796 John Ousterhout 2024-10-28  335  						pr_warn("homa_pkt_dispatch couldn't create server rpc: error %lu",
223bab41c36796 John Ousterhout 2024-10-28  336  							-PTR_ERR(rpc));
223bab41c36796 John Ousterhout 2024-10-28  337  						rpc = NULL;
223bab41c36796 John Ousterhout 2024-10-28  338  						goto discard;
223bab41c36796 John Ousterhout 2024-10-28  339  					}
223bab41c36796 John Ousterhout 2024-10-28  340  				} else {
223bab41c36796 John Ousterhout 2024-10-28  341  					rpc = homa_find_server_rpc(hsk, &saddr,
223bab41c36796 John Ousterhout 2024-10-28  342  								   ntohs(h->common.sport),
223bab41c36796 John Ousterhout 2024-10-28  343  								   id);
223bab41c36796 John Ousterhout 2024-10-28  344  				}
223bab41c36796 John Ousterhout 2024-10-28  345  			} else {
223bab41c36796 John Ousterhout 2024-10-28  346  				rpc = homa_find_client_rpc(hsk, id);
223bab41c36796 John Ousterhout 2024-10-28  347  			}
223bab41c36796 John Ousterhout 2024-10-28  348  		}
223bab41c36796 John Ousterhout 2024-10-28  349  		if (unlikely(!rpc)) {
223bab41c36796 John Ousterhout 2024-10-28  350  			if (h->common.type != NEED_ACK &&
223bab41c36796 John Ousterhout 2024-10-28  351  			    h->common.type != ACK && h->common.type != RESEND)
223bab41c36796 John Ousterhout 2024-10-28  352  				goto discard;
223bab41c36796 John Ousterhout 2024-10-28  353  		} else {
223bab41c36796 John Ousterhout 2024-10-28  354  			if (h->common.type == DATA || h->common.type == BUSY ||
223bab41c36796 John Ousterhout 2024-10-28  355  			    h->common.type == NEED_ACK)
223bab41c36796 John Ousterhout 2024-10-28  356  				rpc->silent_ticks = 0;
223bab41c36796 John Ousterhout 2024-10-28  357  			rpc->peer->outstanding_resends = 0;
223bab41c36796 John Ousterhout 2024-10-28  358  		}
223bab41c36796 John Ousterhout 2024-10-28  359  
223bab41c36796 John Ousterhout 2024-10-28  360  		switch (h->common.type) {
223bab41c36796 John Ousterhout 2024-10-28  361  		case DATA:
223bab41c36796 John Ousterhout 2024-10-28  362  			if (h->ack.client_id) {
223bab41c36796 John Ousterhout 2024-10-28  363  				/* Save the ack for processing later, when we
223bab41c36796 John Ousterhout 2024-10-28  364  				 * have released the RPC lock.
223bab41c36796 John Ousterhout 2024-10-28  365  				 */
223bab41c36796 John Ousterhout 2024-10-28  366  				if (num_acks < MAX_ACKS) {
223bab41c36796 John Ousterhout 2024-10-28  367  					acks[num_acks] = h->ack;
223bab41c36796 John Ousterhout 2024-10-28  368  					num_acks++;
223bab41c36796 John Ousterhout 2024-10-28  369  				}
223bab41c36796 John Ousterhout 2024-10-28  370  			}
223bab41c36796 John Ousterhout 2024-10-28  371  			homa_data_pkt(skb, rpc);
223bab41c36796 John Ousterhout 2024-10-28  372  			break;
223bab41c36796 John Ousterhout 2024-10-28  373  		case RESEND:
223bab41c36796 John Ousterhout 2024-10-28  374  			homa_resend_pkt(skb, rpc, hsk);
223bab41c36796 John Ousterhout 2024-10-28  375  			break;
223bab41c36796 John Ousterhout 2024-10-28  376  		case UNKNOWN:
223bab41c36796 John Ousterhout 2024-10-28  377  			homa_unknown_pkt(skb, rpc);
223bab41c36796 John Ousterhout 2024-10-28  378  			break;
223bab41c36796 John Ousterhout 2024-10-28  379  		case BUSY:
223bab41c36796 John Ousterhout 2024-10-28  380  			/* Nothing to do for these packets except reset
223bab41c36796 John Ousterhout 2024-10-28  381  			 * silent_ticks, which happened above.
223bab41c36796 John Ousterhout 2024-10-28  382  			 */
223bab41c36796 John Ousterhout 2024-10-28  383  			goto discard;
223bab41c36796 John Ousterhout 2024-10-28  384  		case NEED_ACK:
223bab41c36796 John Ousterhout 2024-10-28  385  			homa_need_ack_pkt(skb, hsk, rpc);
223bab41c36796 John Ousterhout 2024-10-28  386  			break;
223bab41c36796 John Ousterhout 2024-10-28  387  		case ACK:
223bab41c36796 John Ousterhout 2024-10-28  388  			homa_ack_pkt(skb, hsk, rpc);
223bab41c36796 John Ousterhout 2024-10-28  389  			rpc = NULL;
223bab41c36796 John Ousterhout 2024-10-28  390  
223bab41c36796 John Ousterhout 2024-10-28  391  			/* It isn't safe to process more packets once we've
223bab41c36796 John Ousterhout 2024-10-28  392  			 * released the RPC lock (this should never happen).
223bab41c36796 John Ousterhout 2024-10-28  393  			 */
223bab41c36796 John Ousterhout 2024-10-28  394  			BUG_ON(next);
223bab41c36796 John Ousterhout 2024-10-28  395  			break;
223bab41c36796 John Ousterhout 2024-10-28  396  		default:
223bab41c36796 John Ousterhout 2024-10-28  397  			goto discard;
223bab41c36796 John Ousterhout 2024-10-28  398  		}
223bab41c36796 John Ousterhout 2024-10-28  399  		continue;
223bab41c36796 John Ousterhout 2024-10-28  400  
223bab41c36796 John Ousterhout 2024-10-28  401  discard:
223bab41c36796 John Ousterhout 2024-10-28  402  		kfree_skb(skb);
223bab41c36796 John Ousterhout 2024-10-28  403  	}
223bab41c36796 John Ousterhout 2024-10-28  404  	if (rpc)
223bab41c36796 John Ousterhout 2024-10-28  405  		homa_rpc_unlock(rpc);
223bab41c36796 John Ousterhout 2024-10-28  406  
223bab41c36796 John Ousterhout 2024-10-28  407  	while (num_acks > 0) {
223bab41c36796 John Ousterhout 2024-10-28  408  		num_acks--;
223bab41c36796 John Ousterhout 2024-10-28  409  		homa_rpc_acked(hsk, &saddr, &acks[num_acks]);
223bab41c36796 John Ousterhout 2024-10-28  410  	}
223bab41c36796 John Ousterhout 2024-10-28  411  
223bab41c36796 John Ousterhout 2024-10-28  412  	if (hsk->dead_skbs >= 2 * hsk->homa->dead_buffs_limit)
223bab41c36796 John Ousterhout 2024-10-28  413  		/* We get here if neither homa_wait_for_message
223bab41c36796 John Ousterhout 2024-10-28  414  		 * nor homa_timer can keep up with reaping dead
223bab41c36796 John Ousterhout 2024-10-28  415  		 * RPCs. See reap.txt for details.
223bab41c36796 John Ousterhout 2024-10-28  416  		 */
223bab41c36796 John Ousterhout 2024-10-28  417  
223bab41c36796 John Ousterhout 2024-10-28  418  		homa_rpc_reap(hsk, hsk->homa->reap_limit);
223bab41c36796 John Ousterhout 2024-10-28  419  }
223bab41c36796 John Ousterhout 2024-10-28  420
kernel test robot Oct. 30, 2024, 1:09 a.m. UTC | #4
Hi John,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
config: arc-randconfig-r132-20241029 (https://download.01.org/0day-ci/archive/20241030/202410300823.rFSVqCH5-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241030/202410300823.rFSVqCH5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410300823.rFSVqCH5-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   net/homa/homa_rpc.c: note: in included file:
>> net/homa/homa_impl.h:605:13: sparse: sparse: restricted __be32 degrades to integer
   net/homa/homa_rpc.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   net/homa/homa_rpc.c:84:9: sparse: sparse: context imbalance in 'homa_rpc_new_client' - different lock contexts for basic block
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   net/homa/homa_rpc.c:104:17: sparse: sparse: context imbalance in 'homa_rpc_new_server' - wrong count at exit
   net/homa/homa_rpc.c: note: in included file (through include/linux/rculist.h, include/linux/sched/signal.h, include/linux/ptrace.h, ...):
   include/linux/rcupdate.h:881:9: sparse: sparse: context imbalance in 'homa_rpc_acked' - unexpected unlock
   net/homa/homa_rpc.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
   net/homa/homa_rpc.c:235:6: sparse: sparse: context imbalance in 'homa_rpc_free' - different lock contexts for basic block
   net/homa/homa_rpc.c:311:5: sparse: sparse: context imbalance in 'homa_rpc_reap' - wrong count at exit
   net/homa/homa_rpc.c:448:17: sparse: sparse: context imbalance in 'homa_find_client_rpc' - wrong count at exit
   net/homa/homa_rpc.c:474:17: sparse: sparse: context imbalance in 'homa_find_server_rpc' - wrong count at exit
--
>> net/homa/homa_sock.c:85:39: sparse: sparse: cast removes address space '__rcu' of expression
   net/homa/homa_sock.c:91:31: sparse: sparse: cast removes address space '__rcu' of expression
   net/homa/homa_sock.c:165:6: sparse: sparse: context imbalance in 'homa_sock_shutdown' - wrong count at exit
   net/homa/homa_sock.c:243:5: sparse: sparse: context imbalance in 'homa_sock_bind' - different lock contexts for basic block
   net/homa/homa_sock.c:312:6: sparse: sparse: context imbalance in 'homa_sock_lock_slow' - wrong count at exit
   net/homa/homa_sock.c:326:6: sparse: sparse: context imbalance in 'homa_bucket_lock_slow' - wrong count at exit

vim +605 net/homa/homa_impl.h

1416f12d4ea455 John Ousterhout 2024-10-28  595  
1416f12d4ea455 John Ousterhout 2024-10-28  596  /**
1416f12d4ea455 John Ousterhout 2024-10-28  597   * Given an IPv4 address, return an equivalent IPv6 address (an IPv4-mapped
1416f12d4ea455 John Ousterhout 2024-10-28  598   * one)
1416f12d4ea455 John Ousterhout 2024-10-28  599   * @ip4: IPv4 address, in network byte order.
1416f12d4ea455 John Ousterhout 2024-10-28  600   */
1416f12d4ea455 John Ousterhout 2024-10-28  601  static inline struct in6_addr ipv4_to_ipv6(__be32 ip4)
1416f12d4ea455 John Ousterhout 2024-10-28  602  {
1416f12d4ea455 John Ousterhout 2024-10-28  603  	struct in6_addr ret = {};
1416f12d4ea455 John Ousterhout 2024-10-28  604  
1416f12d4ea455 John Ousterhout 2024-10-28 @605  	if (ip4 == INADDR_ANY)
1416f12d4ea455 John Ousterhout 2024-10-28  606  		return in6addr_any;
1416f12d4ea455 John Ousterhout 2024-10-28  607  	ret.in6_u.u6_addr32[2] = htonl(0xffff);
1416f12d4ea455 John Ousterhout 2024-10-28  608  	ret.in6_u.u6_addr32[3] = ip4;
1416f12d4ea455 John Ousterhout 2024-10-28  609  	return ret;
1416f12d4ea455 John Ousterhout 2024-10-28  610  }
1416f12d4ea455 John Ousterhout 2024-10-28  611
John Ousterhout Nov. 3, 2024, 12:11 a.m. UTC | #5
I have made a stab at fixing all of the problems reported by the test
robot. However, it may take a few passes to figure exactly how to make
sparse happy...

-John-


On Tue, Oct 29, 2024 at 6:09 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi John,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on net-next/main]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/John-Ousterhout/net-homa-define-user-visible-API-for-Homa/20241029-095137
> base:   net-next/main
> patch link:    https://lore.kernel.org/r/20241028213541.1529-13-ouster%40cs.stanford.edu
> patch subject: [PATCH net-next 12/12] net: homa: create Makefile and Kconfig
> config: arc-randconfig-r132-20241029 (https://download.01.org/0day-ci/archive/20241030/202410300823.rFSVqCH5-lkp@intel.com/config)
> compiler: arc-elf-gcc (GCC) 13.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20241030/202410300823.rFSVqCH5-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202410300823.rFSVqCH5-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>    net/homa/homa_rpc.c: note: in included file:
> >> net/homa/homa_impl.h:605:13: sparse: sparse: restricted __be32 degrades to integer
>    net/homa/homa_rpc.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
>    include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
>    net/homa/homa_rpc.c:84:9: sparse: sparse: context imbalance in 'homa_rpc_new_client' - different lock contexts for basic block
>    include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
>    net/homa/homa_rpc.c:104:17: sparse: sparse: context imbalance in 'homa_rpc_new_server' - wrong count at exit
>    net/homa/homa_rpc.c: note: in included file (through include/linux/rculist.h, include/linux/sched/signal.h, include/linux/ptrace.h, ...):
>    include/linux/rcupdate.h:881:9: sparse: sparse: context imbalance in 'homa_rpc_acked' - unexpected unlock
>    net/homa/homa_rpc.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
>    include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
>    net/homa/homa_rpc.c:235:6: sparse: sparse: context imbalance in 'homa_rpc_free' - different lock contexts for basic block
>    net/homa/homa_rpc.c:311:5: sparse: sparse: context imbalance in 'homa_rpc_reap' - wrong count at exit
>    net/homa/homa_rpc.c:448:17: sparse: sparse: context imbalance in 'homa_find_client_rpc' - wrong count at exit
>    net/homa/homa_rpc.c:474:17: sparse: sparse: context imbalance in 'homa_find_server_rpc' - wrong count at exit
> --
> >> net/homa/homa_sock.c:85:39: sparse: sparse: cast removes address space '__rcu' of expression
>    net/homa/homa_sock.c:91:31: sparse: sparse: cast removes address space '__rcu' of expression
>    net/homa/homa_sock.c:165:6: sparse: sparse: context imbalance in 'homa_sock_shutdown' - wrong count at exit
>    net/homa/homa_sock.c:243:5: sparse: sparse: context imbalance in 'homa_sock_bind' - different lock contexts for basic block
>    net/homa/homa_sock.c:312:6: sparse: sparse: context imbalance in 'homa_sock_lock_slow' - wrong count at exit
>    net/homa/homa_sock.c:326:6: sparse: sparse: context imbalance in 'homa_bucket_lock_slow' - wrong count at exit
>
> vim +605 net/homa/homa_impl.h
>
> 1416f12d4ea455 John Ousterhout 2024-10-28  595
> 1416f12d4ea455 John Ousterhout 2024-10-28  596  /**
> 1416f12d4ea455 John Ousterhout 2024-10-28  597   * Given an IPv4 address, return an equivalent IPv6 address (an IPv4-mapped
> 1416f12d4ea455 John Ousterhout 2024-10-28  598   * one)
> 1416f12d4ea455 John Ousterhout 2024-10-28  599   * @ip4: IPv4 address, in network byte order.
> 1416f12d4ea455 John Ousterhout 2024-10-28  600   */
> 1416f12d4ea455 John Ousterhout 2024-10-28  601  static inline struct in6_addr ipv4_to_ipv6(__be32 ip4)
> 1416f12d4ea455 John Ousterhout 2024-10-28  602  {
> 1416f12d4ea455 John Ousterhout 2024-10-28  603          struct in6_addr ret = {};
> 1416f12d4ea455 John Ousterhout 2024-10-28  604
> 1416f12d4ea455 John Ousterhout 2024-10-28 @605          if (ip4 == INADDR_ANY)
> 1416f12d4ea455 John Ousterhout 2024-10-28  606                  return in6addr_any;
> 1416f12d4ea455 John Ousterhout 2024-10-28  607          ret.in6_u.u6_addr32[2] = htonl(0xffff);
> 1416f12d4ea455 John Ousterhout 2024-10-28  608          ret.in6_u.u6_addr32[3] = ip4;
> 1416f12d4ea455 John Ousterhout 2024-10-28  609          return ret;
> 1416f12d4ea455 John Ousterhout 2024-10-28  610  }
> 1416f12d4ea455 John Ousterhout 2024-10-28  611
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 1389704c7d8d..935d1e995018 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10391,6 +10391,13 @@  F:	lib/test_hmm*
 F:	mm/hmm*
 F:	tools/testing/selftests/mm/*hmm*
 
+HOMA TRANSPORT PROTOCOL
+M:	John Ousterhout <ouster@cs.stanford.edu>
+S:	Maintained
+W:	https://homa-transport.atlassian.net/wiki/spaces/HOMA/overview
+F:	include/uapi/linux/homa.h
+F:	net/homa/
+
 HONEYWELL HSC030PA PRESSURE SENSOR SERIES IIO DRIVER
 M:	Petre Rodan <petre.rodan@subdimension.ro>
 L:	linux-iio@vger.kernel.org
diff --git a/net/Kconfig b/net/Kconfig
index a629f92dc86b..ca8551c1a226 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -244,6 +244,7 @@  endif
 
 source "net/dccp/Kconfig"
 source "net/sctp/Kconfig"
+source "net/homa/Kconfig"
 source "net/rds/Kconfig"
 source "net/tipc/Kconfig"
 source "net/atm/Kconfig"
diff --git a/net/Makefile b/net/Makefile
index 65bb8c72a35e..18fa3c323187 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -44,6 +44,7 @@  obj-y				+= 8021q/
 endif
 obj-$(CONFIG_IP_DCCP)		+= dccp/
 obj-$(CONFIG_IP_SCTP)		+= sctp/
+obj-$(CONFIG_HOMA)              += homa/
 obj-$(CONFIG_RDS)		+= rds/
 obj-$(CONFIG_WIRELESS)		+= wireless/
 obj-$(CONFIG_MAC80211)		+= mac80211/
diff --git a/net/homa/Kconfig b/net/homa/Kconfig
new file mode 100644
index 000000000000..bb98e96d8f66
--- /dev/null
+++ b/net/homa/Kconfig
@@ -0,0 +1,17 @@ 
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Homa transport protocol
+#
+
+menuconfig HOMA
+	tristate "The Homa transport protocol"
+
+	help
+	Homa is a network transport protocol for communication within
+	a datacenter. It provides significantly lower latency than TCP,
+	particularly for workloads containing a mixture of large and small
+	messages operating at high network utilization. For more information
+	see the homa(7) man page or checkout the Homa Wiki at
+	https://homa-transport.atlassian.net/wiki/spaces/HOMA/overview.
+
+	If unsure, say N.
diff --git a/net/homa/Makefile b/net/homa/Makefile
new file mode 100644
index 000000000000..3eb192a6ffa6
--- /dev/null
+++ b/net/homa/Makefile
@@ -0,0 +1,14 @@ 
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Makefile for the Linux implementation of the Homa transport protocol.
+
+obj-$(CONFIG_HOMA) := homa.o
+homa-y:=        homa_incoming.o \
+		homa_outgoing.o \
+		homa_peer.o \
+		homa_pool.o \
+		homa_plumbing.o \
+		homa_rpc.o \
+		homa_sock.o \
+		homa_timer.o \
+		homa_utils.o