Commit 768c83a4 authored by David S. Miller's avatar David S. Miller

Merge branch 'bnx2x-fixes'

Michal Schmidt says:

====================
bnx2x: endianness fixes

this fixes a VLAN crash and some SRIOV bugs in bnx2x observed on ppc64.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 735c1e25 7e88009b
...@@ -4896,9 +4896,9 @@ struct c2s_pri_trans_table_entry { ...@@ -4896,9 +4896,9 @@ struct c2s_pri_trans_table_entry {
* cfc delete event data * cfc delete event data
*/ */
struct cfc_del_event_data { struct cfc_del_event_data {
u32 cid; __le32 cid;
u32 reserved0; __le32 reserved0;
u32 reserved1; __le32 reserved1;
}; };
...@@ -5114,15 +5114,9 @@ struct vf_pf_channel_zone_trigger { ...@@ -5114,15 +5114,9 @@ struct vf_pf_channel_zone_trigger {
* zone that triggers the in-bound interrupt * zone that triggers the in-bound interrupt
*/ */
struct trigger_vf_zone { struct trigger_vf_zone {
#if defined(__BIG_ENDIAN)
u16 reserved1;
u8 reserved0;
struct vf_pf_channel_zone_trigger vf_pf_channel;
#elif defined(__LITTLE_ENDIAN)
struct vf_pf_channel_zone_trigger vf_pf_channel; struct vf_pf_channel_zone_trigger vf_pf_channel;
u8 reserved0; u8 reserved0;
u16 reserved1; u16 reserved1;
#endif
u32 reserved2; u32 reserved2;
}; };
...@@ -5207,9 +5201,9 @@ struct e2_integ_data { ...@@ -5207,9 +5201,9 @@ struct e2_integ_data {
* set mac event data * set mac event data
*/ */
struct eth_event_data { struct eth_event_data {
u32 echo; __le32 echo;
u32 reserved0; __le32 reserved0;
u32 reserved1; __le32 reserved1;
}; };
...@@ -5219,9 +5213,9 @@ struct eth_event_data { ...@@ -5219,9 +5213,9 @@ struct eth_event_data {
struct vf_pf_event_data { struct vf_pf_event_data {
u8 vf_id; u8 vf_id;
u8 reserved0; u8 reserved0;
u16 reserved1; __le16 reserved1;
u32 msg_addr_lo; __le32 msg_addr_lo;
u32 msg_addr_hi; __le32 msg_addr_hi;
}; };
/* /*
...@@ -5230,9 +5224,9 @@ struct vf_pf_event_data { ...@@ -5230,9 +5224,9 @@ struct vf_pf_event_data {
struct vf_flr_event_data { struct vf_flr_event_data {
u8 vf_id; u8 vf_id;
u8 reserved0; u8 reserved0;
u16 reserved1; __le16 reserved1;
u32 reserved2; __le32 reserved2;
u32 reserved3; __le32 reserved3;
}; };
/* /*
...@@ -5241,9 +5235,9 @@ struct vf_flr_event_data { ...@@ -5241,9 +5235,9 @@ struct vf_flr_event_data {
struct malicious_vf_event_data { struct malicious_vf_event_data {
u8 vf_id; u8 vf_id;
u8 err_id; u8 err_id;
u16 reserved1; __le16 reserved1;
u32 reserved2; __le32 reserved2;
u32 reserved3; __le32 reserved3;
}; };
/* /*
......
...@@ -5280,14 +5280,14 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, ...@@ -5280,14 +5280,14 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp,
{ {
unsigned long ramrod_flags = 0; unsigned long ramrod_flags = 0;
int rc = 0; int rc = 0;
u32 cid = elem->message.data.eth_event.echo & BNX2X_SWCID_MASK; u32 echo = le32_to_cpu(elem->message.data.eth_event.echo);
u32 cid = echo & BNX2X_SWCID_MASK;
struct bnx2x_vlan_mac_obj *vlan_mac_obj; struct bnx2x_vlan_mac_obj *vlan_mac_obj;
/* Always push next commands out, don't wait here */ /* Always push next commands out, don't wait here */
__set_bit(RAMROD_CONT, &ramrod_flags); __set_bit(RAMROD_CONT, &ramrod_flags);
switch (le32_to_cpu((__force __le32)elem->message.data.eth_event.echo) switch (echo >> BNX2X_SWCID_SHIFT) {
>> BNX2X_SWCID_SHIFT) {
case BNX2X_FILTER_MAC_PENDING: case BNX2X_FILTER_MAC_PENDING:
DP(BNX2X_MSG_SP, "Got SETUP_MAC completions\n"); DP(BNX2X_MSG_SP, "Got SETUP_MAC completions\n");
if (CNIC_LOADED(bp) && (cid == BNX2X_ISCSI_ETH_CID(bp))) if (CNIC_LOADED(bp) && (cid == BNX2X_ISCSI_ETH_CID(bp)))
...@@ -5308,8 +5308,7 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, ...@@ -5308,8 +5308,7 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp,
bnx2x_handle_mcast_eqe(bp); bnx2x_handle_mcast_eqe(bp);
return; return;
default: default:
BNX2X_ERR("Unsupported classification command: %d\n", BNX2X_ERR("Unsupported classification command: 0x%x\n", echo);
elem->message.data.eth_event.echo);
return; return;
} }
...@@ -5478,9 +5477,6 @@ static void bnx2x_eq_int(struct bnx2x *bp) ...@@ -5478,9 +5477,6 @@ static void bnx2x_eq_int(struct bnx2x *bp)
goto next_spqe; goto next_spqe;
} }
/* elem CID originates from FW; actually LE */
cid = SW_CID((__force __le32)
elem->message.data.cfc_del_event.cid);
opcode = elem->message.opcode; opcode = elem->message.opcode;
/* handle eq element */ /* handle eq element */
...@@ -5503,6 +5499,10 @@ static void bnx2x_eq_int(struct bnx2x *bp) ...@@ -5503,6 +5499,10 @@ static void bnx2x_eq_int(struct bnx2x *bp)
* we may want to verify here that the bp state is * we may want to verify here that the bp state is
* HALTING * HALTING
*/ */
/* elem CID originates from FW; actually LE */
cid = SW_CID(elem->message.data.cfc_del_event.cid);
DP(BNX2X_MSG_SP, DP(BNX2X_MSG_SP,
"got delete ramrod for MULTI[%d]\n", cid); "got delete ramrod for MULTI[%d]\n", cid);
...@@ -5596,10 +5596,8 @@ static void bnx2x_eq_int(struct bnx2x *bp) ...@@ -5596,10 +5596,8 @@ static void bnx2x_eq_int(struct bnx2x *bp)
BNX2X_STATE_OPENING_WAIT4_PORT): BNX2X_STATE_OPENING_WAIT4_PORT):
case (EVENT_RING_OPCODE_RSS_UPDATE_RULES | case (EVENT_RING_OPCODE_RSS_UPDATE_RULES |
BNX2X_STATE_CLOSING_WAIT4_HALT): BNX2X_STATE_CLOSING_WAIT4_HALT):
cid = elem->message.data.eth_event.echo &
BNX2X_SWCID_MASK;
DP(BNX2X_MSG_SP, "got RSS_UPDATE ramrod. CID %d\n", DP(BNX2X_MSG_SP, "got RSS_UPDATE ramrod. CID %d\n",
cid); SW_CID(elem->message.data.eth_event.echo));
rss_raw->clear_pending(rss_raw); rss_raw->clear_pending(rss_raw);
break; break;
...@@ -5684,7 +5682,7 @@ static void bnx2x_sp_task(struct work_struct *work) ...@@ -5684,7 +5682,7 @@ static void bnx2x_sp_task(struct work_struct *work)
if (status & BNX2X_DEF_SB_IDX) { if (status & BNX2X_DEF_SB_IDX) {
struct bnx2x_fastpath *fp = bnx2x_fcoe_fp(bp); struct bnx2x_fastpath *fp = bnx2x_fcoe_fp(bp);
if (FCOE_INIT(bp) && if (FCOE_INIT(bp) &&
(bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) { (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
/* Prevent local bottom-halves from running as /* Prevent local bottom-halves from running as
* we are going to change the local NAPI list. * we are going to change the local NAPI list.
......
...@@ -1672,11 +1672,12 @@ void bnx2x_vf_handle_classification_eqe(struct bnx2x *bp, ...@@ -1672,11 +1672,12 @@ void bnx2x_vf_handle_classification_eqe(struct bnx2x *bp,
{ {
unsigned long ramrod_flags = 0; unsigned long ramrod_flags = 0;
int rc = 0; int rc = 0;
u32 echo = le32_to_cpu(elem->message.data.eth_event.echo);
/* Always push next commands out, don't wait here */ /* Always push next commands out, don't wait here */
set_bit(RAMROD_CONT, &ramrod_flags); set_bit(RAMROD_CONT, &ramrod_flags);
switch (elem->message.data.eth_event.echo >> BNX2X_SWCID_SHIFT) { switch (echo >> BNX2X_SWCID_SHIFT) {
case BNX2X_FILTER_MAC_PENDING: case BNX2X_FILTER_MAC_PENDING:
rc = vfq->mac_obj.complete(bp, &vfq->mac_obj, elem, rc = vfq->mac_obj.complete(bp, &vfq->mac_obj, elem,
&ramrod_flags); &ramrod_flags);
...@@ -1686,8 +1687,7 @@ void bnx2x_vf_handle_classification_eqe(struct bnx2x *bp, ...@@ -1686,8 +1687,7 @@ void bnx2x_vf_handle_classification_eqe(struct bnx2x *bp,
&ramrod_flags); &ramrod_flags);
break; break;
default: default:
BNX2X_ERR("Unsupported classification command: %d\n", BNX2X_ERR("Unsupported classification command: 0x%x\n", echo);
elem->message.data.eth_event.echo);
return; return;
} }
if (rc < 0) if (rc < 0)
...@@ -1747,16 +1747,14 @@ int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem) ...@@ -1747,16 +1747,14 @@ int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem)
switch (opcode) { switch (opcode) {
case EVENT_RING_OPCODE_CFC_DEL: case EVENT_RING_OPCODE_CFC_DEL:
cid = SW_CID((__force __le32) cid = SW_CID(elem->message.data.cfc_del_event.cid);
elem->message.data.cfc_del_event.cid);
DP(BNX2X_MSG_IOV, "checking cfc-del comp cid=%d\n", cid); DP(BNX2X_MSG_IOV, "checking cfc-del comp cid=%d\n", cid);
break; break;
case EVENT_RING_OPCODE_CLASSIFICATION_RULES: case EVENT_RING_OPCODE_CLASSIFICATION_RULES:
case EVENT_RING_OPCODE_MULTICAST_RULES: case EVENT_RING_OPCODE_MULTICAST_RULES:
case EVENT_RING_OPCODE_FILTERS_RULES: case EVENT_RING_OPCODE_FILTERS_RULES:
case EVENT_RING_OPCODE_RSS_UPDATE_RULES: case EVENT_RING_OPCODE_RSS_UPDATE_RULES:
cid = (elem->message.data.eth_event.echo & cid = SW_CID(elem->message.data.eth_event.echo);
BNX2X_SWCID_MASK);
DP(BNX2X_MSG_IOV, "checking filtering comp cid=%d\n", cid); DP(BNX2X_MSG_IOV, "checking filtering comp cid=%d\n", cid);
break; break;
case EVENT_RING_OPCODE_VF_FLR: case EVENT_RING_OPCODE_VF_FLR:
......
...@@ -2187,8 +2187,10 @@ void bnx2x_vf_mbx_schedule(struct bnx2x *bp, ...@@ -2187,8 +2187,10 @@ void bnx2x_vf_mbx_schedule(struct bnx2x *bp,
/* Update VFDB with current message and schedule its handling */ /* Update VFDB with current message and schedule its handling */
mutex_lock(&BP_VFDB(bp)->event_mutex); mutex_lock(&BP_VFDB(bp)->event_mutex);
BP_VF_MBX(bp, vf_idx)->vf_addr_hi = vfpf_event->msg_addr_hi; BP_VF_MBX(bp, vf_idx)->vf_addr_hi =
BP_VF_MBX(bp, vf_idx)->vf_addr_lo = vfpf_event->msg_addr_lo; le32_to_cpu(vfpf_event->msg_addr_hi);
BP_VF_MBX(bp, vf_idx)->vf_addr_lo =
le32_to_cpu(vfpf_event->msg_addr_lo);
BP_VFDB(bp)->event_occur |= (1ULL << vf_idx); BP_VFDB(bp)->event_occur |= (1ULL << vf_idx);
mutex_unlock(&BP_VFDB(bp)->event_mutex); mutex_unlock(&BP_VFDB(bp)->event_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment