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

Commit 4c776aad authored by Sony Chacko's avatar Sony Chacko Committed by David S. Miller
Browse files

qlcnic: Remove redundant eSwitch enable commands



When more than one NIC physical functions are enabled on a port,
eSwitch on that port gets enabled automatically. Driver
need not explicitly enable the eSwitch.

Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6177a95a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -629,7 +629,7 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *);
int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *,
int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *,
				    struct qlcnic_info *, u8);
				    struct qlcnic_info *, u8);
int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *);
int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *);
int qlcnic_83xx_enable_port_eswitch(struct qlcnic_adapter *, int);
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_minidump_template(struct qlcnic_adapter *);
void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
+4 −19
Original line number Original line Diff line number Diff line
@@ -256,7 +256,7 @@ int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *adapter)
	return 0;
	return 0;
}
}


static int qlcnic_83xx_get_eswitch_port_info(struct qlcnic_adapter *adapter,
int qlcnic_83xx_set_port_eswitch_status(struct qlcnic_adapter *adapter,
					int func, int *port_id)
					int func, int *port_id)
{
{
	struct qlcnic_info nic_info;
	struct qlcnic_info nic_info;
@@ -273,23 +273,8 @@ static int qlcnic_83xx_get_eswitch_port_info(struct qlcnic_adapter *adapter,
	else
	else
		err = -EIO;
		err = -EIO;


	return err;
	if (!err)
}
		adapter->eswitch[*port_id].flags |= QLCNIC_SWITCH_ENABLE;

int qlcnic_83xx_enable_port_eswitch(struct qlcnic_adapter *adapter, int func)
{
	int id, err = 0;

	err = qlcnic_83xx_get_eswitch_port_info(adapter, func, &id);
	if (err)
		return err;

	if (!(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE)) {
		if (!qlcnic_enable_eswitch(adapter, id, 1))
			adapter->eswitch[id].flags |= QLCNIC_SWITCH_ENABLE;
		else
			err = -EIO;
	}


	return err;
	return err;
}
}
+7 −6
Original line number Original line Diff line number Diff line
@@ -819,7 +819,7 @@ static bool qlcnic_port_eswitch_cfg_capability(struct qlcnic_adapter *adapter)
int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
{
{
	struct qlcnic_pci_info *pci_info;
	struct qlcnic_pci_info *pci_info;
	int i, ret = 0, j = 0;
	int i, id = 0, ret = 0, j = 0;
	u16 act_pci_func;
	u16 act_pci_func;
	u8 pfn;
	u8 pfn;


@@ -860,7 +860,8 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
			continue;
			continue;


		if (qlcnic_port_eswitch_cfg_capability(adapter)) {
		if (qlcnic_port_eswitch_cfg_capability(adapter)) {
			if (!qlcnic_83xx_enable_port_eswitch(adapter, pfn))
			if (!qlcnic_83xx_set_port_eswitch_status(adapter, pfn,
								 &id))
				adapter->npars[j].eswitch_status = true;
				adapter->npars[j].eswitch_status = true;
			else
			else
				continue;
				continue;
@@ -879,12 +880,12 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
		j++;
		j++;
	}
	}


	if (qlcnic_82xx_check(adapter)) {
	/* Update eSwitch status for adapters without per port eSwitch
	 * configuration capability
	 */
	if (!qlcnic_port_eswitch_cfg_capability(adapter)) {
		for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++)
		for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++)
			adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE;
			adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE;
	} else if (!qlcnic_port_eswitch_cfg_capability(adapter)) {
		for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++)
			qlcnic_enable_eswitch(adapter, i, 1);
	}
	}


	kfree(pci_info);
	kfree(pci_info);