Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fac865d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'qlcnic'



Himanshu Madhani says:

====================
qlcnic: Refactoring and enhancements for all adapters.

This patch series contains following patches.

o Enhanced debug data collection when we are in Tx-timeout situation.
o Enhanced MSI-x vector calculation for defualt load path as well
  as for TSS/RSS ring change path.
o Refactored interrupt coalescing code for all adapters.
o Refactored interrupt handling as well as cleanup of poll controller
  code patch for all adapters.
o changed rx_mac_learn type to boolean.

Please apply to net-next.
====================

Signed-off-by: default avatarZoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0681a282 18cae184
Loading
Loading
Loading
Loading
+110 −19
Original line number Diff line number Diff line
@@ -38,8 +38,8 @@

#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 3
#define _QLCNIC_LINUX_SUBVERSION 54
#define QLCNIC_LINUX_VERSIONID  "5.3.54"
#define _QLCNIC_LINUX_SUBVERSION 55
#define QLCNIC_LINUX_VERSIONID  "5.3.55"
#define QLCNIC_DRV_IDC_VER  0x01
#define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
		 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -105,6 +105,8 @@
#define QLCNIC_DEF_TX_RINGS		4
#define QLCNIC_MAX_VNIC_TX_RINGS	4
#define QLCNIC_MAX_VNIC_SDS_RINGS	4
#define QLCNIC_83XX_MINIMUM_VECTOR	3
#define QLCNIC_82XX_MINIMUM_VECTOR	2

enum qlcnic_queue_type {
	QLCNIC_TX_QUEUE = 1,
@@ -369,6 +371,7 @@ struct qlcnic_rx_buffer {
 */
#define QLCNIC_INTR_COAL_TYPE_RX		1
#define QLCNIC_INTR_COAL_TYPE_TX		2
#define QLCNIC_INTR_COAL_TYPE_RX_TX		3

#define QLCNIC_DEF_INTR_COALESCE_RX_TIME_US	3
#define QLCNIC_DEF_INTR_COALESCE_RX_PACKETS	256
@@ -961,6 +964,7 @@ struct qlcnic_ipaddr {
#define QLCNIC_TX_INTR_SHARED		0x10000
#define QLCNIC_APP_CHANGED_FLAGS	0x20000
#define QLCNIC_HAS_PHYS_PORT_ID		0x40000
#define QLCNIC_TSS_RSS			0x80000

#define QLCNIC_IS_MSI_FAMILY(adapter) \
	((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
@@ -1057,6 +1061,9 @@ struct qlcnic_adapter {
	u8 drv_tx_rings;  /* max tx rings supported by driver */
	u8 drv_sds_rings; /* max sds rings supported by driver */

	u8 drv_tss_rings; /* tss ring input */
	u8 drv_rss_rings; /* rss ring input */

	u8 rx_csum;
	u8 portnum;

@@ -1082,7 +1089,7 @@ struct qlcnic_adapter {
	u64 dev_rst_time;
	bool drv_mac_learn;
	bool fdb_mac_learn;
	u8 rx_mac_learn;
	bool rx_mac_learn;
	unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)];
	u8 flash_mfg_id;
	struct qlcnic_npar_info *npars;
@@ -1573,7 +1580,7 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int);
netdev_tx_t qlcnic_xmit_frame(struct sk_buff *, struct net_device *);
void qlcnic_set_tx_ring_count(struct qlcnic_adapter *, u8);
void qlcnic_set_sds_ring_count(struct qlcnic_adapter *, u8);
int qlcnic_setup_rings(struct qlcnic_adapter *, u8, u8);
int qlcnic_setup_rings(struct qlcnic_adapter *);
int qlcnic_validate_rings(struct qlcnic_adapter *, __u32, int);
void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter);
int qlcnic_enable_msix(struct qlcnic_adapter *, u32);
@@ -1613,7 +1620,7 @@ void qlcnic_set_vlan_config(struct qlcnic_adapter *,
			    struct qlcnic_esw_func_cfg *);
void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *,
				      struct qlcnic_esw_func_cfg *);

int qlcnic_setup_tss_rss_intr(struct qlcnic_adapter  *);
void qlcnic_down(struct qlcnic_adapter *, struct net_device *);
int qlcnic_up(struct qlcnic_adapter *, struct net_device *);
void __qlcnic_down(struct qlcnic_adapter *, struct net_device *);
@@ -1670,10 +1677,7 @@ static inline int qlcnic_set_real_num_queues(struct qlcnic_adapter *adapter,

	err = netif_set_real_num_tx_queues(netdev, adapter->drv_tx_rings);
	if (err)
		dev_err(&adapter->pdev->dev, "failed to set %d Tx queues\n",
			adapter->drv_tx_rings);
	else
		dev_info(&adapter->pdev->dev, "Set %d Tx queues\n",
		netdev_err(netdev, "failed to set %d Tx queues\n",
			   adapter->drv_tx_rings);

	return err;
@@ -1740,7 +1744,8 @@ struct qlcnic_hardware_ops {
	int (*change_macvlan) (struct qlcnic_adapter *, u8*, u16, u8);
	void (*napi_enable) (struct qlcnic_adapter *);
	void (*napi_disable) (struct qlcnic_adapter *);
	void (*config_intr_coal) (struct qlcnic_adapter *);
	int (*config_intr_coal) (struct qlcnic_adapter *,
				 struct ethtool_coalesce *);
	int (*config_rss) (struct qlcnic_adapter *, int);
	int (*config_hw_lro) (struct qlcnic_adapter *, int);
	int (*config_loopback) (struct qlcnic_adapter *, u8);
@@ -1756,6 +1761,14 @@ struct qlcnic_hardware_ops {
	pci_ers_result_t (*io_slot_reset) (struct pci_dev *);
	void (*io_resume) (struct pci_dev *);
	void (*get_beacon_state)(struct qlcnic_adapter *);
	void (*enable_sds_intr) (struct qlcnic_adapter *,
				 struct qlcnic_host_sds_ring *);
	void (*disable_sds_intr) (struct qlcnic_adapter *,
				  struct qlcnic_host_sds_ring *);
	void (*enable_tx_intr) (struct qlcnic_adapter *,
				struct qlcnic_host_tx_ring *);
	void (*disable_tx_intr) (struct qlcnic_adapter *,
				 struct qlcnic_host_tx_ring *);
};

extern struct qlcnic_nic_template qlcnic_vf_ops;
@@ -1928,9 +1941,10 @@ static inline void qlcnic_napi_disable(struct qlcnic_adapter *adapter)
	adapter->ahw->hw_ops->napi_disable(adapter);
}

static inline void qlcnic_config_intr_coalesce(struct qlcnic_adapter *adapter)
static inline int qlcnic_config_intr_coalesce(struct qlcnic_adapter *adapter,
					      struct ethtool_coalesce *ethcoal)
{
	adapter->ahw->hw_ops->config_intr_coal(adapter);
	return adapter->ahw->hw_ops->config_intr_coal(adapter, ethcoal);
}

static inline int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable)
@@ -2029,6 +2043,54 @@ static inline bool qlcnic_check_multi_tx(struct qlcnic_adapter *adapter)
	return test_bit(__QLCNIC_MULTI_TX_UNIQUE, &adapter->state);
}

static inline void
qlcnic_82xx_enable_tx_intr(struct qlcnic_adapter *adapter,
			   struct qlcnic_host_tx_ring *tx_ring)
{
	if (qlcnic_check_multi_tx(adapter) &&
	    !adapter->ahw->diag_test)
		writel(0x0, tx_ring->crb_intr_mask);
}

static inline void
qlcnic_82xx_disable_tx_intr(struct qlcnic_adapter *adapter,
			    struct qlcnic_host_tx_ring *tx_ring)
{
	if (qlcnic_check_multi_tx(adapter) &&
	    !adapter->ahw->diag_test)
		writel(1, tx_ring->crb_intr_mask);
}

static inline void
qlcnic_83xx_enable_tx_intr(struct qlcnic_adapter *adapter,
			   struct qlcnic_host_tx_ring *tx_ring)
{
	writel(0, tx_ring->crb_intr_mask);
}

static inline void
qlcnic_83xx_disable_tx_intr(struct qlcnic_adapter *adapter,
			    struct qlcnic_host_tx_ring *tx_ring)
{
	writel(1, tx_ring->crb_intr_mask);
}

/* Enable MSI-x and INT-x interrupts */
static inline void
qlcnic_83xx_enable_sds_intr(struct qlcnic_adapter *adapter,
			    struct qlcnic_host_sds_ring *sds_ring)
{
	writel(0, sds_ring->crb_intr_mask);
}

/* Disable MSI-x and INT-x interrupts */
static inline void
qlcnic_83xx_disable_sds_intr(struct qlcnic_adapter *adapter,
			     struct qlcnic_host_sds_ring *sds_ring)
{
	writel(1, sds_ring->crb_intr_mask);
}

static inline void qlcnic_disable_multi_tx(struct qlcnic_adapter *adapter)
{
	test_and_clear_bit(__QLCNIC_MULTI_TX_UNIQUE, &adapter->state);
@@ -2038,10 +2100,10 @@ static inline void qlcnic_disable_multi_tx(struct qlcnic_adapter *adapter)
/* When operating in a muti tx mode, driver needs to write 0x1
 * to src register, instead of 0x0 to disable receiving interrupt.
 */
static inline void qlcnic_disable_int(struct qlcnic_host_sds_ring *sds_ring)
static inline void
qlcnic_82xx_disable_sds_intr(struct qlcnic_adapter *adapter,
			     struct qlcnic_host_sds_ring *sds_ring)
{
	struct qlcnic_adapter *adapter = sds_ring->adapter;

	if (qlcnic_check_multi_tx(adapter) &&
	    !adapter->ahw->diag_test &&
	    (adapter->flags & QLCNIC_MSIX_ENABLED))
@@ -2050,13 +2112,42 @@ static inline void qlcnic_disable_int(struct qlcnic_host_sds_ring *sds_ring)
		writel(0, sds_ring->crb_intr_mask);
}

static inline void qlcnic_enable_sds_intr(struct qlcnic_adapter *adapter,
					  struct qlcnic_host_sds_ring *sds_ring)
{
	if (adapter->ahw->hw_ops->enable_sds_intr)
		adapter->ahw->hw_ops->enable_sds_intr(adapter, sds_ring);
}

static inline void
qlcnic_disable_sds_intr(struct qlcnic_adapter *adapter,
			struct qlcnic_host_sds_ring *sds_ring)
{
	if (adapter->ahw->hw_ops->disable_sds_intr)
		adapter->ahw->hw_ops->disable_sds_intr(adapter, sds_ring);
}

static inline void qlcnic_enable_tx_intr(struct qlcnic_adapter *adapter,
					 struct qlcnic_host_tx_ring *tx_ring)
{
	if (adapter->ahw->hw_ops->enable_tx_intr)
		adapter->ahw->hw_ops->enable_tx_intr(adapter, tx_ring);
}

static inline void qlcnic_disable_tx_intr(struct qlcnic_adapter *adapter,
					  struct qlcnic_host_tx_ring *tx_ring)
{
	if (adapter->ahw->hw_ops->disable_tx_intr)
		adapter->ahw->hw_ops->disable_tx_intr(adapter, tx_ring);
}

/* When operating in a muti tx mode, driver needs to write 0x0
 * to src register, instead of 0x1 to enable receiving interrupts.
 */
static inline void qlcnic_enable_int(struct qlcnic_host_sds_ring *sds_ring)
static inline void
qlcnic_82xx_enable_sds_intr(struct qlcnic_adapter *adapter,
			    struct qlcnic_host_sds_ring *sds_ring)
{
	struct qlcnic_adapter *adapter = sds_ring->adapter;

	if (qlcnic_check_multi_tx(adapter) &&
	    !adapter->ahw->diag_test &&
	    (adapter->flags & QLCNIC_MSIX_ENABLED))
+173 −62
Original line number Diff line number Diff line
@@ -199,6 +199,11 @@ static struct qlcnic_hardware_ops qlcnic_83xx_hw_ops = {
	.io_slot_reset			= qlcnic_83xx_io_slot_reset,
	.io_resume			= qlcnic_83xx_io_resume,
	.get_beacon_state		= qlcnic_83xx_get_beacon_state,
	.enable_sds_intr		= qlcnic_83xx_enable_sds_intr,
	.disable_sds_intr		= qlcnic_83xx_disable_sds_intr,
	.enable_tx_intr			= qlcnic_83xx_enable_tx_intr,
	.disable_tx_intr		= qlcnic_83xx_disable_tx_intr,

};

static struct qlcnic_nic_template qlcnic_83xx_ops = {
@@ -285,11 +290,22 @@ int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *adapter, ulong addr,
	}
}

int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
static void qlcnic_83xx_enable_legacy(struct qlcnic_adapter *adapter)
{
	int err, i, num_msix;
	struct qlcnic_hardware_context *ahw = adapter->ahw;

	/* MSI-X enablement failed, use legacy interrupt */
	adapter->tgt_status_reg = ahw->pci_base0 + QLC_83XX_INTX_PTR;
	adapter->tgt_mask_reg = ahw->pci_base0 + QLC_83XX_INTX_MASK;
	adapter->isr_int_vec = ahw->pci_base0 + QLC_83XX_INTX_TRGR;
	adapter->msix_entries[0].vector = adapter->pdev->irq;
	dev_info(&adapter->pdev->dev, "using legacy interrupt\n");
}

static int qlcnic_83xx_calculate_msix_vector(struct qlcnic_adapter *adapter)
{
	int num_msix;

	num_msix = adapter->drv_sds_rings;

	/* account for AEN interrupt MSI-X based interrupts */
@@ -298,30 +314,44 @@ int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
	if (!(adapter->flags & QLCNIC_TX_INTR_SHARED))
		num_msix += adapter->drv_tx_rings;

	return num_msix;
}

int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
{
	struct qlcnic_hardware_context *ahw = adapter->ahw;
	int err, i, num_msix;

	if (adapter->flags & QLCNIC_TSS_RSS) {
		err = qlcnic_setup_tss_rss_intr(adapter);
		if (err < 0)
			return err;
		num_msix = ahw->num_msix;
	} else {
		num_msix = qlcnic_83xx_calculate_msix_vector(adapter);

		err = qlcnic_enable_msix(adapter, num_msix);
		if (err == -ENOMEM)
			return err;
	if (adapter->flags & QLCNIC_MSIX_ENABLED)
		num_msix = adapter->ahw->num_msix;
	else {

		if (adapter->flags & QLCNIC_MSIX_ENABLED) {
			num_msix = ahw->num_msix;
		} else {
			if (qlcnic_sriov_vf_check(adapter))
				return -EINVAL;
			num_msix = 1;
			adapter->drv_tx_rings = QLCNIC_SINGLE_RING;
		}
	}

	/* setup interrupt mapping table for fw */
	ahw->intr_tbl = vzalloc(num_msix *
				sizeof(struct qlcnic_intrpt_config));
	if (!ahw->intr_tbl)
		return -ENOMEM;
	if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
		/* MSI-X enablement failed, use legacy interrupt */
		adapter->tgt_status_reg = ahw->pci_base0 + QLC_83XX_INTX_PTR;
		adapter->tgt_mask_reg = ahw->pci_base0 + QLC_83XX_INTX_MASK;
		adapter->isr_int_vec = ahw->pci_base0 + QLC_83XX_INTX_TRGR;
		adapter->msix_entries[0].vector = adapter->pdev->irq;
		dev_info(&adapter->pdev->dev, "using legacy interrupt\n");
	}

	if (!(adapter->flags & QLCNIC_MSIX_ENABLED))
		qlcnic_83xx_enable_legacy(adapter);

	for (i = 0; i < num_msix; i++) {
		if (adapter->flags & QLCNIC_MSIX_ENABLED)
@@ -331,6 +361,7 @@ int qlcnic_83xx_setup_intr(struct qlcnic_adapter *adapter)
		ahw->intr_tbl[i].id = i;
		ahw->intr_tbl[i].src = 0;
	}

	return 0;
}

@@ -345,20 +376,6 @@ static inline void qlcnic_83xx_set_legacy_intr_mask(struct qlcnic_adapter *adapt
		writel(1, adapter->tgt_mask_reg);
}

/* Enable MSI-x and INT-x interrupts */
void qlcnic_83xx_enable_intr(struct qlcnic_adapter *adapter,
			     struct qlcnic_host_sds_ring *sds_ring)
{
	writel(0, sds_ring->crb_intr_mask);
}

/* Disable MSI-x and INT-x interrupts */
void qlcnic_83xx_disable_intr(struct qlcnic_adapter *adapter,
			      struct qlcnic_host_sds_ring *sds_ring)
{
	writel(1, sds_ring->crb_intr_mask);
}

static inline void qlcnic_83xx_enable_legacy_msix_mbx_intr(struct qlcnic_adapter
						    *adapter)
{
@@ -496,7 +513,7 @@ irqreturn_t qlcnic_83xx_tmp_intr(int irq, void *data)

done:
	adapter->ahw->diag_cnt++;
	qlcnic_83xx_enable_intr(adapter, sds_ring);
	qlcnic_enable_sds_intr(adapter, sds_ring);

	return IRQ_HANDLED;
}
@@ -1295,7 +1312,7 @@ int qlcnic_83xx_create_tx_ctx(struct qlcnic_adapter *adapter,
	/* send the mailbox command*/
	err = qlcnic_issue_cmd(adapter, &cmd);
	if (err) {
		dev_err(&adapter->pdev->dev,
		netdev_err(adapter->netdev,
			   "Failed to create Tx ctx in firmware 0x%x\n", err);
		goto out;
	}
@@ -1307,7 +1324,8 @@ int qlcnic_83xx_create_tx_ctx(struct qlcnic_adapter *adapter,
		intr_mask = ahw->intr_tbl[adapter->drv_sds_rings + ring].src;
		tx->crb_intr_mask = ahw->pci_base0 + intr_mask;
	}
	dev_info(&adapter->pdev->dev, "Tx Context[0x%x] Created, state:0x%x\n",
	netdev_info(adapter->netdev,
		    "Tx Context[0x%x] Created, state:0x%x\n",
		    tx->ctx_id, mbx_out->state);
out:
	qlcnic_free_mbx_args(&cmd);
@@ -1360,7 +1378,7 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,
	if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) {
		for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
			sds_ring = &adapter->recv_ctx->sds_rings[ring];
			qlcnic_83xx_enable_intr(adapter, sds_ring);
			qlcnic_enable_sds_intr(adapter, sds_ring);
		}
	}

@@ -1385,7 +1403,7 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,
		for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
			sds_ring = &adapter->recv_ctx->sds_rings[ring];
			if (adapter->flags & QLCNIC_MSIX_ENABLED)
				qlcnic_83xx_disable_intr(adapter, sds_ring);
				qlcnic_disable_sds_intr(adapter, sds_ring);
		}
	}

@@ -1637,7 +1655,7 @@ static void qlcnic_83xx_set_interface_id_promisc(struct qlcnic_adapter *adapter,
	if (qlcnic_sriov_pf_check(adapter)) {
		qlcnic_alloc_lb_filters_mem(adapter);
		qlcnic_pf_set_interface_id_promisc(adapter, interface_id);
		adapter->rx_mac_learn = 1;
		adapter->rx_mac_learn = true;
	} else {
		if (!qlcnic_sriov_vf_check(adapter))
			*interface_id = adapter->recv_ctx->context_id << 16;
@@ -2111,37 +2129,130 @@ int qlcnic_83xx_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac,
	return err;
}

void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *adapter)
static int qlcnic_83xx_set_rx_intr_coal(struct qlcnic_adapter *adapter)
{
	int err;
	u16 temp;
	struct qlcnic_cmd_args cmd;
	struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal;

	if (adapter->recv_ctx->state == QLCNIC_HOST_CTX_STATE_FREED)
		return;
	struct qlcnic_cmd_args cmd;
	u16 temp;
	int err;

	err = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIG_INTR_COAL);
	if (err)
		return;
		return err;

	if (coal->type == QLCNIC_INTR_COAL_TYPE_RX) {
	temp = adapter->recv_ctx->context_id;
	cmd.req.arg[1] = QLCNIC_INTR_COAL_TYPE_RX | temp << 16;
	temp = coal->rx_time_us;
	cmd.req.arg[2] = coal->rx_packets | temp << 16;
	} else if (coal->type == QLCNIC_INTR_COAL_TYPE_TX) {
	cmd.req.arg[3] = coal->flag;

	err = qlcnic_issue_cmd(adapter, &cmd);
	if (err != QLCNIC_RCODE_SUCCESS)
		netdev_err(adapter->netdev,
			   "failed to set interrupt coalescing parameters\n");

	qlcnic_free_mbx_args(&cmd);

	return err;
}

static int qlcnic_83xx_set_tx_intr_coal(struct qlcnic_adapter *adapter)
{
	struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal;
	struct qlcnic_cmd_args cmd;
	u16 temp;
	int err;

	err = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIG_INTR_COAL);
	if (err)
		return err;

	temp = adapter->tx_ring->ctx_id;
	cmd.req.arg[1] = QLCNIC_INTR_COAL_TYPE_TX | temp << 16;
	temp = coal->tx_time_us;
	cmd.req.arg[2] = coal->tx_packets | temp << 16;
	}
	cmd.req.arg[3] = coal->flag;

	err = qlcnic_issue_cmd(adapter, &cmd);
	if (err != QLCNIC_RCODE_SUCCESS)
		dev_info(&adapter->pdev->dev,
			 "Failed to send interrupt coalescence parameters\n");
		netdev_err(adapter->netdev,
			   "failed to set interrupt coalescing  parameters\n");

	qlcnic_free_mbx_args(&cmd);

	return err;
}

int qlcnic_83xx_set_rx_tx_intr_coal(struct qlcnic_adapter *adapter)
{
	int err = 0;

	err = qlcnic_83xx_set_rx_intr_coal(adapter);
	if (err)
		netdev_err(adapter->netdev,
			   "failed to set Rx coalescing parameters\n");

	err = qlcnic_83xx_set_tx_intr_coal(adapter);
	if (err)
		netdev_err(adapter->netdev,
			   "failed to set Tx coalescing parameters\n");

	return err;
}

int qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *adapter,
				 struct ethtool_coalesce *ethcoal)
{
	struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal;
	u32 rx_coalesce_usecs, rx_max_frames;
	u32 tx_coalesce_usecs, tx_max_frames;
	int err;

	if (adapter->recv_ctx->state == QLCNIC_HOST_CTX_STATE_FREED)
		return -EIO;

	tx_coalesce_usecs = ethcoal->tx_coalesce_usecs;
	tx_max_frames = ethcoal->tx_max_coalesced_frames;
	rx_coalesce_usecs = ethcoal->rx_coalesce_usecs;
	rx_max_frames = ethcoal->rx_max_coalesced_frames;
	coal->flag = QLCNIC_INTR_DEFAULT;

	if ((coal->rx_time_us == rx_coalesce_usecs) &&
	    (coal->rx_packets == rx_max_frames)) {
		coal->type = QLCNIC_INTR_COAL_TYPE_TX;
		coal->tx_time_us = tx_coalesce_usecs;
		coal->tx_packets = tx_max_frames;
	} else if ((coal->tx_time_us == tx_coalesce_usecs) &&
		   (coal->tx_packets == tx_max_frames)) {
		coal->type = QLCNIC_INTR_COAL_TYPE_RX;
		coal->rx_time_us = rx_coalesce_usecs;
		coal->rx_packets = rx_max_frames;
	} else {
		coal->type = QLCNIC_INTR_COAL_TYPE_RX_TX;
		coal->rx_time_us = rx_coalesce_usecs;
		coal->rx_packets = rx_max_frames;
		coal->tx_time_us = tx_coalesce_usecs;
		coal->tx_packets = tx_max_frames;
	}

	switch (coal->type) {
	case QLCNIC_INTR_COAL_TYPE_RX:
		err = qlcnic_83xx_set_rx_intr_coal(adapter);
		break;
	case QLCNIC_INTR_COAL_TYPE_TX:
		err = qlcnic_83xx_set_tx_intr_coal(adapter);
		break;
	case QLCNIC_INTR_COAL_TYPE_RX_TX:
		err = qlcnic_83xx_set_rx_tx_intr_coal(adapter);
		break;
	default:
		err = -EINVAL;
		netdev_err(adapter->netdev,
			   "Invalid Interrupt coalescing type\n");
		break;
	}

	return err;
}

static void qlcnic_83xx_handle_link_aen(struct qlcnic_adapter *adapter,
+3 −6
Original line number Diff line number Diff line
@@ -547,7 +547,6 @@ 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);
int qlcnic_83xx_config_intr_coalesce(struct qlcnic_adapter *);
void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *, u64 *, u16);
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 *);
@@ -577,17 +576,15 @@ int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *,
void qlcnic_free_mbx_args(struct qlcnic_cmd_args *);
void qlcnic_set_npar_data(struct qlcnic_adapter *, const struct qlcnic_info *,
			  struct qlcnic_info *);
void qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *);
int qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *,
				 struct ethtool_coalesce *);
int qlcnic_83xx_set_rx_tx_intr_coal(struct qlcnic_adapter *);
int qlcnic_83xx_get_port_info(struct qlcnic_adapter *);
void qlcnic_83xx_enable_mbx_interrupt(struct qlcnic_adapter *);
void qlcnic_83xx_disable_mbx_intr(struct qlcnic_adapter *);
irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *);
irqreturn_t qlcnic_83xx_intr(int, void *);
irqreturn_t qlcnic_83xx_tmp_intr(int, void *);
void qlcnic_83xx_enable_intr(struct qlcnic_adapter *,
			     struct qlcnic_host_sds_ring *);
void qlcnic_83xx_disable_intr(struct qlcnic_adapter *,
			     struct qlcnic_host_sds_ring *);
void qlcnic_83xx_check_vf(struct qlcnic_adapter *,
			  const struct pci_device_id *);
int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *);
+2 −2
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static int qlcnic_83xx_idc_tx_soft_reset(struct qlcnic_adapter *adapter)
	qlcnic_up(adapter, netdev);
	netif_device_attach(netdev);
	clear_bit(__QLCNIC_RESETTING, &adapter->state);
	dev_err(&adapter->pdev->dev, "%s:\n", __func__);
	netdev_info(adapter->netdev, "%s: soft reset complete.\n", __func__);

	return 0;
}
@@ -2217,7 +2217,7 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
	struct qlcnic_hardware_context *ahw = adapter->ahw;
	int err = 0;

	adapter->rx_mac_learn = 0;
	adapter->rx_mac_learn = false;
	ahw->msix_supported = !!qlcnic_use_msi_x;

	qlcnic_83xx_init_rings(adapter);
+2 −2
Original line number Diff line number Diff line
@@ -227,10 +227,10 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter)
	if (ahw->capabilities & QLC_83XX_ESWITCH_CAPABILITY) {
		adapter->flags |= QLCNIC_ESWITCH_ENABLED;
		if (adapter->drv_mac_learn)
			adapter->rx_mac_learn = 1;
			adapter->rx_mac_learn = true;
	} else {
		adapter->flags &= ~QLCNIC_ESWITCH_ENABLED;
		adapter->rx_mac_learn = 0;
		adapter->rx_mac_learn = false;
	}

	ahw->idc.vnic_state = QLCNIC_DEV_NPAR_NON_OPER;
Loading