lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190416084613.16897-3-skalluru@marvell.com>
Date:   Tue, 16 Apr 2019 01:46:13 -0700
From:   Sudarsana Reddy Kalluru <skalluru@...vell.com>
To:     <davem@...emloft.net>, <aelior@...vell.com>
CC:     <netdev@...r.kernel.org>
Subject: [PATCH net-next 2/2] bnx2x: Add support for detection of P2P event packets.

The patch adds support for detecting the P2P (peer-to-peer) event packets.
This is required for timestamping the PTP packets in peer delay mode.
Unmask the below bits (set to 0) for device to detect the p2p packets.
  NIG_REG_P0/1_LLH_PTP_PARAM_MASK
  NIG_REG_P0/1_TLLH_PTP_PARAM_MASK
    bit 1 - IPv4 DA 1 of 224.0.0.107.
    bit 3 - IPv6 DA 1 of 0xFF02:0:0:0:0:0:0:6B.
    bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E.
  NIG_REG_P0/1_LLH_PTP_RULE_MASK
  NIG_REG_P0/1_TLLH_PTP_RULE_MASK
    bit 2 - {IPv4 DA 1; UDP DP 0}
    bit 6 - MAC Ethertype 0 of 0x88F7.
    bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@...vell.com>
Signed-off-by: Ariel Elior <aelior@...vell.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 0ebc526..0d6c98a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -15376,16 +15376,18 @@ static int bnx2x_enable_ptp_packets(struct bnx2x *bp)
 	return 0;
 }
 
-#define BNX2X_PTP_TX_ON_PARAM_MASK 0x6AA
-#define BNX2X_PTP_TX_ON_RULE_MASK 0x3EEE
-#define BNX2X_PTP_V1_L4_PARAM_MASK 0x7EE
-#define BNX2X_PTP_V1_L4_RULE_MASK 0x3FFE
-#define BNX2X_PTP_V2_L4_PARAM_MASK 0x7EA
-#define BNX2X_PTP_V2_L4_RULE_MASK 0x3FEE
-#define BNX2X_PTP_V2_L2_PARAM_MASK 0x6BF
-#define BNX2X_PTP_V2_L2_RULE_MASK 0x3EFF
-#define BNX2X_PTP_V2_PARAM_MASK 0x6AA
-#define BNX2X_PTP_V2_RULE_MASK 0x3EEE
+#define BNX2X_P2P_DETECT_PARAM_MASK 0x5F5
+#define BNX2X_P2P_DETECT_RULE_MASK 0x3DBB
+#define BNX2X_PTP_TX_ON_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6AA)
+#define BNX2X_PTP_TX_ON_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EEE)
+#define BNX2X_PTP_V1_L4_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x7EE)
+#define BNX2X_PTP_V1_L4_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3FFE)
+#define BNX2X_PTP_V2_L4_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x7EA)
+#define BNX2X_PTP_V2_L4_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3FEE)
+#define BNX2X_PTP_V2_L2_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6BF)
+#define BNX2X_PTP_V2_L2_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EFF)
+#define BNX2X_PTP_V2_PARAM_MASK (BNX2X_P2P_DETECT_PARAM_MASK & 0x6AA)
+#define BNX2X_PTP_V2_RULE_MASK (BNX2X_P2P_DETECT_RULE_MASK & 0x3EEE)
 
 int bnx2x_configure_ptp_filters(struct bnx2x *bp)
 {
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ