From 34b1ef04fc050d171e055f75d6a3384e1323bd38 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Wed, 1 Jun 2011 00:33:22 +0000 Subject: be2net: Fallback to the older opcode if MCC_CREATE_EXT opcode is not supported on the card Instead of failing the init/probe code in the driver fallback to the older opcode to ensure the driver is loaded thereby enabling users to upgrade the f/w to whatever version is required. Signed-off-by: Somnath Kotur Signed-off-by: David S. Miller --- drivers/net/benet/be_cmds.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/net/benet/be_cmds.h') diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 8148cc66cbe9..d08289e21f61 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h @@ -431,6 +431,14 @@ struct amap_mcc_context_lancer { } __packed; struct be_cmd_req_mcc_create { + struct be_cmd_req_hdr hdr; + u16 num_pages; + u16 cq_id; + u8 context[sizeof(struct amap_mcc_context_be) / 8]; + struct phys_addr pages[8]; +} __packed; + +struct be_cmd_req_mcc_ext_create { struct be_cmd_req_hdr hdr; u16 num_pages; u16 cq_id; -- cgit v1.2.3 From 2b3f291bf98e7cbf76afd9b0c96c81df5f5890f9 Mon Sep 17 00:00:00 2001 From: Sathya Perla Date: Wed, 29 Jun 2011 23:32:56 +0000 Subject: be2net: fix certain cmd failure logging Some (older)versions of cards/fw may not recognize certain cmds and return illegal/unsupported errors. As long as the driver can handle this gracefully there is no need to log an error msg. Also finetuned 2 existing error log messages. Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/benet/be_cmds.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'drivers/net/benet/be_cmds.h') diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index d08289e21f61..f0d745742d9d 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h @@ -51,17 +51,12 @@ struct be_mcc_wrb { /* Completion Status */ enum { - MCC_STATUS_SUCCESS = 0x0, -/* The client does not have sufficient privileges to execute the command */ - MCC_STATUS_INSUFFICIENT_PRIVILEGES = 0x1, -/* A parameter in the command was invalid. */ - MCC_STATUS_INVALID_PARAMETER = 0x2, -/* There are insufficient chip resources to execute the command */ - MCC_STATUS_INSUFFICIENT_RESOURCES = 0x3, -/* The command is completing because the queue was getting flushed */ - MCC_STATUS_QUEUE_FLUSHING = 0x4, -/* The command is completing with a DMA error */ - MCC_STATUS_DMA_FAILED = 0x5, + MCC_STATUS_SUCCESS = 0, + MCC_STATUS_FAILED = 1, + MCC_STATUS_ILLEGAL_REQUEST = 2, + MCC_STATUS_ILLEGAL_FIELD = 3, + MCC_STATUS_INSUFFICIENT_BUFFER = 4, + MCC_STATUS_UNAUTHORIZED_REQUEST = 5, MCC_STATUS_NOT_SUPPORTED = 66 }; -- cgit v1.2.3 From 482c9e798738dea847a5e5e0d20692fe80d48a76 Mon Sep 17 00:00:00 2001 From: Sathya Perla Date: Wed, 29 Jun 2011 23:33:17 +0000 Subject: be2net: create/destroy rx-queues on interface open/close On some skews, the BE card sends pause frames (and not drop pkts) if there are no more posted buffers available for packet reception. This behaviour has a side effect: When an interface is disabled, buffers are no longer posted on the corresponding RX rings. All broadcast and multicast traffic being received on the port will quickly fill up the PMEM and cause pause push back. As the PMEM is shared by both the ports, all traffic being received on the other (enabled) port also gets stalled. The fix is to destroy RX rings when the interface is disabled. If there is no RX ring match in the RXF lookup, the packets are discarded and so don't hog the PMEM. The RXQ creation cmd must now use MCC instead of MBOX as they are are called post MCC queue creation. Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/benet/be_cmds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/benet/be_cmds.h') diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index f0d745742d9d..1151df6b0020 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h @@ -1482,6 +1482,8 @@ extern int be_cmd_rxq_create(struct be_adapter *adapter, u32 rss, u8 *rss_id); extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, int type); +extern int be_cmd_rxq_destroy(struct be_adapter *adapter, + struct be_queue_info *q); extern int be_cmd_link_status_query(struct be_adapter *adapter, bool *link_up, u8 *mac_speed, u16 *link_speed, u32 dom); extern int be_cmd_reset(struct be_adapter *adapter); -- cgit v1.2.3 From 2dc1deb659d1fc29aaafc2c0b987547d6b383602 Mon Sep 17 00:00:00 2001 From: Sathya Perla Date: Tue, 19 Jul 2011 19:52:33 +0000 Subject: be2net: request native mode each time the card is reset Currently be3-native mode is requested only in probe(). It must be requested, each time the card is reset either after an EEH error or after sleep/hibernation. Also, the be_cmd_check_native_mode() is better named be_cmd_req_native_mode() Signed-off-by: Sathya Perla Signed-off-by: David S. Miller --- drivers/net/benet/be_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/benet/be_cmds.h') diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 1151df6b0020..8e4d48824fe9 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h @@ -1545,7 +1545,7 @@ extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); extern void be_detect_dump_ue(struct be_adapter *adapter); extern int be_cmd_get_die_temperature(struct be_adapter *adapter); extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter); -extern int be_cmd_check_native_mode(struct be_adapter *adapter); +extern int be_cmd_req_native_mode(struct be_adapter *adapter); extern int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size); extern void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf); -- cgit v1.2.3