All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 00/10] bnxt_en: Updates for net-next.
@ 2021-04-25 17:45 Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 01/10] bnxt_en: report signal mode in link up messages Michael Chan
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]

This series includes these main enhancements:

1. Link related changes
    - add NRZ/PAM4 link signal mode to the link up message if known
    - rely on firmware to bring down the link during ifdown

2. SRIOV related changes
    - allow VF promiscuous mode if the VF is trusted
    - allow ndo operations to configure VF when the PF is ifdown
    - fix the scenario of the VF taking back control of it's MAC address 
    - add Hyper-V VF device IDs

3. Support the option to transmit without FCS/CRC.

4. Implement .ndo_features_check() to disable offload when the UDP
   encap. packets are not supported.

v2: Patch10: Reverse the check for supported UDP ports to be more straight
forward.

Edwin Peer (3):
  bnxt_en: report signal mode in link up messages
  bnxt_en: allow promiscuous mode for trusted VFs
  bnxt_en: allow VF config ops when PF is closed

Michael Chan (7):
  bnxt_en: Add a new phy_flags field to the main driver structure.
  bnxt_en: Add support for fw managed link down feature.
  bnxt_en: Move bnxt_approve_mac().
  bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the
    VF MAC.
  bnxt_en: Add PCI IDs for Hyper-V VF devices.
  bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet
    FCS.
  bnxt_en: Implement .ndo_features_check().

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 142 +++++++++++++-----
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  23 ++-
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |   8 +-
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   |  74 ++++-----
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.h   |   1 +
 5 files changed, 166 insertions(+), 82 deletions(-)

-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 01/10] bnxt_en: report signal mode in link up messages
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 02/10] bnxt_en: Add a new phy_flags field to the main driver structure Michael Chan
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

From: Edwin Peer <edwin.peer@broadcom.com>

Firmware reports link signalling mode for certain speeds. In these
cases, print the signalling modes in kernel log link up messages.

Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e15d454e33f0..573c039e6046 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9075,8 +9075,9 @@ static char *bnxt_report_fec(struct bnxt_link_info *link_info)
 static void bnxt_report_link(struct bnxt *bp)
 {
 	if (bp->link_info.link_up) {
-		const char *duplex;
+		const char *signal = "";
 		const char *flow_ctrl;
+		const char *duplex;
 		u32 speed;
 		u16 fec;
 
@@ -9098,8 +9099,23 @@ static void bnxt_report_link(struct bnxt *bp)
 			flow_ctrl = "ON - receive";
 		else
 			flow_ctrl = "none";
-		netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s duplex, Flow control: %s\n",
-			    speed, duplex, flow_ctrl);
+		if (bp->link_info.phy_qcfg_resp.option_flags &
+		    PORT_PHY_QCFG_RESP_OPTION_FLAGS_SIGNAL_MODE_KNOWN) {
+			u8 sig_mode = bp->link_info.active_fec_sig_mode &
+				      PORT_PHY_QCFG_RESP_SIGNAL_MODE_MASK;
+			switch (sig_mode) {
+			case PORT_PHY_QCFG_RESP_SIGNAL_MODE_NRZ:
+				signal = "(NRZ) ";
+				break;
+			case PORT_PHY_QCFG_RESP_SIGNAL_MODE_PAM4:
+				signal = "(PAM4) ";
+				break;
+			default:
+				break;
+			}
+		}
+		netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s%s duplex, Flow control: %s\n",
+			    speed, signal, duplex, flow_ctrl);
 		if (bp->flags & BNXT_FLAG_EEE_CAP)
 			netdev_info(bp->dev, "EEE is %s\n",
 				    bp->eee.eee_active ? "active" :
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 02/10] bnxt_en: Add a new phy_flags field to the main driver structure.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 01/10] bnxt_en: report signal mode in link up messages Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 03/10] bnxt_en: Add support for fw managed link down feature Michael Chan
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 8545 bytes --]

Copy the phy related feature flags from the firmware call
HWRM_PORT_PHY_QCAPS to this new field.  We can also remove the flags
field in the bnxt_test_info structure.  It's cleaner to have all PHY
related flags in one location, directly copied from the firmware.

To keep the BNXT_PHY_CFG_ABLE() macro logic the same, we need to make
a slight adjustment to check that it is a PF.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 29 ++++---------------
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     | 19 +++++++-----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  8 ++---
 3 files changed, 22 insertions(+), 34 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 573c039e6046..f08427b7dbe7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4145,7 +4145,7 @@ static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init)
 	bnxt_free_ntp_fltrs(bp, irq_re_init);
 	if (irq_re_init) {
 		bnxt_free_ring_stats(bp);
-		if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET) ||
+		if (!(bp->phy_flags & BNXT_PHY_FL_PORT_STATS_NO_RESET) ||
 		    test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
 			bnxt_free_port_stats(bp);
 		bnxt_free_ring_grps(bp);
@@ -9116,7 +9116,7 @@ static void bnxt_report_link(struct bnxt *bp)
 		}
 		netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s%s duplex, Flow control: %s\n",
 			    speed, signal, duplex, flow_ctrl);
-		if (bp->flags & BNXT_FLAG_EEE_CAP)
+		if (bp->phy_flags & BNXT_PHY_FL_EEE_CAP)
 			netdev_info(bp->dev, "EEE is %s\n",
 				    bp->eee.eee_active ? "active" :
 							 "not active");
@@ -9148,10 +9148,6 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
 	struct hwrm_port_phy_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
 	struct bnxt_link_info *link_info = &bp->link_info;
 
-	bp->flags &= ~BNXT_FLAG_EEE_CAP;
-	if (bp->test_info)
-		bp->test_info->flags &= ~(BNXT_TEST_FL_EXT_LPBK |
-					  BNXT_TEST_FL_AN_PHY_LPBK);
 	if (bp->hwrm_spec_code < 0x10201)
 		return 0;
 
@@ -9162,31 +9158,17 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
 	if (rc)
 		goto hwrm_phy_qcaps_exit;
 
+	bp->phy_flags = resp->flags;
 	if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED) {
 		struct ethtool_eee *eee = &bp->eee;
 		u16 fw_speeds = le16_to_cpu(resp->supported_speeds_eee_mode);
 
-		bp->flags |= BNXT_FLAG_EEE_CAP;
 		eee->supported = _bnxt_fw_to_ethtool_adv_spds(fw_speeds, 0);
 		bp->lpi_tmr_lo = le32_to_cpu(resp->tx_lpi_timer_low) &
 				 PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_LOW_MASK;
 		bp->lpi_tmr_hi = le32_to_cpu(resp->valid_tx_lpi_timer_high) &
 				 PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_MASK;
 	}
-	if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_EXTERNAL_LPBK_SUPPORTED) {
-		if (bp->test_info)
-			bp->test_info->flags |= BNXT_TEST_FL_EXT_LPBK;
-	}
-	if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_AUTONEG_LPBK_SUPPORTED) {
-		if (bp->test_info)
-			bp->test_info->flags |= BNXT_TEST_FL_AN_PHY_LPBK;
-	}
-	if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED) {
-		if (BNXT_PF(bp))
-			bp->fw_cap |= BNXT_FW_CAP_SHARED_PORT_CFG;
-	}
-	if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET)
-		bp->fw_cap |= BNXT_FW_CAP_PORT_STATS_NO_RESET;
 
 	if (bp->hwrm_spec_code >= 0x10a01) {
 		if (bnxt_phy_qcaps_no_speed(resp)) {
@@ -9277,7 +9259,7 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
 			      PORT_PHY_QCFG_RESP_PHY_ADDR_MASK;
 	link_info->module_status = resp->module_status;
 
-	if (bp->flags & BNXT_FLAG_EEE_CAP) {
+	if (bp->phy_flags & BNXT_PHY_FL_EEE_CAP) {
 		struct ethtool_eee *eee = &bp->eee;
 		u16 fw_speeds;
 
@@ -9855,7 +9837,7 @@ static bool bnxt_eee_config_ok(struct bnxt *bp)
 	struct ethtool_eee *eee = &bp->eee;
 	struct bnxt_link_info *link_info = &bp->link_info;
 
-	if (!(bp->flags & BNXT_FLAG_EEE_CAP))
+	if (!(bp->phy_flags & BNXT_PHY_FL_EEE_CAP))
 		return true;
 
 	if (eee->eee_enabled) {
@@ -12450,6 +12432,7 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
 	int rc = 0;
 	struct bnxt_link_info *link_info = &bp->link_info;
 
+	bp->phy_flags = 0;
 	rc = bnxt_hwrm_phy_qcaps(bp);
 	if (rc) {
 		netdev_err(bp->dev, "Probe phy can't get phy capabilities (rc: %x)\n",
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 29061c577baa..6c4fb78c59fe 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1341,9 +1341,6 @@ struct bnxt_led_info {
 
 struct bnxt_test_info {
 	u8 offline_mask;
-	u8 flags;
-#define BNXT_TEST_FL_EXT_LPBK		0x1
-#define BNXT_TEST_FL_AN_PHY_LPBK	0x2
 	u16 timeout;
 	char string[BNXT_MAX_TEST][ETH_GSTRING_LEN];
 };
@@ -1693,7 +1690,6 @@ struct bnxt {
 	#define BNXT_FLAG_SHARED_RINGS	0x200
 	#define BNXT_FLAG_PORT_STATS	0x400
 	#define BNXT_FLAG_UDP_RSS_CAP	0x800
-	#define BNXT_FLAG_EEE_CAP	0x1000
 	#define BNXT_FLAG_NEW_RSS_CAP	0x2000
 	#define BNXT_FLAG_WOL_CAP	0x4000
 	#define BNXT_FLAG_ROCEV1_CAP	0x8000
@@ -1720,8 +1716,10 @@ struct bnxt {
 #define BNXT_NPAR(bp)		((bp)->port_partition_type)
 #define BNXT_MH(bp)		((bp)->flags & BNXT_FLAG_MULTI_HOST)
 #define BNXT_SINGLE_PF(bp)	(BNXT_PF(bp) && !BNXT_NPAR(bp) && !BNXT_MH(bp))
+#define BNXT_SH_PORT_CFG_OK(bp)	(BNXT_PF(bp) &&				\
+				 ((bp)->phy_flags & BNXT_PHY_FL_SHARED_PORT_CFG))
 #define BNXT_PHY_CFG_ABLE(bp)	((BNXT_SINGLE_PF(bp) ||			\
-				  ((bp)->fw_cap & BNXT_FW_CAP_SHARED_PORT_CFG)) && \
+				  BNXT_SH_PORT_CFG_OK(bp)) &&		\
 				 (bp)->link_info.phy_state == BNXT_PHY_STATE_ENABLED)
 #define BNXT_CHIP_TYPE_NITRO_A0(bp) ((bp)->flags & BNXT_FLAG_CHIP_NITRO_A0)
 #define BNXT_RX_PAGE_MODE(bp)	((bp)->flags & BNXT_FLAG_RX_PAGE_MODE)
@@ -1871,11 +1869,9 @@ struct bnxt {
 	#define BNXT_FW_CAP_EXT_STATS_SUPPORTED		0x00040000
 	#define BNXT_FW_CAP_ERR_RECOVER_RELOAD		0x00100000
 	#define BNXT_FW_CAP_HOT_RESET			0x00200000
-	#define BNXT_FW_CAP_SHARED_PORT_CFG		0x00400000
 	#define BNXT_FW_CAP_VLAN_RX_STRIP		0x01000000
 	#define BNXT_FW_CAP_VLAN_TX_INSERT		0x02000000
 	#define BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED	0x04000000
-	#define BNXT_FW_CAP_PORT_STATS_NO_RESET		0x10000000
 	#define BNXT_FW_CAP_RING_MONITOR		0x40000000
 
 #define BNXT_NEW_RM(bp)		((bp)->fw_cap & BNXT_FW_CAP_NEW_RM)
@@ -2010,6 +2006,15 @@ struct bnxt {
 	u32			lpi_tmr_lo;
 	u32			lpi_tmr_hi;
 
+	/* copied from flags in hwrm_port_phy_qcaps_output */
+	u8			phy_flags;
+#define BNXT_PHY_FL_EEE_CAP		PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED
+#define BNXT_PHY_FL_EXT_LPBK		PORT_PHY_QCAPS_RESP_FLAGS_EXTERNAL_LPBK_SUPPORTED
+#define BNXT_PHY_FL_AN_PHY_LPBK		PORT_PHY_QCAPS_RESP_FLAGS_AUTONEG_LPBK_SUPPORTED
+#define BNXT_PHY_FL_SHARED_PORT_CFG	PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED
+#define BNXT_PHY_FL_PORT_STATS_NO_RESET	PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET
+#define BNXT_PHY_FL_NO_PHY_LPBK		PORT_PHY_QCAPS_RESP_FLAGS_LOCAL_LPBK_NOT_SUPPORTED
+
 	u8			num_tests;
 	struct bnxt_test_info	*test_info;
 
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 3b66e300c962..c664ec52ebcf 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2912,7 +2912,7 @@ static int bnxt_set_eee(struct net_device *dev, struct ethtool_eee *edata)
 	if (!BNXT_PHY_CFG_ABLE(bp))
 		return -EOPNOTSUPP;
 
-	if (!(bp->flags & BNXT_FLAG_EEE_CAP))
+	if (!(bp->phy_flags & BNXT_PHY_FL_EEE_CAP))
 		return -EOPNOTSUPP;
 
 	mutex_lock(&bp->link_lock);
@@ -2963,7 +2963,7 @@ static int bnxt_get_eee(struct net_device *dev, struct ethtool_eee *edata)
 {
 	struct bnxt *bp = netdev_priv(dev);
 
-	if (!(bp->flags & BNXT_FLAG_EEE_CAP))
+	if (!(bp->phy_flags & BNXT_PHY_FL_EEE_CAP))
 		return -EOPNOTSUPP;
 
 	*edata = bp->eee;
@@ -3215,7 +3215,7 @@ static int bnxt_disable_an_for_lpbk(struct bnxt *bp,
 	int rc;
 
 	if (!link_info->autoneg ||
-	    (bp->test_info->flags & BNXT_TEST_FL_AN_PHY_LPBK))
+	    (bp->phy_flags & BNXT_PHY_FL_AN_PHY_LPBK))
 		return 0;
 
 	rc = bnxt_query_force_speeds(bp, &fw_advertising);
@@ -3416,7 +3416,7 @@ static void bnxt_self_test(struct net_device *dev, struct ethtool_test *etest,
 	}
 
 	if ((etest->flags & ETH_TEST_FL_EXTERNAL_LB) &&
-	    (bp->test_info->flags & BNXT_TEST_FL_EXT_LPBK))
+	    (bp->phy_flags & BNXT_PHY_FL_EXT_LPBK))
 		do_ext_lpbk = true;
 
 	if (etest->flags & ETH_TEST_FL_OFFLINE) {
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 03/10] bnxt_en: Add support for fw managed link down feature.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 01/10] bnxt_en: report signal mode in link up messages Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 02/10] bnxt_en: Add a new phy_flags field to the main driver structure Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 04/10] bnxt_en: allow promiscuous mode for trusted VFs Michael Chan
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

In the current code, the driver will not shutdown the link during
IFDOWN if there are still VFs sharing the port.  Newer firmware will
manage the link down decision when the port is shared by VFs, so
we can just call firmware to shutdown the port unconditionally and
let firmware make the final decision.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f08427b7dbe7..dcf1598afac2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9495,7 +9495,8 @@ static int bnxt_hwrm_shutdown_link(struct bnxt *bp)
 	if (!BNXT_SINGLE_PF(bp))
 		return 0;
 
-	if (pci_num_vf(bp->pdev))
+	if (pci_num_vf(bp->pdev) &&
+	    !(bp->phy_flags & BNXT_PHY_FL_FW_MANAGED_LKDN))
 		return 0;
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_PORT_PHY_CFG, -1, -1);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 6c4fb78c59fe..5835d8ca8c22 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2014,6 +2014,7 @@ struct bnxt {
 #define BNXT_PHY_FL_SHARED_PORT_CFG	PORT_PHY_QCAPS_RESP_FLAGS_SHARED_PHY_CFG_SUPPORTED
 #define BNXT_PHY_FL_PORT_STATS_NO_RESET	PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET
 #define BNXT_PHY_FL_NO_PHY_LPBK		PORT_PHY_QCAPS_RESP_FLAGS_LOCAL_LPBK_NOT_SUPPORTED
+#define BNXT_PHY_FL_FW_MANAGED_LKDN	PORT_PHY_QCAPS_RESP_FLAGS_FW_MANAGED_LINK_DOWN
 
 	u8			num_tests;
 	struct bnxt_test_info	*test_info;
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 04/10] bnxt_en: allow promiscuous mode for trusted VFs
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (2 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 03/10] bnxt_en: Add support for fw managed link down feature Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 05/10] bnxt_en: allow VF config ops when PF is closed Michael Chan
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 4675 bytes --]

From: Edwin Peer <edwin.peer@broadcom.com>

Firmware previously only allowed promiscuous mode for VFs associated with
a default VLAN. It is now possible to enable promiscuous mode for a VF
having no VLAN configured provided that it is trusted. In such cases the
VF will see all packets received by the PF, irrespective of destination
MAC or VLAN.

Note, it is necessary to query firmware at the time of bnxt_promisc_ok()
instead of in bnxt_hwrm_func_qcfg() because the trusted status might be
altered by the PF after the VF has been configured. This check must now
also be deferred because the firmware call sleeps.

Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c       | 11 +++++++----
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c |  6 +++---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h |  1 +
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index dcf1598afac2..9862f517960d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8340,11 +8340,11 @@ static int bnxt_alloc_rfs_vnics(struct bnxt *bp)
 #endif
 }
 
-/* Allow PF and VF with default VLAN to be in promiscuous mode */
+/* Allow PF, trusted VFs and VFs with default VLAN to be in promiscuous mode */
 static bool bnxt_promisc_ok(struct bnxt *bp)
 {
 #ifdef CONFIG_BNXT_SRIOV
-	if (BNXT_VF(bp) && !bp->vf.vlan)
+	if (BNXT_VF(bp) && !bp->vf.vlan && !bnxt_is_trusted_vf(bp, &bp->vf))
 		return false;
 #endif
 	return true;
@@ -8441,7 +8441,7 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
 	if (bp->dev->flags & IFF_BROADCAST)
 		vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_BCAST;
 
-	if ((bp->dev->flags & IFF_PROMISC) && bnxt_promisc_ok(bp))
+	if (bp->dev->flags & IFF_PROMISC)
 		vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS;
 
 	if (bp->dev->flags & IFF_ALLMULTI) {
@@ -10485,7 +10485,7 @@ static void bnxt_set_rx_mode(struct net_device *dev)
 		  CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST |
 		  CFA_L2_SET_RX_MASK_REQ_MASK_BCAST);
 
-	if ((dev->flags & IFF_PROMISC) && bnxt_promisc_ok(bp))
+	if (dev->flags & IFF_PROMISC)
 		mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS;
 
 	uc_update = bnxt_uc_list_updated(bp);
@@ -10561,6 +10561,9 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp)
 	}
 
 skip_uc:
+	if ((vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS) &&
+	    !bnxt_promisc_ok(bp))
+		vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS;
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
 	if (rc && vnic->mc_list_count) {
 		netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n",
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index a217316228f4..4da52f812585 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -113,7 +113,7 @@ static int bnxt_hwrm_func_qcfg_flags(struct bnxt *bp, struct bnxt_vf_info *vf)
 	int rc;
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QCFG, -1, -1);
-	req.fid = cpu_to_le16(vf->fw_fid);
+	req.fid = cpu_to_le16(BNXT_PF(bp) ? vf->fw_fid : 0xffff);
 	mutex_lock(&bp->hwrm_cmd_lock);
 	rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
 	if (rc) {
@@ -125,9 +125,9 @@ static int bnxt_hwrm_func_qcfg_flags(struct bnxt *bp, struct bnxt_vf_info *vf)
 	return 0;
 }
 
-static bool bnxt_is_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf)
+bool bnxt_is_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf)
 {
-	if (!(bp->fw_cap & BNXT_FW_CAP_TRUSTED_VF))
+	if (BNXT_PF(bp) && !(bp->fw_cap & BNXT_FW_CAP_TRUSTED_VF))
 		return !!(vf->flags & BNXT_VF_TRUST);
 
 	bnxt_hwrm_func_qcfg_flags(bp, vf);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
index 629641bf6fc5..995535e4c11b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.h
@@ -34,6 +34,7 @@ int bnxt_set_vf_vlan(struct net_device *, int, u16, u8, __be16);
 int bnxt_set_vf_bw(struct net_device *, int, int, int);
 int bnxt_set_vf_link_state(struct net_device *, int, int);
 int bnxt_set_vf_spoofchk(struct net_device *, int, bool);
+bool bnxt_is_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf);
 int bnxt_set_vf_trust(struct net_device *dev, int vf_id, bool trust);
 int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
 int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset);
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 05/10] bnxt_en: allow VF config ops when PF is closed
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (3 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 04/10] bnxt_en: allow promiscuous mode for trusted VFs Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 06/10] bnxt_en: Move bnxt_approve_mac() Michael Chan
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

From: Edwin Peer <edwin.peer@broadcom.com>

It is perfectly legal for the stack to query and configure VFs via PF
NDOs while the NIC is administratively down.  Remove the unnecessary
check for the PF to be in open state.

Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 4da52f812585..67856dbf9ce9 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -49,10 +49,6 @@ static int bnxt_hwrm_fwd_async_event_cmpl(struct bnxt *bp,
 
 static int bnxt_vf_ndo_prep(struct bnxt *bp, int vf_id)
 {
-	if (!test_bit(BNXT_STATE_OPEN, &bp->state)) {
-		netdev_err(bp->dev, "vf ndo called though PF is down\n");
-		return -EINVAL;
-	}
 	if (!bp->pf.active_vfs) {
 		netdev_err(bp->dev, "vf ndo called though sriov is disabled\n");
 		return -EINVAL;
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 06/10] bnxt_en: Move bnxt_approve_mac().
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (4 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 05/10] bnxt_en: allow VF config ops when PF is closed Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 07/10] bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC Michael Chan
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 2436 bytes --]

Move it before bnxt_update_vf_mac().  In the next patch, we need to call
bnxt_approve_mac() from bnxt_update_mac() under some conditions.  This
will avoid forward declaration.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   | 53 ++++++++++---------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 67856dbf9ce9..e65093f4aa7a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -1116,6 +1116,33 @@ void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
 	}
 }
 
+int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
+{
+	struct hwrm_func_vf_cfg_input req = {0};
+	int rc = 0;
+
+	if (!BNXT_VF(bp))
+		return 0;
+
+	if (bp->hwrm_spec_code < 0x10202) {
+		if (is_valid_ether_addr(bp->vf.mac_addr))
+			rc = -EADDRNOTAVAIL;
+		goto mac_done;
+	}
+	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_CFG, -1, -1);
+	req.enables = cpu_to_le32(FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
+	memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
+	rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
+mac_done:
+	if (rc && strict) {
+		rc = -EADDRNOTAVAIL;
+		netdev_warn(bp->dev, "VF MAC address %pM not approved by the PF\n",
+			    mac);
+		return rc;
+	}
+	return 0;
+}
+
 void bnxt_update_vf_mac(struct bnxt *bp)
 {
 	struct hwrm_func_qcaps_input req = {0};
@@ -1145,32 +1172,6 @@ void bnxt_update_vf_mac(struct bnxt *bp)
 	mutex_unlock(&bp->hwrm_cmd_lock);
 }
 
-int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
-{
-	struct hwrm_func_vf_cfg_input req = {0};
-	int rc = 0;
-
-	if (!BNXT_VF(bp))
-		return 0;
-
-	if (bp->hwrm_spec_code < 0x10202) {
-		if (is_valid_ether_addr(bp->vf.mac_addr))
-			rc = -EADDRNOTAVAIL;
-		goto mac_done;
-	}
-	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_CFG, -1, -1);
-	req.enables = cpu_to_le32(FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
-	memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
-	rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
-mac_done:
-	if (rc && strict) {
-		rc = -EADDRNOTAVAIL;
-		netdev_warn(bp->dev, "VF MAC address %pM not approved by the PF\n",
-			    mac);
-		return rc;
-	}
-	return 0;
-}
 #else
 
 int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset)
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 07/10] bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (5 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 06/10] bnxt_en: Move bnxt_approve_mac() Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 08/10] bnxt_en: Add PCI IDs for Hyper-V VF devices Michael Chan
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

When the PF is no longer enforcing an assigned MAC address on a VF, the
VF needs to call bnxt_approve_mac() to tell the PF what MAC address it is
now using.  Otherwise it gets out of sync and the PF won't know what
MAC address the VF wants to use.  Ultimately the VF will fail when it
tries to setup the L2 MAC filter for the vnic.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index e65093f4aa7a..eb00a219aa51 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -1147,6 +1147,7 @@ void bnxt_update_vf_mac(struct bnxt *bp)
 {
 	struct hwrm_func_qcaps_input req = {0};
 	struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
+	bool inform_pf = false;
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_QCAPS, -1, -1);
 	req.fid = cpu_to_le16(0xffff);
@@ -1162,14 +1163,22 @@ void bnxt_update_vf_mac(struct bnxt *bp)
 	 *    default but the stored zero MAC will allow the VF user to change
 	 *    the random MAC address using ndo_set_mac_address() if he wants.
 	 */
-	if (!ether_addr_equal(resp->mac_address, bp->vf.mac_addr))
+	if (!ether_addr_equal(resp->mac_address, bp->vf.mac_addr)) {
 		memcpy(bp->vf.mac_addr, resp->mac_address, ETH_ALEN);
+		/* This means we are now using our own MAC address, let
+		 * the PF know about this MAC address.
+		 */
+		if (!is_valid_ether_addr(bp->vf.mac_addr))
+			inform_pf = true;
+	}
 
 	/* overwrite netdev dev_addr with admin VF MAC */
 	if (is_valid_ether_addr(bp->vf.mac_addr))
 		memcpy(bp->dev->dev_addr, bp->vf.mac_addr, ETH_ALEN);
 update_vf_mac_exit:
 	mutex_unlock(&bp->hwrm_cmd_lock);
+	if (inform_pf)
+		bnxt_approve_mac(bp, bp->dev->dev_addr, false);
 }
 
 #else
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 08/10] bnxt_en: Add PCI IDs for Hyper-V VF devices.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (6 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 07/10] bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 09/10] bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS Michael Chan
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 3581 bytes --]

Support VF device IDs used by the Hyper-V hypervisor.

Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 9862f517960d..77ebafbd2dce 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -122,7 +122,10 @@ enum board_idx {
 	NETXTREME_E_VF,
 	NETXTREME_C_VF,
 	NETXTREME_S_VF,
+	NETXTREME_C_VF_HV,
+	NETXTREME_E_VF_HV,
 	NETXTREME_E_P5_VF,
+	NETXTREME_E_P5_VF_HV,
 };
 
 /* indexed by enum above */
@@ -170,7 +173,10 @@ static const struct {
 	[NETXTREME_E_VF] = { "Broadcom NetXtreme-E Ethernet Virtual Function" },
 	[NETXTREME_C_VF] = { "Broadcom NetXtreme-C Ethernet Virtual Function" },
 	[NETXTREME_S_VF] = { "Broadcom NetXtreme-S Ethernet Virtual Function" },
+	[NETXTREME_C_VF_HV] = { "Broadcom NetXtreme-C Virtual Function for Hyper-V" },
+	[NETXTREME_E_VF_HV] = { "Broadcom NetXtreme-E Virtual Function for Hyper-V" },
 	[NETXTREME_E_P5_VF] = { "Broadcom BCM5750X NetXtreme-E Ethernet Virtual Function" },
+	[NETXTREME_E_P5_VF_HV] = { "Broadcom BCM5750X NetXtreme-E Virtual Function for Hyper-V" },
 };
 
 static const struct pci_device_id bnxt_pci_tbl[] = {
@@ -222,15 +228,25 @@ static const struct pci_device_id bnxt_pci_tbl[] = {
 	{ PCI_VDEVICE(BROADCOM, 0xd804), .driver_data = BCM58804 },
 #ifdef CONFIG_BNXT_SRIOV
 	{ PCI_VDEVICE(BROADCOM, 0x1606), .driver_data = NETXTREME_E_VF },
+	{ PCI_VDEVICE(BROADCOM, 0x1607), .driver_data = NETXTREME_E_VF_HV },
+	{ PCI_VDEVICE(BROADCOM, 0x1608), .driver_data = NETXTREME_E_VF_HV },
 	{ PCI_VDEVICE(BROADCOM, 0x1609), .driver_data = NETXTREME_E_VF },
+	{ PCI_VDEVICE(BROADCOM, 0x16bd), .driver_data = NETXTREME_E_VF_HV },
 	{ PCI_VDEVICE(BROADCOM, 0x16c1), .driver_data = NETXTREME_E_VF },
+	{ PCI_VDEVICE(BROADCOM, 0x16c2), .driver_data = NETXTREME_C_VF_HV },
+	{ PCI_VDEVICE(BROADCOM, 0x16c3), .driver_data = NETXTREME_C_VF_HV },
+	{ PCI_VDEVICE(BROADCOM, 0x16c4), .driver_data = NETXTREME_E_VF_HV },
+	{ PCI_VDEVICE(BROADCOM, 0x16c5), .driver_data = NETXTREME_E_VF_HV },
 	{ PCI_VDEVICE(BROADCOM, 0x16cb), .driver_data = NETXTREME_C_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x16d3), .driver_data = NETXTREME_E_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x16dc), .driver_data = NETXTREME_E_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x16e1), .driver_data = NETXTREME_C_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x16e5), .driver_data = NETXTREME_C_VF },
+	{ PCI_VDEVICE(BROADCOM, 0x16e6), .driver_data = NETXTREME_C_VF_HV },
 	{ PCI_VDEVICE(BROADCOM, 0x1806), .driver_data = NETXTREME_E_P5_VF },
 	{ PCI_VDEVICE(BROADCOM, 0x1807), .driver_data = NETXTREME_E_P5_VF },
+	{ PCI_VDEVICE(BROADCOM, 0x1808), .driver_data = NETXTREME_E_P5_VF_HV },
+	{ PCI_VDEVICE(BROADCOM, 0x1809), .driver_data = NETXTREME_E_P5_VF_HV },
 	{ PCI_VDEVICE(BROADCOM, 0xd800), .driver_data = NETXTREME_S_VF },
 #endif
 	{ 0 }
@@ -265,7 +281,8 @@ static struct workqueue_struct *bnxt_pf_wq;
 static bool bnxt_vf_pciid(enum board_idx idx)
 {
 	return (idx == NETXTREME_C_VF || idx == NETXTREME_E_VF ||
-		idx == NETXTREME_S_VF || idx == NETXTREME_E_P5_VF);
+		idx == NETXTREME_S_VF || idx == NETXTREME_C_VF_HV ||
+		idx == NETXTREME_E_VF_HV || idx == NETXTREME_E_P5_VF);
 }
 
 #define DB_CP_REARM_FLAGS	(DB_KEY_CP | DB_IDX_VALID)
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 09/10] bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (7 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 08/10] bnxt_en: Add PCI IDs for Hyper-V VF devices Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-25 17:45 ` [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check() Michael Chan
  2021-04-26  2:00 ` [PATCH net-next v2 00/10] bnxt_en: Updates for net-next patchwork-bot+netdevbpf
  10 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 3298 bytes --]

If firmware is capable, set the IFF_SUPP_NOFCS flag to support the
sockets option to transmit packets without FCS.  This is mainly used
for testing.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 16 +++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  1 +
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 77ebafbd2dce..53db073b457c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -375,6 +375,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct pci_dev *pdev = bp->pdev;
 	struct bnxt_tx_ring_info *txr;
 	struct bnxt_sw_tx_bd *tx_buf;
+	__le32 lflags = 0;
 
 	i = skb_get_queue_mapping(skb);
 	if (unlikely(i >= bp->tx_nr_rings)) {
@@ -416,6 +417,11 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 			vlan_tag_flags |= 1 << TX_BD_CFA_META_TPID_SHIFT;
 	}
 
+	if (unlikely(skb->no_fcs)) {
+		lflags |= cpu_to_le32(TX_BD_FLAGS_NO_CRC);
+		goto normal_tx;
+	}
+
 	if (free_size == bp->tx_ring_size && length <= bp->tx_push_thresh) {
 		struct tx_push_buffer *tx_push_buf = txr->tx_push;
 		struct tx_push_bd *tx_push = &tx_push_buf->push_bd;
@@ -517,7 +523,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	txbd1 = (struct tx_bd_ext *)
 		&txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)];
 
-	txbd1->tx_bd_hsize_lflags = 0;
+	txbd1->tx_bd_hsize_lflags = lflags;
 	if (skb_is_gso(skb)) {
 		u32 hdr_len;
 
@@ -529,14 +535,14 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 			hdr_len = skb_transport_offset(skb) +
 				tcp_hdrlen(skb);
 
-		txbd1->tx_bd_hsize_lflags = cpu_to_le32(TX_BD_FLAGS_LSO |
+		txbd1->tx_bd_hsize_lflags |= cpu_to_le32(TX_BD_FLAGS_LSO |
 					TX_BD_FLAGS_T_IPID |
 					(hdr_len << (TX_BD_HSIZE_SHIFT - 1)));
 		length = skb_shinfo(skb)->gso_size;
 		txbd1->tx_bd_mss = cpu_to_le32(length);
 		length += hdr_len;
 	} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		txbd1->tx_bd_hsize_lflags =
+		txbd1->tx_bd_hsize_lflags |=
 			cpu_to_le32(TX_BD_FLAGS_TCP_UDP_CHKSUM);
 		txbd1->tx_bd_mss = 0;
 	}
@@ -12460,6 +12466,10 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
 			   rc);
 		return rc;
 	}
+	if (bp->phy_flags & BNXT_PHY_FL_NO_FCS)
+		bp->dev->priv_flags |= IFF_SUPP_NOFCS;
+	else
+		bp->dev->priv_flags &= ~IFF_SUPP_NOFCS;
 	if (!fw_dflt)
 		return 0;
 
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 5835d8ca8c22..a3744247740b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2015,6 +2015,7 @@ struct bnxt {
 #define BNXT_PHY_FL_PORT_STATS_NO_RESET	PORT_PHY_QCAPS_RESP_FLAGS_CUMULATIVE_COUNTERS_ON_RESET
 #define BNXT_PHY_FL_NO_PHY_LPBK		PORT_PHY_QCAPS_RESP_FLAGS_LOCAL_LPBK_NOT_SUPPORTED
 #define BNXT_PHY_FL_FW_MANAGED_LKDN	PORT_PHY_QCAPS_RESP_FLAGS_FW_MANAGED_LINK_DOWN
+#define BNXT_PHY_FL_NO_FCS		PORT_PHY_QCAPS_RESP_FLAGS_NO_FCS
 
 	u8			num_tests;
 	struct bnxt_test_info	*test_info;
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (8 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 09/10] bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS Michael Chan
@ 2021-04-25 17:45 ` Michael Chan
  2021-04-26 16:29   ` Jakub Kicinski
  2021-04-26  2:00 ` [PATCH net-next v2 00/10] bnxt_en: Updates for net-next patchwork-bot+netdevbpf
  10 siblings, 1 reply; 21+ messages in thread
From: Michael Chan @ 2021-04-25 17:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]

For UDP encapsultions, we only support the offloaded Vxlan port and
Geneve port.  All other ports included FOU and GUE are not supported so
we need to turn off TSO and checksum features.

v2: Reverse the check for supported UDP ports to be more straight forward.

Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 42 +++++++++++++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  2 ++
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 53db073b457c..5d0ab5629aa4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10781,6 +10781,40 @@ static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
 	return rc;
 }
 
+static netdev_features_t bnxt_features_check(struct sk_buff *skb,
+					     struct net_device *dev,
+					     netdev_features_t features)
+{
+	struct bnxt *bp;
+	__be16 udp_port;
+	u8 l4_proto = 0;
+
+	features = vlan_features_check(skb, features);
+	if (!skb->encapsulation)
+		return features;
+
+	switch (vlan_get_protocol(skb)) {
+	case htons(ETH_P_IP):
+		l4_proto = ip_hdr(skb)->protocol;
+		break;
+	case htons(ETH_P_IPV6):
+		l4_proto = ipv6_hdr(skb)->nexthdr;
+		break;
+	default:
+		return features;
+	}
+
+	if (l4_proto != IPPROTO_UDP)
+		return features;
+
+	bp = netdev_priv(dev);
+	/* For UDP, we can only handle 1 Vxlan port and 1 Geneve port. */
+	udp_port = udp_hdr(skb)->dest;
+	if (udp_port == bp->vxlan_port || udp_port == bp->nge_port)
+		return features;
+	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
+}
+
 int bnxt_dbg_hwrm_rd_reg(struct bnxt *bp, u32 reg_off, u16 num_words,
 			 u32 *reg_buf)
 {
@@ -12288,10 +12322,13 @@ static int bnxt_udp_tunnel_sync(struct net_device *netdev, unsigned int table)
 	unsigned int cmd;
 
 	udp_tunnel_nic_get_port(netdev, table, 0, &ti);
-	if (ti.type == UDP_TUNNEL_TYPE_VXLAN)
+	if (ti.type == UDP_TUNNEL_TYPE_VXLAN) {
+		bp->vxlan_port = ti.port;
 		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
-	else
+	} else {
+		bp->nge_port = ti.port;
 		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
+	}
 
 	if (ti.port)
 		return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti.port, cmd);
@@ -12391,6 +12428,7 @@ static const struct net_device_ops bnxt_netdev_ops = {
 	.ndo_change_mtu		= bnxt_change_mtu,
 	.ndo_fix_features	= bnxt_fix_features,
 	.ndo_set_features	= bnxt_set_features,
+	.ndo_features_check	= bnxt_features_check,
 	.ndo_tx_timeout		= bnxt_tx_timeout,
 #ifdef CONFIG_BNXT_SRIOV
 	.ndo_get_vf_config	= bnxt_get_vf_config,
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index a3744247740b..24d2ad6a8740 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1914,6 +1914,8 @@ struct bnxt {
 
 	u16			vxlan_fw_dst_port_id;
 	u16			nge_fw_dst_port_id;
+	__be16			vxlan_port;
+	__be16			nge_port;
 	u8			port_partition_type;
 	u8			port_count;
 	u16			br_mode;
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 00/10] bnxt_en: Updates for net-next.
  2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
                   ` (9 preceding siblings ...)
  2021-04-25 17:45 ` [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check() Michael Chan
@ 2021-04-26  2:00 ` patchwork-bot+netdevbpf
  10 siblings, 0 replies; 21+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-26  2:00 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, gospo

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Sun, 25 Apr 2021 13:45:17 -0400 you wrote:
> This series includes these main enhancements:
> 
> 1. Link related changes
>     - add NRZ/PAM4 link signal mode to the link up message if known
>     - rely on firmware to bring down the link during ifdown
> 
> 2. SRIOV related changes
>     - allow VF promiscuous mode if the VF is trusted
>     - allow ndo operations to configure VF when the PF is ifdown
>     - fix the scenario of the VF taking back control of it's MAC address
>     - add Hyper-V VF device IDs
> 
> [...]

Here is the summary with links:
  - [net-next,v2,01/10] bnxt_en: report signal mode in link up messages
    https://git.kernel.org/netdev/net-next/c/1d2deb61f095
  - [net-next,v2,02/10] bnxt_en: Add a new phy_flags field to the main driver structure.
    https://git.kernel.org/netdev/net-next/c/b0d28207ced8
  - [net-next,v2,03/10] bnxt_en: Add support for fw managed link down feature.
    https://git.kernel.org/netdev/net-next/c/d5ca99054f8e
  - [net-next,v2,04/10] bnxt_en: allow promiscuous mode for trusted VFs
    https://git.kernel.org/netdev/net-next/c/dd85fc0ab5b4
  - [net-next,v2,05/10] bnxt_en: allow VF config ops when PF is closed
    https://git.kernel.org/netdev/net-next/c/6b7027689890
  - [net-next,v2,06/10] bnxt_en: Move bnxt_approve_mac().
    https://git.kernel.org/netdev/net-next/c/7b3c8e27d67e
  - [net-next,v2,07/10] bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC.
    https://git.kernel.org/netdev/net-next/c/92923cc71012
  - [net-next,v2,08/10] bnxt_en: Add PCI IDs for Hyper-V VF devices.
    https://git.kernel.org/netdev/net-next/c/7fbf359bb2c1
  - [net-next,v2,09/10] bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS.
    https://git.kernel.org/netdev/net-next/c/dade5e15fade
  - [net-next,v2,10/10] bnxt_en: Implement .ndo_features_check().
    https://git.kernel.org/netdev/net-next/c/1698d600b361

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-25 17:45 ` [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check() Michael Chan
@ 2021-04-26 16:29   ` Jakub Kicinski
  2021-04-26 16:35     ` Michael Chan
  0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2021-04-26 16:29 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, gospo

On Sun, 25 Apr 2021 13:45:27 -0400 Michael Chan wrote:
> +	if (l4_proto != IPPROTO_UDP)
> +		return features;

This should have been "features & ~(CSUM | GSO)" if you actually
accepted my feedback. I mentioned extension headers as an example, 
v2 looks like a minor refactoring, no functional changes :/

> +	bp = netdev_priv(dev);
> +	/* For UDP, we can only handle 1 Vxlan port and 1 Geneve port. */
> +	udp_port = udp_hdr(skb)->dest;
> +	if (udp_port == bp->vxlan_port || udp_port == bp->nge_port)
> +		return features;
> +	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 16:29   ` Jakub Kicinski
@ 2021-04-26 16:35     ` Michael Chan
  2021-04-26 16:45       ` Michael Chan
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Chan @ 2021-04-26 16:35 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David Miller, Netdev, Andrew Gospodarek

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

On Mon, Apr 26, 2021 at 9:29 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Sun, 25 Apr 2021 13:45:27 -0400 Michael Chan wrote:
> > +     if (l4_proto != IPPROTO_UDP)
> > +             return features;
>
> This should have been "features & ~(CSUM | GSO)" if you actually
> accepted my feedback. I mentioned extension headers as an example,
> v2 looks like a minor refactoring, no functional changes :/
>
> > +     bp = netdev_priv(dev);
> > +     /* For UDP, we can only handle 1 Vxlan port and 1 Geneve port. */
> > +     udp_port = udp_hdr(skb)->dest;
> > +     if (udp_port == bp->vxlan_port || udp_port == bp->nge_port)
> > +             return features;
> > +     return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 16:35     ` Michael Chan
@ 2021-04-26 16:45       ` Michael Chan
  2021-04-26 17:00         ` Jakub Kicinski
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Chan @ 2021-04-26 16:45 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David Miller, Netdev, Andrew Gospodarek

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Mon, Apr 26, 2021 at 9:35 AM Michael Chan <michael.chan@broadcom.com> wrote:
>
> On Mon, Apr 26, 2021 at 9:29 AM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > On Sun, 25 Apr 2021 13:45:27 -0400 Michael Chan wrote:
> > > +     if (l4_proto != IPPROTO_UDP)
> > > +             return features;
> >
> > This should have been "features & ~(CSUM | GSO)" if you actually
> > accepted my feedback.

Sorry, hit send too early.  If it is not UDP, it could be GRE or IP
over IP for example, right?  Why do we need to turn off offload?

> I mentioned extension headers as an example,

Extension headers (Geneve for example) are supported.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 16:45       ` Michael Chan
@ 2021-04-26 17:00         ` Jakub Kicinski
  2021-04-26 17:09           ` Michael Chan
  0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2021-04-26 17:00 UTC (permalink / raw)
  To: Michael Chan; +Cc: David Miller, Netdev, Andrew Gospodarek

On Mon, 26 Apr 2021 09:45:17 -0700 Michael Chan wrote:
> On Mon, Apr 26, 2021 at 9:35 AM Michael Chan <michael.chan@broadcom.com> wrote:
> > On Mon, Apr 26, 2021 at 9:29 AM Jakub Kicinski <kuba@kernel.org> wrote:  
> > > On Sun, 25 Apr 2021 13:45:27 -0400 Michael Chan wrote:  
> > > This should have been "features & ~(CSUM | GSO)" if you actually
> > > accepted my feedback.  
> 
> Sorry, hit send too early.  If it is not UDP, it could be GRE or IP
> over IP for example, right?  Why do we need to turn off offload?

All supported protocols can be included in the allow list.
That's one of the costs of NETIF_F_IP_CSUM, the driver needs 
to make sure the device can understand the packet.

> > I mentioned extension headers as an example,  
> 
> Extension headers (Geneve for example) are supported.

I thought the Geneve things were called options. I meant IPv6 extension
headers, which the device may also support, but then the right thing to
do is something like a call to ipv6_skip_exthdr() to retrieve the L4
proto.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 17:00         ` Jakub Kicinski
@ 2021-04-26 17:09           ` Michael Chan
  2021-04-26 17:36             ` Jakub Kicinski
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Chan @ 2021-04-26 17:09 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David Miller, Netdev, Andrew Gospodarek

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

On Mon, Apr 26, 2021 at 10:00 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 26 Apr 2021 09:45:17 -0700 Michael Chan wrote:
> > On Mon, Apr 26, 2021 at 9:35 AM Michael Chan <michael.chan@broadcom.com> wrote:
> > > On Mon, Apr 26, 2021 at 9:29 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > > > On Sun, 25 Apr 2021 13:45:27 -0400 Michael Chan wrote:
> > > > This should have been "features & ~(CSUM | GSO)" if you actually
> > > > accepted my feedback.
> >
> > Sorry, hit send too early.  If it is not UDP, it could be GRE or IP
> > over IP for example, right?  Why do we need to turn off offload?
>
> All supported protocols can be included in the allow list.
> That's one of the costs of NETIF_F_IP_CSUM, the driver needs
> to make sure the device can understand the packet.

Only UDP encapsulations have the 2 port limitations.  The rest are supported.

>
> > > I mentioned extension headers as an example,
> >
> > Extension headers (Geneve for example) are supported.
>
> I thought the Geneve things were called options. I meant IPv6 extension
> headers, which the device may also support, but then the right thing to
> do is something like a call to ipv6_skip_exthdr() to retrieve the L4
> proto.

You're right and I misunderstood you.  I will double check for ipv6
extension headers support and will send a follow up patch.  Thanks.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 17:09           ` Michael Chan
@ 2021-04-26 17:36             ` Jakub Kicinski
  2021-04-26 17:52               ` Michael Chan
  0 siblings, 1 reply; 21+ messages in thread
From: Jakub Kicinski @ 2021-04-26 17:36 UTC (permalink / raw)
  To: Michael Chan; +Cc: David Miller, Netdev, Andrew Gospodarek

On Mon, 26 Apr 2021 10:09:29 -0700 Michael Chan wrote:
> On Mon, Apr 26, 2021 at 10:00 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > On Mon, 26 Apr 2021 09:45:17 -0700 Michael Chan wrote:  
> > > Sorry, hit send too early.  If it is not UDP, it could be GRE or IP
> > > over IP for example, right?  Why do we need to turn off offload?  
> >
> > All supported protocols can be included in the allow list.
> > That's one of the costs of NETIF_F_IP_CSUM, the driver needs
> > to make sure the device can understand the packet.  
> 
> Only UDP encapsulations have the 2 port limitations.  The rest are supported.

AFAIU you claim that other than certain UDP formats your device can
parse _every_ possible packet encapsulation. To which I have no reply.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check().
  2021-04-26 17:36             ` Jakub Kicinski
@ 2021-04-26 17:52               ` Michael Chan
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Chan @ 2021-04-26 17:52 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David Miller, Netdev, Andrew Gospodarek

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Mon, Apr 26, 2021 at 10:36 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 26 Apr 2021 10:09:29 -0700 Michael Chan wrote:
> > On Mon, Apr 26, 2021 at 10:00 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > > On Mon, 26 Apr 2021 09:45:17 -0700 Michael Chan wrote:
> > > > Sorry, hit send too early.  If it is not UDP, it could be GRE or IP
> > > > over IP for example, right?  Why do we need to turn off offload?
> > >
> > > All supported protocols can be included in the allow list.
> > > That's one of the costs of NETIF_F_IP_CSUM, the driver needs
> > > to make sure the device can understand the packet.
> >
> > Only UDP encapsulations have the 2 port limitations.  The rest are supported.
>
> AFAIU you claim that other than certain UDP formats your device can
> parse _every_ possible packet encapsulation. To which I have no reply.

Fair enough.  I'll get the list of supported encapsulations and check
for all supported types.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next v2 00/10] bnxt_en: updates for net-next.
  2016-02-26  8:59 [PATCH net-next v2 00/10] bnxt_en: updates " Michael Chan
@ 2016-03-01 20:46 ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2016-03-01 20:46 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Fri, 26 Feb 2016 03:59:58 -0500

> Miscellaneous updates covering SRIOV, IRQ coalescing, firmware logging and
> package version for net-next.  Thanks. 
> 
> v2: Updated description and added more comments for patch 1.  Fixed
> function parameters formatting for patch 4.

Series applied, thanks Michael.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next v2 00/10] bnxt_en: updates for net-next.
@ 2016-02-26  8:59 Michael Chan
  2016-03-01 20:46 ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Chan @ 2016-02-26  8:59 UTC (permalink / raw)
  To: davem; +Cc: netdev

Miscellaneous updates covering SRIOV, IRQ coalescing, firmware logging and
package version for net-next.  Thanks. 

v2: Updated description and added more comments for patch 1.  Fixed
function parameters formatting for patch 4.

Jeffrey Huang (1):
  bnxt_en: Send PF driver unload notification to all VFs.

Michael Chan (8):
  bnxt_en: Improve bnxt_vf_update_mac().
  bnxt_en: Store irq coalescing timer values in micro seconds.
  bnxt_en: Refactor bnxt_hwrm_set_coal().
  bnxt_en: Add coalescing support for tx rings.
  bnxt_en: Use firmware provided message timeout value.
  bnxt_en: Fix dmesg log firmware error messages.
  bnxt_en: Refactor _hwrm_send_message().
  bnxt_en: Add hwrm_send_message_silent().

Rob Swindell (1):
  bnxt_en: Add installed-package firmware version reporting via Ethtool
    GDRVINFO

 drivers/net/ethernet/broadcom/bnxt/bnxt.c          | 166 ++++++++++++++-------
 drivers/net/ethernet/broadcom/bnxt/bnxt.h          |  35 ++---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c  | 126 ++++++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_nvm_defs.h |  14 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c    |  63 +++++++-
 5 files changed, 313 insertions(+), 91 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-04-26 17:53 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 17:45 [PATCH net-next v2 00/10] bnxt_en: Updates for net-next Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 01/10] bnxt_en: report signal mode in link up messages Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 02/10] bnxt_en: Add a new phy_flags field to the main driver structure Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 03/10] bnxt_en: Add support for fw managed link down feature Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 04/10] bnxt_en: allow promiscuous mode for trusted VFs Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 05/10] bnxt_en: allow VF config ops when PF is closed Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 06/10] bnxt_en: Move bnxt_approve_mac() Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 07/10] bnxt_en: Call bnxt_approve_mac() after the PF gives up control of the VF MAC Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 08/10] bnxt_en: Add PCI IDs for Hyper-V VF devices Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 09/10] bnxt_en: Support IFF_SUPP_NOFCS feature to transmit without ethernet FCS Michael Chan
2021-04-25 17:45 ` [PATCH net-next v2 10/10] bnxt_en: Implement .ndo_features_check() Michael Chan
2021-04-26 16:29   ` Jakub Kicinski
2021-04-26 16:35     ` Michael Chan
2021-04-26 16:45       ` Michael Chan
2021-04-26 17:00         ` Jakub Kicinski
2021-04-26 17:09           ` Michael Chan
2021-04-26 17:36             ` Jakub Kicinski
2021-04-26 17:52               ` Michael Chan
2021-04-26  2:00 ` [PATCH net-next v2 00/10] bnxt_en: Updates for net-next patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2016-02-26  8:59 [PATCH net-next v2 00/10] bnxt_en: updates " Michael Chan
2016-03-01 20:46 ` David Miller

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.