-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'net-tls-separate-the-TLS-TOE-code-out'
Jakub Kicinski says: ==================== net/tls: separate the TLS TOE code out We have 3 modes of operation of TLS - software, crypto offload (Mellanox, Netronome) and TCP Offload Engine-based (Chelsio). The last one takes over the socket, like any TOE would, and is not really compatible with how we want to do things in the networking stack. Confusingly the name of the crypto-only offload mode is TLS_HW, while TOE-offload related functions use tls_hw_ as their prefix. Engineers looking to implement offload are also be faced with TOE artefacts like struct tls_device (while, again, CONFIG_TLS_DEVICE actually gates the non-TOE offload). To improve the clarity of the offload code move the TOE code into new files, and rename the functions and structures appropriately. Because TOE-offload takes over the socket, and makes no use of the TLS infrastructure in the kernel, the rest of the code (anything beyond the ULP setup handlers) do not have to worry about the mode == TLS_HW_RECORD case. The increase in code size is due to duplication of the full license boilerplate. Unfortunately original author (Dave Watson) seems unreachable :( ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Showing
9 changed files
with
257 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved. | ||
* Copyright (c) 2016-2017, Dave Watson <davejwatson@fb.com>. All rights reserved. | ||
* | ||
* This software is available to you under a choice of one of two | ||
* licenses. You may choose to be licensed under the terms of the GNU | ||
* General Public License (GPL) Version 2, available from the file | ||
* COPYING in the main directory of this source tree, or the | ||
* OpenIB.org BSD license below: | ||
* | ||
* Redistribution and use in source and binary forms, with or | ||
* without modification, are permitted provided that the following | ||
* conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer. | ||
* | ||
* - Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials | ||
* provided with the distribution. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
#include <linux/kref.h> | ||
#include <linux/list.h> | ||
|
||
struct sock; | ||
|
||
#define TLS_TOE_DEVICE_NAME_MAX 32 | ||
|
||
/* | ||
* This structure defines the routines for Inline TLS driver. | ||
* The following routines are optional and filled with a | ||
* null pointer if not defined. | ||
* | ||
* @name: Its the name of registered Inline tls device | ||
* @dev_list: Inline tls device list | ||
* int (*feature)(struct tls_toe_device *device); | ||
* Called to return Inline TLS driver capability | ||
* | ||
* int (*hash)(struct tls_toe_device *device, struct sock *sk); | ||
* This function sets Inline driver for listen and program | ||
* device specific functioanlity as required | ||
* | ||
* void (*unhash)(struct tls_toe_device *device, struct sock *sk); | ||
* This function cleans listen state set by Inline TLS driver | ||
* | ||
* void (*release)(struct kref *kref); | ||
* Release the registered device and allocated resources | ||
* @kref: Number of reference to tls_toe_device | ||
*/ | ||
struct tls_toe_device { | ||
char name[TLS_TOE_DEVICE_NAME_MAX]; | ||
struct list_head dev_list; | ||
int (*feature)(struct tls_toe_device *device); | ||
int (*hash)(struct tls_toe_device *device, struct sock *sk); | ||
void (*unhash)(struct tls_toe_device *device, struct sock *sk); | ||
void (*release)(struct kref *kref); | ||
struct kref kref; | ||
}; | ||
|
||
int tls_toe_bypass(struct sock *sk); | ||
int tls_toe_hash(struct sock *sk); | ||
void tls_toe_unhash(struct sock *sk); | ||
|
||
void tls_toe_register_device(struct tls_toe_device *device); | ||
void tls_toe_unregister_device(struct tls_toe_device *device); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.