All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
To: <davem@davemloft.net>, <aelior@marvell.com>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH net-next 2/2] bnx2x: Add support for detection of P2P event packets.
Date: Tue, 16 Apr 2019 01:46:13 -0700	[thread overview]
Message-ID: <20190416084613.16897-3-skalluru@marvell.com> (raw)
In-Reply-To: <20190416084613.16897-1-skalluru@marvell.com>

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@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.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


  parent reply	other threads:[~2019-04-16  8:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  8:46 [PATCH net-next 0/2] bnx2x: Support for timestamping in P2P mode Sudarsana Reddy Kalluru
2019-04-16  8:46 ` [PATCH net-next 1/2] bnx2x: Replace magic numbers with macro definitions Sudarsana Reddy Kalluru
2019-04-16  8:46 ` Sudarsana Reddy Kalluru [this message]
2019-04-17  4:35 ` [PATCH net-next 0/2] bnx2x: Support for timestamping in P2P mode 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=20190416084613.16897-3-skalluru@marvell.com \
    --to=skalluru@marvell.com \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.