From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Shannon Nelson <shannon.nelson@oracle.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 05/13] ixgbe: prep IPsec constants for later use
Date: Tue, 28 Aug 2018 14:35:50 -0700 [thread overview]
Message-ID: <20180828213558.19273-7-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180828213558.19273-1-jeffrey.t.kirsher@intel.com>
From: Shannon Nelson <shannon.nelson@oracle.com>
Pull out a couple of values from a function so they can be used
later elsewhere.
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
index 434065109b8d..3afb1fe766cd 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
@@ -5,6 +5,9 @@
#include <net/xfrm.h>
#include <crypto/aead.h>
+#define IXGBE_IPSEC_KEY_BITS 160
+static const char aes_gcm_name[] = "rfc4106(gcm(aes))";
+
/**
* ixgbe_ipsec_set_tx_sa - set the Tx SA registers
* @hw: hw specific details
@@ -407,7 +410,6 @@ static int ixgbe_ipsec_parse_proto_keys(struct xfrm_state *xs,
struct net_device *dev = xs->xso.dev;
unsigned char *key_data;
char *alg_name = NULL;
- const char aes_gcm_name[] = "rfc4106(gcm(aes))";
int key_len;
if (!xs->aead) {
@@ -435,9 +437,9 @@ static int ixgbe_ipsec_parse_proto_keys(struct xfrm_state *xs,
* we don't need to do any byteswapping.
* 160 accounts for 16 byte key and 4 byte salt
*/
- if (key_len == 160) {
+ if (key_len == IXGBE_IPSEC_KEY_BITS) {
*mysalt = ((u32 *)key_data)[4];
- } else if (key_len != 128) {
+ } else if (key_len != (IXGBE_IPSEC_KEY_BITS - (sizeof(*mysalt) * 8))) {
netdev_err(dev, "IPsec hw offload only supports keys up to 128 bits with a 32 bit salt\n");
return -EINVAL;
} else {
--
2.17.1
next prev parent reply other threads:[~2018-08-29 1:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 21:35 [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-08-28 Jeff Kirsher
2018-08-28 21:35 ` [net-next 01/13] ixgbe: firmware recovery mode Jeff Kirsher
2018-08-28 21:35 ` [net-next 02/13] ixgbevf: VF2VF TCP RSS Jeff Kirsher
2018-08-28 21:35 ` [net-next 03/13] ixgbe: don't clear IPsec sa counters on HW clearing Jeff Kirsher
2018-08-28 21:35 ` Jeff Kirsher
2018-08-28 21:35 ` [net-next 04/13] ixgbe: reload IPsec IP table after sa tables Jeff Kirsher
2018-08-28 21:35 ` Jeff Kirsher [this message]
2018-08-28 21:35 ` [net-next 06/13] ixgbe: add VF IPsec management Jeff Kirsher
2018-08-28 21:35 ` [net-next 07/13] ixgbe: add VF IPsec offload enable flag Jeff Kirsher
2018-08-28 21:35 ` [net-next 08/13] ixgbe: add VF IPsec offload request message handling Jeff Kirsher
2018-08-28 21:35 ` [net-next 09/13] ixgbevf: add defines for IPsec offload request Jeff Kirsher
2018-08-28 21:35 ` [net-next 10/13] ixgbevf: add VF IPsec offload code Jeff Kirsher
2018-08-28 21:35 ` [net-next 11/13] ixgbevf: enable VF IPsec offload operations Jeff Kirsher
2018-08-28 21:35 ` [net-next 12/13] ixgbe: disallow IPsec Tx offload when in SR-IOV mode Jeff Kirsher
2018-08-28 21:35 ` [net-next 13/13] ixgbe: fix the return value for unsupported VF offload Jeff Kirsher
2018-08-29 0:01 ` [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-08-28 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180828213558.19273-7-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=shannon.nelson@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox