All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] be2net: patch set
@ 2015-07-10  9:32 Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 1/9] be2net: remove duplicate code in be_setup_wol() Sathya Perla
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

Hi David, the following patch set has code cleanup patches, minor enhancements
and non-critical fixes. Pls consider applying to the net-next tree. Thanks!

Patch 1 removes duplicate code in be_setup_wol() routine making it simpler
and more readable.

Patch 2 fixes the the bridge mode return value for the ndo_bridge_getlink()
call. Instead of just relying on the SRIOV enabled state, the driver now
queries the FW, for the actual mode of bridge.

Patch 3 removes code for setting D0 power state as it's already done
in pci_enable_device()

Patch 4 fixes a bad return value in be_check_ufi_compatibility() routine
introduced by an earlier commit.

Patch 5 fixes a field in udp header being accessed while in network endian
format.

Patch 6 fixes the be_mcc_notify() routine to return an error status when
the FW/HW is in an error state.

Patch 7 fixes the be_cmd_rx_filter() routine to issue the RX_FILTER cmd
and not wait for a completion from the FW. If the FW/adapter
is in an error state, this change helps in not holding up the rtnl_lock
and keeping bottom halves disabled while the driver timesout waiting for
a response from the FW.

Patch 8 fixes the be_cmd_set_loopback() routine to issue the LOOPBACK cmd
and not wait for the FW completion while spin_lock_bh() is held on the
mcc_lock. As the cmd is always issued from ethtool in a process context,
it can sleep till the FW completion is received.

Patch 9 bumps up the driver version to 10.6.0.3

Kalesh Purayil (3):
  be2net: remove duplicate code in be_setup_wol()
  be2net: query FW to check if EVB is enabled
  be2net: remove redundant D0 power state set

Sathya Perla (1):
  be2net: bump up the driver version to 10.6.0.3

Suresh Reddy (3):
  be2net: return error status from be_mcc_notify()
  be2net: make the RX_FILTER command asynchronous
  be2net: make SET_LOOPBACK_MODE cmd asynchrounous

Vasundhara Volam (1):
  be2net: fix wrong return value in be_check_ufi_compatibility()

Venkat Duvvuru (1):
  be2net: convert dest field in udp-hdr to host-endian

 drivers/net/ethernet/emulex/benet/be.h         |  2 +-
 drivers/net/ethernet/emulex/benet/be_cmds.c    | 64 ++++++++++++++++++++------
 drivers/net/ethernet/emulex/benet/be_cmds.h    |  3 ++
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 15 +++++-
 drivers/net/ethernet/emulex/benet/be_main.c    | 40 +++++++---------
 5 files changed, 82 insertions(+), 42 deletions(-)

-- 
2.4.1

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

* [PATCH net-next 1/9] be2net: remove duplicate code in be_setup_wol()
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 2/9] be2net: query FW to check if EVB is enabled Sathya Perla
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Kalesh Purayil <kalesh.purayil@avagotech.com>

This change will make be_setup_wol() routine more compact and readable
by removing some duplicate code.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 6f64242..635c62f 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3529,15 +3529,15 @@ err:
 
 static int be_setup_wol(struct be_adapter *adapter, bool enable)
 {
+	struct device *dev = &adapter->pdev->dev;
 	struct be_dma_mem cmd;
-	int status = 0;
 	u8 mac[ETH_ALEN];
+	int status;
 
 	eth_zero_addr(mac);
 
 	cmd.size = sizeof(struct be_cmd_req_acpi_wol_magic_config);
-	cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
-				     GFP_KERNEL);
+	cmd.va = dma_zalloc_coherent(dev, cmd.size, &cmd.dma, GFP_KERNEL);
 	if (!cmd.va)
 		return -ENOMEM;
 
@@ -3546,24 +3546,18 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable)
 						PCICFG_PM_CONTROL_OFFSET,
 						PCICFG_PM_CONTROL_MASK);
 		if (status) {
-			dev_err(&adapter->pdev->dev,
-				"Could not enable Wake-on-lan\n");
-			dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va,
-					  cmd.dma);
-			return status;
+			dev_err(dev, "Could not enable Wake-on-lan\n");
+			goto err;
 		}
-		status = be_cmd_enable_magic_wol(adapter,
-						 adapter->netdev->dev_addr,
-						 &cmd);
-		pci_enable_wake(adapter->pdev, PCI_D3hot, 1);
-		pci_enable_wake(adapter->pdev, PCI_D3cold, 1);
 	} else {
-		status = be_cmd_enable_magic_wol(adapter, mac, &cmd);
-		pci_enable_wake(adapter->pdev, PCI_D3hot, 0);
-		pci_enable_wake(adapter->pdev, PCI_D3cold, 0);
+		ether_addr_copy(mac, adapter->netdev->dev_addr);
 	}
 
-	dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
+	status = be_cmd_enable_magic_wol(adapter, mac, &cmd);
+	pci_enable_wake(adapter->pdev, PCI_D3hot, enable);
+	pci_enable_wake(adapter->pdev, PCI_D3cold, enable);
+err:
+	dma_free_coherent(dev, cmd.size, cmd.va, cmd.dma);
 	return status;
 }
 
-- 
2.4.1

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

* [PATCH net-next 2/9] be2net: query FW to check if EVB is enabled
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 1/9] be2net: remove duplicate code in be_setup_wol() Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 3/9] be2net: remove redundant D0 power state set Sathya Perla
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Kalesh Purayil <kalesh.purayil@avagotech.com>

The current code assumes that bridge functionality (EVB) in the adapter
is enabled only when SR-IOV is enabled. This is not always true.
This patch uses the GET_HSW_CONFIG FW cmd to query this from the FW.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.h | 1 +
 drivers/net/ethernet/emulex/benet/be_main.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 2716e6f..f0a92b7 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1758,6 +1758,7 @@ struct be_cmd_req_set_mac_list {
 /*********************** HSW Config ***********************/
 #define PORT_FWD_TYPE_VEPA		0x3
 #define PORT_FWD_TYPE_VEB		0x2
+#define PORT_FWD_TYPE_PASSTHRU		0x1
 
 #define ENABLE_MAC_SPOOFCHK		0x2
 #define DISABLE_MAC_SPOOFCHK		0x3
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 635c62f..f21c56a 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -5073,9 +5073,6 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 	int status = 0;
 	u8 hsw_mode;
 
-	if (!sriov_enabled(adapter))
-		return 0;
-
 	/* BE and Lancer chips support VEB mode only */
 	if (BEx_chip(adapter) || lancer_chip(adapter)) {
 		hsw_mode = PORT_FWD_TYPE_VEB;
@@ -5085,6 +5082,9 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 					       NULL);
 		if (status)
 			return 0;
+
+		if (hsw_mode == PORT_FWD_TYPE_PASSTHRU)
+			return 0;
 	}
 
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev,
-- 
2.4.1

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

* [PATCH net-next 3/9] be2net: remove redundant D0 power state set
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 1/9] be2net: remove duplicate code in be_setup_wol() Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 2/9] be2net: query FW to check if EVB is enabled Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 4/9] be2net: fix wrong return value in be_check_ufi_compatibility() Sathya Perla
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Kalesh Purayil <kalesh.purayil@avagotech.com>

pci_enable_device() call sets device power state to D0; there is no need
doing it again.

Signed-off-by: Kalesh AP <kalesh.purayil@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f21c56a..8b81e23 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -5807,7 +5807,6 @@ static int be_pci_resume(struct pci_dev *pdev)
 	if (status)
 		return status;
 
-	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
 
 	status = be_resume(adapter);
@@ -5887,7 +5886,6 @@ static pci_ers_result_t be_eeh_reset(struct pci_dev *pdev)
 		return PCI_ERS_RESULT_DISCONNECT;
 
 	pci_set_master(pdev);
-	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
 
 	/* Check if card is ok and fw is ready */
-- 
2.4.1

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

* [PATCH net-next 4/9] be2net: fix wrong return value in be_check_ufi_compatibility()
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (2 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 3/9] be2net: remove redundant D0 power state set Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 5/9] be2net: convert dest field in udp-hdr to host-endian Sathya Perla
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Vasundhara Volam <vasundhara.volam@avagotech.com>

In the commit a6e6ff6eee12f3e
("be2net: simplify UFI compatibility checking"), a return value of "-1"
was incorrectly used in place of "false". This patch fixes it.

Fixes: a6e6ff6eee12f3e ("be2net: simplify UFI compatibility checking")
Signed-off-by: Vasundhara Volam <vasundhara.volam@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 8b81e23..8ef7ea5 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4918,7 +4918,7 @@ static bool be_check_ufi_compatibility(struct be_adapter *adapter,
 {
 	if (!fhdr) {
 		dev_err(&adapter->pdev->dev, "Invalid FW UFI file");
-		return -1;
+		return false;
 	}
 
 	/* First letter of the build version is used to identify
-- 
2.4.1

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

* [PATCH net-next 5/9] be2net: convert dest field in udp-hdr to host-endian
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (3 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 4/9] be2net: fix wrong return value in be_check_ufi_compatibility() Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 6/9] be2net: return error status from be_mcc_notify() Sathya Perla
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>

The "dest" field in the UDP-hdr of a TX skb is in network endian format.
Convert it to host endian before accessing it. The os2bmc patch,
mentioned below introduced this code.

Fixes: 760c295e0e8d ("be2net: Support for OS2BMC")
Signed-off-by: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 8ef7ea5..c996dd7 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1254,7 +1254,7 @@ static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
 	if (is_udp_pkt((*skb))) {
 		struct udphdr *udp = udp_hdr((*skb));
 
-		switch (udp->dest) {
+		switch (ntohs(udp->dest)) {
 		case DHCP_CLIENT_PORT:
 			os2bmc = is_dhcp_client_filt_enabled(adapter);
 			goto done;
-- 
2.4.1

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

* [PATCH net-next 6/9] be2net: return error status from be_mcc_notify()
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (4 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 5/9] be2net: convert dest field in udp-hdr to host-endian Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 7/9] be2net: make the RX_FILTER command asynchronous Sathya Perla
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Suresh Reddy <Suresh.Reddy@emulex.com>

When the adapter is in error state, return error from be_mcc_notify()
so that the caller routines need not sleep waiting for a response.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 39 +++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 9eac322..a299f7b 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -88,19 +88,21 @@ static inline void *embedded_payload(struct be_mcc_wrb *wrb)
 	return wrb->payload.embedded_payload;
 }
 
-static void be_mcc_notify(struct be_adapter *adapter)
+static int be_mcc_notify(struct be_adapter *adapter)
 {
 	struct be_queue_info *mccq = &adapter->mcc_obj.q;
 	u32 val = 0;
 
 	if (be_check_error(adapter, BE_ERROR_ANY))
-		return;
+		return -EIO;
 
 	val |= mccq->id & DB_MCCQ_RING_ID_MASK;
 	val |= 1 << DB_MCCQ_NUM_POSTED_SHIFT;
 
 	wmb();
 	iowrite32(val, adapter->db + DB_MCCQ_OFFSET);
+
+	return 0;
 }
 
 /* To check if valid bit is set, check the entire word as we don't know
@@ -541,7 +543,9 @@ static int be_mcc_notify_wait(struct be_adapter *adapter)
 
 	resp = be_decode_resp_hdr(wrb->tag0, wrb->tag1);
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto out;
 
 	status = be_mcc_wait_compl(adapter);
 	if (status == -EIO)
@@ -1547,7 +1551,10 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
 	else
 		hdr->version = 2;
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err;
+
 	adapter->stats_cmd_sent = true;
 
 err:
@@ -1583,7 +1590,10 @@ int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
 	req->cmd_params.params.pport_num = cpu_to_le16(adapter->hba_port_num);
 	req->cmd_params.params.reset_stats = 0;
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err;
+
 	adapter->stats_cmd_sent = true;
 
 err:
@@ -1687,8 +1697,7 @@ int be_cmd_get_die_temperature(struct be_adapter *adapter)
 			       OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES,
 			       sizeof(*req), wrb, NULL);
 
-	be_mcc_notify(adapter);
-
+	status = be_mcc_notify(adapter);
 err:
 	spin_unlock_bh(&adapter->mcc_lock);
 	return status;
@@ -1860,7 +1869,7 @@ static int __be_cmd_modify_eqd(struct be_adapter *adapter,
 				cpu_to_le32(set_eqd[i].delay_multiplier);
 	}
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
 err:
 	spin_unlock_bh(&adapter->mcc_lock);
 	return status;
@@ -2320,7 +2329,10 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
 	req->addr_high = cpu_to_le32(upper_32_bits(cmd->dma +
 				sizeof(struct lancer_cmd_req_write_object)));
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err_unlock;
+
 	spin_unlock_bh(&adapter->mcc_lock);
 
 	if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
@@ -2491,7 +2503,10 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
 	req->params.op_code = cpu_to_le32(flash_opcode);
 	req->params.data_buf_size = cpu_to_le32(buf_size);
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err_unlock;
+
 	spin_unlock_bh(&adapter->mcc_lock);
 
 	if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
@@ -2636,7 +2651,9 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
 	req->num_pkts = cpu_to_le32(num_pkts);
 	req->loopback_type = cpu_to_le32(loopback_type);
 
-	be_mcc_notify(adapter);
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err;
 
 	spin_unlock_bh(&adapter->mcc_lock);
 
-- 
2.4.1

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

* [PATCH net-next 7/9] be2net: make the RX_FILTER command asynchronous
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (5 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 6/9] be2net: return error status from be_mcc_notify() Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 8/9] be2net: make SET_LOOPBACK_MODE cmd asynchrounous Sathya Perla
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Suresh Reddy <suresh.reddy@avagotech.com>

This fix makes the RX_FILTER cmd asynchronous, i.e., the caller issues
this cmd and doesn't wait for a completion from the FW. If the FW/adapter
is in an error state, this change helps in not holding up the rtnl_lock
and keeping bottom halves disabled while the driver timesout waiting for
a response from the FW.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index a299f7b..93934d3 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1962,7 +1962,7 @@ static int __be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
 			memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN);
 	}
 
-	status = be_mcc_notify_wait(adapter);
+	status = be_mcc_notify(adapter);
 err:
 	spin_unlock_bh(&adapter->mcc_lock);
 	return status;
-- 
2.4.1

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

* [PATCH net-next 8/9] be2net: make SET_LOOPBACK_MODE cmd asynchrounous
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (6 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 7/9] be2net: make the RX_FILTER command asynchronous Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-10  9:32 ` [PATCH net-next 9/9] be2net: bump up the driver version to 10.6.0.3 Sathya Perla
  2015-07-11  6:24 ` [PATCH net-next 0/9] be2net: patch set David Miller
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

From: Suresh Reddy <Suresh.Reddy@emulex.com>

The SET_LOOPBACK_MODE command is always issued from ethtool only in a
process context. So, while waiting for the cmd to complete, the driver
can sleep instead of holding spin_lock_bh() on the mcc_lock. This is done
by calling be_mcc_notify() instead of be_mcc_notify_wait() (that returns
only after the cmd completes while the MCCQ is locked).

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c    | 23 ++++++++++++++++++++---
 drivers/net/ethernet/emulex/benet/be_cmds.h    |  2 ++
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 15 +++++++++++++--
 3 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 93934d3..ecad46f 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -172,6 +172,12 @@ static void be_async_cmd_process(struct be_adapter *adapter,
 		return;
 	}
 
+	if (opcode == OPCODE_LOWLEVEL_SET_LOOPBACK_MODE &&
+	    subsystem == CMD_SUBSYSTEM_LOWLEVEL) {
+		complete(&adapter->et_cmd_compl);
+		return;
+	}
+
 	if ((opcode == OPCODE_COMMON_WRITE_FLASHROM ||
 	     opcode == OPCODE_COMMON_WRITE_OBJECT) &&
 	    subsystem == CMD_SUBSYSTEM_COMMON) {
@@ -2600,7 +2606,7 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
 	wrb = wrb_from_mccq(adapter);
 	if (!wrb) {
 		status = -EBUSY;
-		goto err;
+		goto err_unlock;
 	}
 
 	req = embedded_payload(wrb);
@@ -2614,8 +2620,19 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
 	req->loopback_type = loopback_type;
 	req->loopback_state = enable;
 
-	status = be_mcc_notify_wait(adapter);
-err:
+	status = be_mcc_notify(adapter);
+	if (status)
+		goto err_unlock;
+
+	spin_unlock_bh(&adapter->mcc_lock);
+
+	if (!wait_for_completion_timeout(&adapter->et_cmd_compl,
+					 msecs_to_jiffies(SET_LB_MODE_TIMEOUT)))
+		status = -ETIMEDOUT;
+
+	return status;
+
+err_unlock:
 	spin_unlock_bh(&adapter->mcc_lock);
 	return status;
 }
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index f0a92b7..a4479f7 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1495,6 +1495,8 @@ struct be_cmd_resp_acpi_wol_magic_config_v1 {
 #define BE_PME_D3COLD_CAP		0x80
 
 /********************** LoopBack test *********************/
+#define SET_LB_MODE_TIMEOUT		12000
+
 struct be_cmd_req_loopback_test {
 	struct be_cmd_req_hdr hdr;
 	u32 loopback_type;
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index b2476db..d20ff05 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -847,10 +847,21 @@ err:
 static u64 be_loopback_test(struct be_adapter *adapter, u8 loopback_type,
 			    u64 *status)
 {
-	be_cmd_set_loopback(adapter, adapter->hba_port_num, loopback_type, 1);
+	int ret;
+
+	ret = be_cmd_set_loopback(adapter, adapter->hba_port_num,
+				  loopback_type, 1);
+	if (ret)
+		return ret;
+
 	*status = be_cmd_loopback_test(adapter, adapter->hba_port_num,
 				       loopback_type, 1500, 2, 0xabc);
-	be_cmd_set_loopback(adapter, adapter->hba_port_num, BE_NO_LOOPBACK, 1);
+
+	ret = be_cmd_set_loopback(adapter, adapter->hba_port_num,
+				  BE_NO_LOOPBACK, 1);
+	if (ret)
+		return ret;
+
 	return *status;
 }
 
-- 
2.4.1

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

* [PATCH net-next 9/9] be2net: bump up the driver version to 10.6.0.3
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (7 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 8/9] be2net: make SET_LOOPBACK_MODE cmd asynchrounous Sathya Perla
@ 2015-07-10  9:32 ` Sathya Perla
  2015-07-11  6:24 ` [PATCH net-next 0/9] be2net: patch set David Miller
  9 siblings, 0 replies; 13+ messages in thread
From: Sathya Perla @ 2015-07-10  9:32 UTC (permalink / raw)
  To: netdev

Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
---
 drivers/net/ethernet/emulex/benet/be.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 8d12b41..cb5777b 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -37,7 +37,7 @@
 #include "be_hw.h"
 #include "be_roce.h"
 
-#define DRV_VER			"10.6.0.2"
+#define DRV_VER			"10.6.0.3"
 #define DRV_NAME		"be2net"
 #define BE_NAME			"Emulex BladeEngine2"
 #define BE3_NAME		"Emulex BladeEngine3"
-- 
2.4.1

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

* Re: [PATCH net-next 0/9] be2net: patch set
  2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
                   ` (8 preceding siblings ...)
  2015-07-10  9:32 ` [PATCH net-next 9/9] be2net: bump up the driver version to 10.6.0.3 Sathya Perla
@ 2015-07-11  6:24 ` David Miller
  9 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2015-07-11  6:24 UTC (permalink / raw)
  To: sathya.perla; +Cc: netdev

From: Sathya Perla <sathya.perla@avagotech.com>
Date: Fri, 10 Jul 2015 05:32:42 -0400

> Hi David, the following patch set has code cleanup patches, minor enhancements
> and non-critical fixes. Pls consider applying to the net-next tree. Thanks!

Series applied, thanks.

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

* Re: [PATCH net-next 0/9] be2net: patch set
  2015-02-06 13:18 Sathya Perla
@ 2015-02-08  6:52 ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2015-02-08  6:52 UTC (permalink / raw)
  To: sathya.perla; +Cc: netdev

From: Sathya Perla <sathya.perla@emulex.com>
Date: Fri, 6 Feb 2015 08:18:34 -0500

> Hi Dave, pls consider applying the following patch-set to the
> net-next tree. It has 5 code/style cleanup patches and 4 patches that
> add functionality to the driver.

Series applied.

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

* [PATCH net-next 0/9] be2net: patch set
@ 2015-02-06 13:18 Sathya Perla
  2015-02-08  6:52 ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sathya Perla @ 2015-02-06 13:18 UTC (permalink / raw)
  To: netdev

Hi Dave, pls consider applying the following patch-set to the
net-next tree. It has 5 code/style cleanup patches and 4 patches that
add functionality to the driver.

Patch 1 moves routines that were not needed to be in be.h to the respective
src files, to avoid unnecessary compilation.

Patch 2 replaces (1 << x) with BIT(x) macro

Patch 3 refactors code that checks if a FW flash file is compatible
with the adapter. The code is now refactored into 2 routines, the first one
gets the file type from the image file and the 2nd routine checks if the
file type is compatible with the adapter.

Patch 4 adds compatibility checks for flashing a FW image on the new
Skyhawk P2 HW revision.

Patch 5 adds support for a new "offset based" flashing scheme, wherein
the driver informs the FW of the offset at which each component in the flash
file is to be flashed at. This helps flashing components that were 
previously not recognized by the running FW.

Patch 6 simplifies the be_cmd_rx_filter() routine, by passing to it the
filter flags already used in the FW cmd, instead of the netdev flags that
were converted to the FW-cmd flags. 

Patch 7 introduces helper routines in be_set_rx_mode() and be_vid_config()
to improve code readability.

Patch 8 adds processing of port-misconfig async event sent by the FW.

Patch 9 removes unnecessary swapping of a field in the TX desc.

Sathya Perla (4):
  be2net: move un-exported routines from be.h to respective src files
  be2net: remove duplicate code in be_cmd_rx_filter()
  be2net: refactor be_set_rx_mode() and be_vid_config() for readability
  be2net: avoid unncessary swapping of fields in eth_tx_wrb

Vasundhara Volam (5):
  be2net: replace (1 << x) with BIT(x)
  be2net: refactor code that checks flash file compatibility
  be2net: avoid flashing SH-B0 UFI image on SH-P2 chip
  be2net: use offset based FW flashing for Skyhawk chip
  be2net: process port misconfig async event

 drivers/net/ethernet/emulex/benet/be.h      | 199 +--------
 drivers/net/ethernet/emulex/benet/be_cmds.c | 209 ++++++---
 drivers/net/ethernet/emulex/benet/be_cmds.h |  43 +-
 drivers/net/ethernet/emulex/benet/be_hw.h   |  14 +-
 drivers/net/ethernet/emulex/benet/be_main.c | 635 +++++++++++++++++++---------
 5 files changed, 647 insertions(+), 453 deletions(-)

-- 
2.2.0

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

end of thread, other threads:[~2015-07-11  6:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10  9:32 [PATCH net-next 0/9] be2net: patch set Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 1/9] be2net: remove duplicate code in be_setup_wol() Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 2/9] be2net: query FW to check if EVB is enabled Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 3/9] be2net: remove redundant D0 power state set Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 4/9] be2net: fix wrong return value in be_check_ufi_compatibility() Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 5/9] be2net: convert dest field in udp-hdr to host-endian Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 6/9] be2net: return error status from be_mcc_notify() Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 7/9] be2net: make the RX_FILTER command asynchronous Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 8/9] be2net: make SET_LOOPBACK_MODE cmd asynchrounous Sathya Perla
2015-07-10  9:32 ` [PATCH net-next 9/9] be2net: bump up the driver version to 10.6.0.3 Sathya Perla
2015-07-11  6:24 ` [PATCH net-next 0/9] be2net: patch set David Miller
  -- strict thread matches above, loose matches on Subject: below --
2015-02-06 13:18 Sathya Perla
2015-02-08  6:52 ` 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.