[PATCH net 1/1] qlcnic: fix Tx descriptor corruption on 82xx devices

2018-09-26 Thread Shahed Shaikh
In regular NIC transmission flow, driver always configures MAC using
Tx queue zero descriptor as a part of MAC learning flow.
But with multi Tx queue supported NIC, regular transmission can occur on
any non-zero Tx queue and from that context it uses
Tx queue zero descriptor to configure MAC, at the same time TX queue
zero could be used by another CPU for regular transmission
which could lead to Tx queue zero descriptor corruption and cause FW
abort.

This patch fixes this in such a way that driver always configures
learned MAC address from the same Tx queue which is used for
regular transmission.

Fixes: 7e2cf4feba05 ("qlcnic: change driver hardware interface mechanism")
Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h |  8 +---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |  3 ++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h |  3 ++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h  |  3 ++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c  | 12 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 81312924df14..0c443ea98479 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1800,7 +1800,8 @@ struct qlcnic_hardware_ops {
int (*config_loopback) (struct qlcnic_adapter *, u8);
int (*clear_loopback) (struct qlcnic_adapter *, u8);
int (*config_promisc_mode) (struct qlcnic_adapter *, u32);
-   void (*change_l2_filter) (struct qlcnic_adapter *, u64 *, u16);
+   void (*change_l2_filter)(struct qlcnic_adapter *adapter, u64 *addr,
+u16 vlan, struct qlcnic_host_tx_ring *tx_ring);
int (*get_board_info) (struct qlcnic_adapter *);
void (*set_mac_filter_count) (struct qlcnic_adapter *);
void (*free_mac_list) (struct qlcnic_adapter *);
@@ -2064,9 +2065,10 @@ static inline int qlcnic_nic_set_promisc(struct 
qlcnic_adapter *adapter,
 }
 
 static inline void qlcnic_change_filter(struct qlcnic_adapter *adapter,
-   u64 *addr, u16 id)
+   u64 *addr, u16 vlan,
+   struct qlcnic_host_tx_ring *tx_ring)
 {
-   adapter->ahw->hw_ops->change_l2_filter(adapter, addr, id);
+   adapter->ahw->hw_ops->change_l2_filter(adapter, addr, vlan, tx_ring);
 }
 
 static inline int qlcnic_get_board_info(struct qlcnic_adapter *adapter)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 569d54ededec..a79d84f99102 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -2135,7 +2135,8 @@ int qlcnic_83xx_sre_macaddr_change(struct qlcnic_adapter 
*adapter, u8 *addr,
 }
 
 void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
- u16 vlan_id)
+ u16 vlan_id,
+ struct qlcnic_host_tx_ring *tx_ring)
 {
u8 mac[ETH_ALEN];
memcpy(&mac, addr, ETH_ALEN);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index b75a81246856..73fe2f64491d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -550,7 +550,8 @@ int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, 
ulong, u32);
 int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32);
 int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int);
 int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int);
-void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *, u64 *, u16);
+void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
+ u16 vlan, struct qlcnic_host_tx_ring *ring);
 int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info 
*);
 int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *);
 void qlcnic_83xx_initialize_nic(struct qlcnic_adapter *, int);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
index 4bb33af8e2b3..56a3bd9e37dc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
@@ -173,7 +173,8 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
 struct net_device *netdev);
 void qlcnic_82xx_get_beacon_state(struct qlcnic_adapter *);
 void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter,
-  u64 *uaddr, u16 vlan_id);
+  u64 *uaddr, u16 vlan_id,
+  struct qlc

[PATCH net-next 0/3] bnx2x: enhancements

2018-09-20 Thread Shahed Shaikh
From: Shahed Shaikh 

Hi Dave,

This series adds below changes -
- support for VF spoof-check configuration through .ndo_set_vf_spoofchk.
- workaround for MFW bug regarding unexpected bandwidth notifcation
  in single function mode.
- supply VF link status as part of get VF config handling.

Please apply this to net-next tree.

Thanks,
Shahed

Shahed Shaikh (3):
  bnx2x: Add VF spoof-checking configuration
  bnx2x: Ignore bandwidth attention in single function mode
  bnx2x: Provide VF link status in ndo_get_vf_config

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h   |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  | 11 +++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 81 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  2 +
 4 files changed, 93 insertions(+), 2 deletions(-)

-- 
1.8.3.1



[PATCH net-next 1/3] bnx2x: Add VF spoof-checking configuration

2018-09-20 Thread Shahed Shaikh
Add support for `ndo_set_vf_spoofchk' to allow PF control over
its VF spoof-checking configuration.

Signed-off-by: Shahed Shaikh 
Signed-off-by: Ariel Elior 
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h   |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 80 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  2 +
 4 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 0e508e5..142bc11 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -494,6 +494,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vf,
 int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac);
 int bnx2x_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
  __be16 vlan_proto);
+int bnx2x_set_vf_spoofchk(struct net_device *dev, int idx, bool val);
 
 /* select_queue callback */
 u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 71362b7..faf64ba 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13121,6 +13121,7 @@ static int bnx2x_vlan_rx_kill_vid(struct net_device 
*dev, __be16 proto, u16 vid)
.ndo_set_vf_mac = bnx2x_set_vf_mac,
.ndo_set_vf_vlan= bnx2x_set_vf_vlan,
.ndo_get_vf_config  = bnx2x_get_vf_config,
+   .ndo_set_vf_spoofchk= bnx2x_set_vf_spoofchk,
 #endif
 #ifdef NETDEV_FCOE_WWNN
.ndo_fcoe_get_wwn   = bnx2x_fcoe_get_wwn,
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 62da465..2f76b37 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -209,7 +209,10 @@ void bnx2x_vfop_qctor_prep(struct bnx2x *bp,
 */
__set_bit(BNX2X_Q_FLG_TX_SWITCH, &setup_p->flags);
__set_bit(BNX2X_Q_FLG_TX_SEC, &setup_p->flags);
-   __set_bit(BNX2X_Q_FLG_ANTI_SPOOF, &setup_p->flags);
+   if (vf->spoofchk)
+   __set_bit(BNX2X_Q_FLG_ANTI_SPOOF, &setup_p->flags);
+   else
+   __clear_bit(BNX2X_Q_FLG_ANTI_SPOOF, &setup_p->flags);
 
/* Setup-op rx parameters */
if (test_bit(BNX2X_Q_TYPE_HAS_RX, &q_type)) {
@@ -1269,6 +1272,8 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int 
int_mode_param,
bnx2x_vf(bp, i, state) = VF_FREE;
mutex_init(&bnx2x_vf(bp, i, op_mutex));
bnx2x_vf(bp, i, op_current) = CHANNEL_TLV_NONE;
+   /* enable spoofchk by default */
+   bnx2x_vf(bp, i, spoofchk) = 1;
}
 
/* re-read the IGU CAM for VFs - index and abs_vfid must be set */
@@ -2632,7 +2637,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,
ivi->qos = 0;
ivi->max_tx_rate = 1; /* always 10G. TBA take from link struct */
ivi->min_tx_rate = 0;
-   ivi->spoofchk = 1; /*always enabled */
+   ivi->spoofchk = vf->spoofchk ? 1 : 0;
if (vf->state == VF_ENABLED) {
/* mac and vlan are in vlan_mac objects */
if (bnx2x_validate_vf_sp_objs(bp, vf, false)) {
@@ -2950,6 +2955,77 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, 
u16 vlan, u8 qos,
return rc;
 }
 
+int bnx2x_set_vf_spoofchk(struct net_device *dev, int idx, bool val)
+{
+   struct bnx2x *bp = netdev_priv(dev);
+   struct bnx2x_virtf *vf;
+   int i, rc = 0;
+
+   vf = BP_VF(bp, idx);
+   if (!vf)
+   return -EINVAL;
+
+   /* nothing to do */
+   if (vf->spoofchk == val)
+   return 0;
+
+   vf->spoofchk = val ? 1 : 0;
+
+   DP(BNX2X_MSG_IOV, "%s spoofchk for VF %d\n",
+  val ? "enabling" : "disabling", idx);
+
+   /* is vf initialized and queue set up? */
+   if (vf->state != VF_ENABLED ||
+   bnx2x_get_q_logical_state(bp, &bnx2x_leading_vfq(vf, sp_obj)) !=
+   BNX2X_Q_LOGICAL_STATE_ACTIVE)
+   return rc;
+
+   /* User should be able to see error in system logs */
+   if (!bnx2x_validate_vf_sp_objs(bp, vf, true))
+   return -EINVAL;
+
+   /* send queue update ramrods to configure spoofchk */
+   for_each_vfq(vf, i) {
+   struct bnx2x_queue_state_params q_params = {NULL};
+   struct bnx2x_queue_update_params *update_params;
+
+   q_params.q_obj = &bnx2x_vfq(vf, i, sp_obj);
+
+   /* validate the Q is UP */
+   if (bnx2x_get_q_

[PATCH net-next 2/3] bnx2x: Ignore bandwidth attention in single function mode

2018-09-20 Thread Shahed Shaikh
From: Shahed Shaikh 

This is a workaround for FW bug -
MFW generates bandwidth attention in single function mode, which
is only expected to be generated in multi function mode.
This undesired attention in SF mode results in incorrect HW
configuration and resulting into Tx timeout.

Signed-off-by: Shahed Shaikh 
Signed-off-by: Ariel Elior 
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index faf64ba..16f64c6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -3536,6 +3536,16 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
  */
 static void bnx2x_config_mf_bw(struct bnx2x *bp)
 {
+   /* Workaround for MFW bug.
+* MFW is not supposed to generate BW attention in
+* single function mode.
+*/
+   if (!IS_MF(bp)) {
+   DP(BNX2X_MSG_MCP,
+  "Ignoring MF BW config in single function mode\n");
+   return;
+   }
+
if (bp->link_vars.link_up) {
bnx2x_cmng_fns_init(bp, true, CMNG_FNS_MINMAX);
bnx2x_link_sync_notify(bp);
-- 
1.8.3.1



[PATCH net-next 3/3] bnx2x: Provide VF link status in ndo_get_vf_config

2018-09-20 Thread Shahed Shaikh
From: Shahed Shaikh 

Provide current link status of VF in ndo_get_vf_config
handler.

Signed-off-by: Shahed Shaikh 
Signed-off-by: Ariel Elior 
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2f76b37..c835f6c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2638,6 +2638,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,
ivi->max_tx_rate = 1; /* always 10G. TBA take from link struct */
ivi->min_tx_rate = 0;
ivi->spoofchk = vf->spoofchk ? 1 : 0;
+   ivi->linkstate = vf->link_cfg;
if (vf->state == VF_ENABLED) {
/* mac and vlan are in vlan_mac objects */
if (bnx2x_validate_vf_sp_objs(bp, vf, false)) {
-- 
1.8.3.1



[PATCH net 1/1] qed: Fix mask for physical address in ILT entry

2018-05-21 Thread Shahed Shaikh
ILT entry requires 12 bit right shifted physical address.
Existing mask for ILT entry of physical address i.e.
ILT_ENTRY_PHY_ADDR_MASK is not sufficient to handle 64bit
address because upper 8 bits of 64 bit address were getting
masked which resulted in completer abort error on
PCIe bus due to invalid address.

Fix that mask to handle 64bit physical address.

Fixes: fe56b9e6a8d9 ("qed: Add module with basic common support")

Signed-off-by: Shahed Shaikh 
Signed-off-by: Ariel Elior 
---
 drivers/net/ethernet/qlogic/qed/qed_cxt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c 
b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
index 00f41c1..820b226 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
@@ -77,7 +77,7 @@
 #define ILT_CFG_REG(cli, reg)  PSWRQ2_REG_ ## cli ## _ ## reg ## _RT_OFFSET
 
 /* ILT entry structure */
-#define ILT_ENTRY_PHY_ADDR_MASK0x000FFFULL
+#define ILT_ENTRY_PHY_ADDR_MASK(~0ULL >> 12)
 #define ILT_ENTRY_PHY_ADDR_SHIFT   0
 #define ILT_ENTRY_VALID_MASK   0x1ULL
 #define ILT_ENTRY_VALID_SHIFT  52
-- 
1.7.1



[PATCH net-next 0/2] qed* : Use trust mode to override forced MAC

2018-04-19 Thread Shahed Shaikh
Hi Dave,

This patchset adds a support to override forced MAC (MAC set by PF for a VF)
when trust mode is enabled using
#ip link set dev  vf  trust on

First patch adds a real change to use .ndo_set_vf_trust to override forced MAC
and allow user to change VFs from VF interface itself.

Second patch takes care of a corner case, where MAC change from VF won't
take effect when VF interface is down, by introducing a new TLV
(a way to send message from VF to PF) to give a hint to PF to update
its bulletin board.

Please apply this series to net-next.

Thanks,
Shahed

Shahed Shaikh (2):
  qed* : use trust mode to allow VF to override forced MAC
  qed* : Add new TLV to request PF to update MAC in bulletin board

 drivers/net/ethernet/qlogic/qed/qed_l2.c   |  19 ++
 drivers/net/ethernet/qlogic/qed/qed_sriov.c| 247 +++--
 drivers/net/ethernet/qlogic/qed/qed_vf.c   |  29 +++
 drivers/net/ethernet/qlogic/qed/qed_vf.h   |  21 +++
 drivers/net/ethernet/qlogic/qede/qede_filter.c |   7 +-
 include/linux/qed/qed_eth_if.h |   1 +
 6 files changed, 306 insertions(+), 18 deletions(-)

-- 
2.7.4



[PATCH net-next 1/2] qed* : use trust mode to allow VF to override forced MAC

2018-04-19 Thread Shahed Shaikh
As per existing behavior, when PF sets a MAC address for a VF
(also called as forced MAC), VF is not allowed to change its
MAC address afterwards.
This puts the limitation on few use cases such as bonding of VFs,
where bonding driver asks VF to change its MAC address.

This patch uses a VF trust mode to allow VF to change its MAC address
in spite PF has set a forced MAC for that VF.

Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qed/qed_sriov.c| 210 +++--
 drivers/net/ethernet/qlogic/qede/qede_filter.c |   3 +-
 2 files changed, 195 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c 
b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index 5acb91b..77376fd 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -48,7 +48,7 @@ static int qed_sriov_eqe_event(struct qed_hwfn *p_hwfn,
   u8 opcode,
   __le16 echo,
   union event_ring_data *data, u8 fw_return_code);
-
+static int qed_iov_bulletin_set_mac(struct qed_hwfn *p_hwfn, u8 *mac, int 
vfid);
 
 static u8 qed_vf_calculate_legacy(struct qed_vf_info *p_vf)
 {
@@ -1790,7 +1790,8 @@ static int qed_iov_configure_vport_forced(struct qed_hwfn 
*p_hwfn,
if (!p_vf->vport_instance)
return -EINVAL;
 
-   if (events & BIT(MAC_ADDR_FORCED)) {
+   if ((events & BIT(MAC_ADDR_FORCED)) ||
+   p_vf->p_vf_info.is_trusted_configured) {
/* Since there's no way [currently] of removing the MAC,
 * we can always assume this means we need to force it.
 */
@@ -1809,8 +1810,12 @@ static int qed_iov_configure_vport_forced(struct 
qed_hwfn *p_hwfn,
  "PF failed to configure MAC for VF\n");
return rc;
}
-
-   p_vf->configured_features |= 1 << MAC_ADDR_FORCED;
+   if (p_vf->p_vf_info.is_trusted_configured)
+   p_vf->configured_features |=
+   BIT(VFPF_BULLETIN_MAC_ADDR);
+   else
+   p_vf->configured_features |=
+   BIT(MAC_ADDR_FORCED);
}
 
if (events & BIT(VLAN_ADDR_FORCED)) {
@@ -3170,6 +3175,10 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn 
*p_hwfn,
if (p_vf->bulletin.p_virt->valid_bitmap & BIT(MAC_ADDR_FORCED))
return 0;
 
+   /* Don't keep track of shadow copy since we don't intend to restore. */
+   if (p_vf->p_vf_info.is_trusted_configured)
+   return 0;
+
/* First remove entries and then add new ones */
if (p_params->opcode == QED_FILTER_REMOVE) {
for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
@@ -3244,9 +3253,17 @@ static int qed_iov_chk_ucast(struct qed_hwfn *hwfn,
 
/* No real decision to make; Store the configured MAC */
if (params->type == QED_FILTER_MAC ||
-   params->type == QED_FILTER_MAC_VLAN)
+   params->type == QED_FILTER_MAC_VLAN) {
ether_addr_copy(vf->mac, params->mac);
 
+   if (vf->is_trusted_configured) {
+   qed_iov_bulletin_set_mac(hwfn, vf->mac, vfid);
+
+   /* Update and post bulleitin again */
+   qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG);
+   }
+   }
+
return 0;
 }
 
@@ -4081,16 +4098,60 @@ static void qed_iov_bulletin_set_forced_mac(struct 
qed_hwfn *p_hwfn,
return;
}
 
-   feature = 1 << MAC_ADDR_FORCED;
+   if (vf_info->p_vf_info.is_trusted_configured) {
+   feature = BIT(VFPF_BULLETIN_MAC_ADDR);
+   /* Trust mode will disable Forced MAC */
+   vf_info->bulletin.p_virt->valid_bitmap &=
+   ~BIT(MAC_ADDR_FORCED);
+   } else {
+   feature = BIT(MAC_ADDR_FORCED);
+   /* Forced MAC will disable MAC_ADDR */
+   vf_info->bulletin.p_virt->valid_bitmap &=
+   ~BIT(VFPF_BULLETIN_MAC_ADDR);
+   }
+
memcpy(vf_info->bulletin.p_virt->mac, mac, ETH_ALEN);
 
vf_info->bulletin.p_virt->valid_bitmap |= feature;
-   /* Forced MAC will disable MAC_ADDR */
-   vf_info->bulletin.p_virt->valid_bitmap &= ~BIT(VFPF_BULLETIN_MAC_ADDR);
 
qed_iov_configure_vport_forced(p_hwfn, vf_info, feature);
 }
 
+static int qed_iov_bulletin_set_mac(struct qed_hwfn *p_hwfn, u8 *mac, int vfid)
+{
+   struct qed_vf_info *vf_info;
+   u64 feature;
+
+   vf_info = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true);
+   if (!vf_info) {
+   DP_NOTICE(p_hwfn->

[PATCH net-next 2/2] qed* : Add new TLV to request PF to update MAC in bulletin board

2018-04-19 Thread Shahed Shaikh
There may be a need for VF driver to request PF to explicitly update its
bulletin with a MAC address.
e.g. When user assigns a MAC address to VF while VF is still down,
and PF's bulletin board contains different MAC address, in this case,
when VF's interface is brought up, it gets loaded with MAC address from
bulletin board which is not desirable.

To handle this corner case, we need a new TLV to request PF to update
its bulletin board with suggested MAC.

This request will be honored only for trusted VFs.

Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qed/qed_l2.c   | 19 +
 drivers/net/ethernet/qlogic/qed/qed_sriov.c| 37 ++
 drivers/net/ethernet/qlogic/qed/qed_vf.c   | 29 
 drivers/net/ethernet/qlogic/qed/qed_vf.h   | 21 +++
 drivers/net/ethernet/qlogic/qede/qede_filter.c |  4 +++
 include/linux/qed/qed_eth_if.h |  1 +
 6 files changed, 111 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c 
b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index e874504..8b1b7e8 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -2850,6 +2850,24 @@ static int qed_fp_cqe_completion(struct qed_dev *dev,
  cqe);
 }
 
+static int qed_req_bulletin_update_mac(struct qed_dev *cdev, u8 *mac)
+{
+   int i, ret;
+
+   if (IS_PF(cdev))
+   return 0;
+
+   for_each_hwfn(cdev, i) {
+   struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
+
+   ret = qed_vf_pf_bulletin_update_mac(p_hwfn, mac);
+   if (ret)
+   return ret;
+   }
+
+   return 0;
+}
+
 #ifdef CONFIG_QED_SRIOV
 extern const struct qed_iov_hv_ops qed_iov_ops_pass;
 #endif
@@ -2887,6 +2905,7 @@ static const struct qed_eth_ops qed_eth_ops_pass = {
.ntuple_filter_config = &qed_ntuple_arfs_filter_config,
.configure_arfs_searcher = &qed_configure_arfs_searcher,
.get_coalesce = &qed_get_coalesce,
+   .req_bulletin_update_mac = &qed_req_bulletin_update_mac,
 };
 
 const struct qed_eth_ops *qed_get_eth_ops(void)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c 
b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index 77376fd..f01bf52 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -3820,6 +3820,40 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
__qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);
 }
 
+static int
+qed_iov_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn,
+ struct qed_ptt *p_ptt,
+ struct qed_vf_info *p_vf)
+{
+   struct qed_bulletin_content *p_bulletin = p_vf->bulletin.p_virt;
+   struct qed_iov_vf_mbx *mbx = &p_vf->vf_mbx;
+   struct vfpf_bulletin_update_mac_tlv *p_req;
+   u8 status = PFVF_STATUS_SUCCESS;
+   int rc = 0;
+
+   if (!p_vf->p_vf_info.is_trusted_configured) {
+   DP_VERBOSE(p_hwfn,
+  QED_MSG_IOV,
+  "Blocking bulletin update request from untrusted 
VF[%d]\n",
+  p_vf->abs_vf_id);
+   status = PFVF_STATUS_NOT_SUPPORTED;
+   rc = -EINVAL;
+   goto send_status;
+   }
+
+   p_req = &mbx->req_virt->bulletin_update_mac;
+   ether_addr_copy(p_bulletin->mac, p_req->mac);
+   DP_VERBOSE(p_hwfn, QED_MSG_IOV,
+  "Updated bulletin of VF[%d] with requested MAC[%pM]\n",
+  p_vf->abs_vf_id, p_req->mac);
+
+send_status:
+   qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf,
+CHANNEL_TLV_BULLETIN_UPDATE_MAC,
+sizeof(struct pfvf_def_resp_tlv), status);
+   return rc;
+}
+
 static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, int vfid)
 {
@@ -3899,6 +3933,9 @@ static void qed_iov_process_mbx_req(struct qed_hwfn 
*p_hwfn,
case CHANNEL_TLV_COALESCE_READ:
qed_iov_vf_pf_get_coalesce(p_hwfn, p_ptt, p_vf);
break;
+   case CHANNEL_TLV_BULLETIN_UPDATE_MAC:
+   qed_iov_vf_pf_bulletin_update_mac(p_hwfn, p_ptt, p_vf);
+   break;
}
} else if (qed_iov_tlv_supported(mbx->first_tlv.tl.type)) {
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c 
b/drivers/net/ethernet/qlogic/qed/qed_vf.c
index 91b5e9f..2d7fcd6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c
@@ -1375,6 +1375,35 @@ int qed_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn,
 }
 
 int
+qed_vf_pf_bulletin_update_mac(

[PATCH net-next 4/6] qlcnic: Add new VF device ID 0x8C30

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

This is a 83xx series based VF device

Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h  |   12 
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |5 -
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index a861592..17f37b7 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -2290,8 +2290,9 @@ extern const struct ethtool_ops qlcnic_ethtool_failed_ops;
 
 #define PCI_DEVICE_ID_QLOGIC_QLE824X   0x8020
 #define PCI_DEVICE_ID_QLOGIC_QLE834X   0x8030
-#define PCI_DEVICE_ID_QLOGIC_QLE8830   0x8830
 #define PCI_DEVICE_ID_QLOGIC_VF_QLE834X0x8430
+#define PCI_DEVICE_ID_QLOGIC_QLE8830   0x8830
+#define PCI_DEVICE_ID_QLOGIC_VF_QLE8C300x8C30
 #define PCI_DEVICE_ID_QLOGIC_QLE844X   0x8040
 #define PCI_DEVICE_ID_QLOGIC_VF_QLE844X0x8440
 
@@ -2318,7 +2319,8 @@ static inline bool qlcnic_83xx_check(struct 
qlcnic_adapter *adapter)
  (device == PCI_DEVICE_ID_QLOGIC_QLE8830) ||
  (device == PCI_DEVICE_ID_QLOGIC_QLE844X) ||
  (device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X) ||
- (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X)) ? true : false;
+ (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
+ (device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
 
return status;
 }
@@ -2334,7 +2336,8 @@ static inline bool qlcnic_sriov_vf_check(struct 
qlcnic_adapter *adapter)
bool status;
 
status = ((device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
- (device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X)) ? true : false;
+ (device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X) ||
+ (device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
 
return status;
 }
@@ -2350,7 +2353,8 @@ static inline bool qlcnic_83xx_vf_check(struct 
qlcnic_adapter *adapter)
 {
unsigned short device = adapter->pdev->device;
 
-   return (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ? true : false;
+   return ((device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
+   (device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
 }
 
 static inline bool qlcnic_sriov_check(struct qlcnic_adapter *adapter)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index b714cee..8b08b20 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -110,8 +110,9 @@ static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter 
*adapter)
 static const struct pci_device_id qlcnic_pci_tbl[] = {
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE824X),
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE834X),
-   ENTRY(PCI_DEVICE_ID_QLOGIC_QLE8830),
ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE834X),
+   ENTRY(PCI_DEVICE_ID_QLOGIC_QLE8830),
+   ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE8C30),
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE844X),
ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE844X),
{0,}
@@ -1148,6 +1149,7 @@ static void qlcnic_get_bar_length(u32 dev_id, ulong *bar)
case PCI_DEVICE_ID_QLOGIC_QLE844X:
case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
case PCI_DEVICE_ID_QLOGIC_VF_QLE844X:
+   case PCI_DEVICE_ID_QLOGIC_VF_QLE8C30:
*bar = QLCNIC_83XX_BAR0_LENGTH;
break;
default:
@@ -2490,6 +2492,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
qlcnic_83xx_register_map(ahw);
break;
case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
+   case PCI_DEVICE_ID_QLOGIC_VF_QLE8C30:
case PCI_DEVICE_ID_QLOGIC_VF_QLE844X:
qlcnic_sriov_vf_register_map(ahw);
break;
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 3/6] qlcnic: Print firmware minidump buffer and template header addresses

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

Signed-off-by: Shahed Shaikh 
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c   |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index aca47fd..cda9e60 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -1388,8 +1388,9 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
fw_dump->clr = 1;
snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", adapter->netdev->name);
netdev_info(adapter->netdev,
-   "Dump data %d bytes captured, template header size %d 
bytes\n",
-   fw_dump->size, fw_dump->tmpl_hdr_size);
+   "Dump data %d bytes captured, dump data address = %p, 
template header size %d bytes, template address = %p\n",
+   fw_dump->size, fw_dump->data, fw_dump->tmpl_hdr_size,
+   fw_dump->tmpl_hdr);
/* Send a udev event to notify availability of FW dump */
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, msg);
 
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 2/6] qlcnic: Add support to enable capability to extend minidump for iSCSI

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

In some cases it is required to capture minidump for iSCSI functions
as part of default minidump collection process. To enable this, firmware
exports it's capability and driver need to enable that capability
by issuing a mailbox command.

With this feature, firmware can provide additional iSCSI function's
minidump with smaller minidump capture mask (0x1f).

Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h|1 +
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c|   26 
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h|1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h |1 +
 .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c   |   32 
 5 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index c6dca5d..a861592 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -924,6 +924,7 @@ struct qlcnic_mac_vlan_list {
 #define QLCNIC_FW_CAPABILITY_SET_DRV_VER   BIT_5
 #define QLCNIC_FW_CAPABILITY_2_BEACON  BIT_7
 #define QLCNIC_FW_CAPABILITY_2_PER_PORT_ESWITCH_CFGBIT_9
+#define QLCNIC_FW_CAPABILITY_2_EXT_ISCSI_DUMP  BIT_13
 
 #define QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD  BIT_0
 #define QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD  BIT_1
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 172192d..5ab3adf 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -119,6 +119,7 @@ static const struct qlcnic_mailbox_metadata 
qlcnic_83xx_mbx_tbl[] = {
{QLCNIC_CMD_DCB_QUERY_CAP, 1, 2},
{QLCNIC_CMD_DCB_QUERY_PARAM, 1, 50},
{QLCNIC_CMD_SET_INGRESS_ENCAP, 2, 1},
+   {QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP, 4, 1},
 };
 
 const u32 qlcnic_83xx_ext_reg_tbl[] = {
@@ -3514,6 +3515,31 @@ out:
qlcnic_free_mbx_args(&cmd);
 }
 
+#define QLCNIC_83XX_ADD_PORT0  BIT_0
+#define QLCNIC_83XX_ADD_PORT1  BIT_1
+#define QLCNIC_83XX_EXTENDED_MEM_SIZE  13 /* In MB */
+int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *adapter)
+{
+   struct qlcnic_cmd_args cmd;
+   int err;
+
+   err = qlcnic_alloc_mbx_args(&cmd, adapter,
+   QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP);
+   if (err)
+   return err;
+
+   cmd.req.arg[1] = (QLCNIC_83XX_ADD_PORT0 | QLCNIC_83XX_ADD_PORT1);
+   cmd.req.arg[2] = QLCNIC_83XX_EXTENDED_MEM_SIZE;
+   cmd.req.arg[3] = QLCNIC_83XX_EXTENDED_MEM_SIZE;
+
+   err = qlcnic_issue_cmd(adapter, &cmd);
+   if (err)
+   dev_err(&adapter->pdev->dev,
+   "failed to issue extend iSCSI minidump capability\n");
+
+   return err;
+}
+
 int qlcnic_83xx_reg_test(struct qlcnic_adapter *adapter)
 {
u32 major, minor, sub;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index 999a90e..331ae2c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -627,6 +627,7 @@ int qlcnic_83xx_set_port_eswitch_status(struct 
qlcnic_adapter *, int, int *);
 
 void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
 void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
+int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *);
 int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
 int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
 void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
index cbe2399..4bb33af 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
@@ -109,6 +109,7 @@ enum qlcnic_regs {
 #define QLCNIC_CMD_GET_LED_CONFIG  0x6A
 #define QLCNIC_CMD_83XX_SET_DRV_VER0x6F
 #define QLCNIC_CMD_ADD_RCV_RINGS   0x0B
+#define QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP  0x37
 
 #define QLCNIC_INTRPT_INTX 1
 #define QLCNIC_INTRPT_MSIX 3
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index 6f33e2d..aca47fd 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -1396,19 +1396,51 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
return 0;
 }
 
+static inline bool
+qlcnic_83xx_md_check_extended_dump_capability(struct qlcnic_adapter *adapter)
+{
+   /* For special adapters (with 0x8830 device ID), where iSCSI firmware
+

[PATCH net-next 6/6] qlcnic: Update version to 5.3.63

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 17f37b7..06bcc73 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -37,8 +37,8 @@
 
 #define _QLCNIC_LINUX_MAJOR 5
 #define _QLCNIC_LINUX_MINOR 3
-#define _QLCNIC_LINUX_SUBVERSION 62
-#define QLCNIC_LINUX_VERSIONID  "5.3.62"
+#define _QLCNIC_LINUX_SUBVERSION 63
+#define QLCNIC_LINUX_VERSIONID  "5.3.63"
 #define QLCNIC_DRV_IDC_VER  0x01
 #define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 0/6] qlcnic: enhancements

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

Hi Dave,

This series adds few enhancements.

  o Patch from Harish reorders the sequence of header files inclusion,
keeping kernel's header files on top.

  o Firmware introduced a new feature which allows driver to increases
the size of firmware dump of iSCSI function which is being collected
by NIC driver.

  o Print buffer address which is holding a firmware dump.

  o Use vzalloc() instead kzalloc() for allocating large chunk of memory
which will avoid potential memory allocation failure.

  o Add new device ID for 0x8C30 which is a 83xx series based VF function.

Please apply this series to net-next.

Thanks,
Shahed

Harish Patil (1):
  qlcnic: Rearrange ordering of header files inclusion

Shahed Shaikh (5):
  qlcnic: Add support to enable capability to extend minidump for iSCSI
  qlcnic: Print firmware minidump buffer and template header addresses
  qlcnic: Add new VF device ID 0x8C30
  qlcnic: Don't use kzalloc unncecessarily for allocating large chunk
of memory
  qlcnic: Update version to 5.3.63

 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h|   19 +
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c|   31 ++-
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h|2 +
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c  |4 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c |6 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h |1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |   14 ---
 .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c   |   41 ++--
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h  |3 +-
 .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c   |3 +-
 .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c   |3 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c  |7 +--
 12 files changed, 102 insertions(+), 32 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 5/6] qlcnic: Don't use kzalloc unncecessarily for allocating large chunk of memory

2015-08-07 Thread Shahed Shaikh
From: Shahed Shaikh 

Driver allocates a large chunk of temporary buffer using kzalloc
to copy FW image. As there is no real need of this memory to be
physically contiguous, use vzalloc instead.

Signed-off-by: Shahed Shaikh 
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c  |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 753ea8b..bf89216 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter 
*adapter)
size_t size;
u64 addr;
 
-   temp = kzalloc(fw->size, GFP_KERNEL);
+   temp = vzalloc(fw->size);
if (!temp) {
release_firmware(fw);
fw_info->fw = NULL;
@@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter 
*adapter)
 exit:
release_firmware(fw);
fw_info->fw = NULL;
-   kfree(temp);
+   vfree(temp);
 
return ret;
 }
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 1/6] qlcnic: Rearrange ordering of header files inclusion

2015-08-07 Thread Shahed Shaikh
From: Harish Patil 

Include local headers files after kernel's header files.

Signed-off-by: Harish Patil 
Signed-off-by: Shahed Shaikh 
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h|2 --
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c|5 +++--
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h|1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c |6 +++---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |9 -
 .../net/ethernet/qlogic/qlcnic/qlcnic_minidump.c   |4 ++--
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h  |3 ++-
 .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c   |3 ++-
 .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c   |3 ++-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c  |7 +++
 10 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 055f376..c6dca5d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -24,9 +24,7 @@
 #include 
 #include 
 #include 
-
 #include 
-
 #include 
 #include 
 #include 
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 840bf36..172192d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -5,14 +5,15 @@
  * See LICENSE.qlcnic for copyright and licensing details.
  */
 
-#include "qlcnic.h"
-#include "qlcnic_sriov.h"
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include "qlcnic.h"
+#include "qlcnic_sriov.h"
+
 static void __qlcnic_83xx_process_aen(struct qlcnic_adapter *);
 static int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *, u8);
 static void qlcnic_83xx_configure_mac(struct qlcnic_adapter *, u8 *, u8,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index 69f828e..999a90e 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+
 #include "qlcnic_hw.h"
 
 #define QLCNIC_83XX_BAR0_LENGTH 0x4000
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 75ee9e4..509b596 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -5,13 +5,13 @@
  * See LICENSE.qlcnic for copyright and licensing details.
  */
 
-#include "qlcnic.h"
-#include "qlcnic_hdr.h"
-
 #include 
 #include 
 #include 
 
+#include "qlcnic.h"
+#include "qlcnic_hdr.h"
+
 #define MASK(n) ((1ULL<<(n))-1)
 #define OCM_WIN_P3P(addr) (addr & 0xffc)
 
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 7dbab3c..b714cee 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -7,11 +7,6 @@
 
 #include 
 #include 
-
-#include "qlcnic.h"
-#include "qlcnic_sriov.h"
-#include "qlcnic_hw.h"
-
 #include 
 #include 
 #include 
@@ -25,6 +20,10 @@
 #include 
 #endif
 
+#include "qlcnic.h"
+#include "qlcnic_sriov.h"
+#include "qlcnic_hw.h"
+
 MODULE_DESCRIPTION("QLogic 1/10 GbE Converged/Intelligent Ethernet Driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(QLCNIC_LINUX_VERSIONID);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index 332bb8a..6f33e2d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -5,13 +5,13 @@
  * See LICENSE.qlcnic for copyright and licensing details.
  */
 
+#include 
+
 #include "qlcnic.h"
 #include "qlcnic_hdr.h"
 #include "qlcnic_83xx_hw.h"
 #include "qlcnic_hw.h"
 
-#include 
-
 #define QLC_83XX_MINIDUMP_FLASH0x52
 #define QLC_83XX_OCM_INDEX 3
 #define QLC_83XX_PCI_INDEX 0
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
index 4677b2e..017d8c2 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h
@@ -8,10 +8,11 @@
 #ifndef _QLCNIC_83XX_SRIOV_H_
 #define _QLCNIC_83XX_SRIOV_H_
 
-#include "qlcnic.h"
 #include 
 #include 
 
+#include "qlcnic.h"
+
 extern const u32 qlcnic_83xx_reg_tbl[];
 extern const u32 qlcnic_83xx_ext_reg_tbl[];
 
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
index e631246..546

[PATCH net 1/1] qlcnic: Fix corruption while copying

2015-07-29 Thread Shahed Shaikh
From: Shahed Shaikh 

Use proper typecasting while performing byte-by-byte copy

Signed-off-by: Shahed Shaikh 
---
Hi Dave,

Please apply this patch to net.

Thanks,
Shahed
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c  |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c 
b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 78acec4..bf89216 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -1415,7 +1415,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter 
*adapter)
if (fw->size & 0xF) {
addr = dest + size;
for (i = 0; i < (fw->size & 0xF); i++)
-   data[i] = temp[size + i];
+   data[i] = ((u8 *)temp)[size + i];
for (; i < 16; i++)
data[i] = 0;
ret = qlcnic_ms_mem_write128(adapter, addr,
-- 
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] net: qlcnic: Deletion of unnecessary memset

2015-07-14 Thread Shahed Shaikh
> -Original Message-
> From: Christophe JAILLET [mailto:christophe.jail...@wanadoo.fr]
> Sent: Tuesday, July 14, 2015 1:22 AM
> To: Shahed Shaikh; Dept-GE Linux NIC Dev
> Cc: netdev; linux-kernel; kernel-janit...@vger.kernel.org; Christophe JAILLET
> Subject: [PATCH] net: qlcnic: Deletion of unnecessary memset
> 
> There is no need to memset memory allocated with vzalloc.
> 
> Signed-off-by: Christophe JAILLET 
> ---
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> index 2f6cc42..7dbab3c 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -2403,7 +2403,6 @@ int qlcnic_alloc_tx_rings(struct qlcnic_adapter
> *adapter,
>   qlcnic_free_tx_rings(adapter);
>   return -ENOMEM;
>   }
> - memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
>   tx_ring->cmd_buf_arr = cmd_buf_arr;
>   spin_lock_init(&tx_ring->tx_clean_lock);
>   }

Acked-by: Shahed Shaikh 

Thanks,
Shahed
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html