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

Commit 14d385b9 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller
Browse files

qlcnic: dcb: Query adapter DCB capabilities.



o Query adapter DCB capabilities and  populate local data structures
  with relevant information.

o Add QLCNIC_DCB to Kconfig for enabling/disabling DCB.

Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d853f111
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -45,6 +45,17 @@ config QLCNIC_SRIOV
	  This allows for virtual function acceleration in virtualized
	  environments.

config QLCNIC_DCB
	bool "QLOGIC QLCNIC 82XX and 83XX family DCB Support"
	depends on QLCNIC && DCB
	default y
	---help---
	  This configuration parameter enables DCB support in QLE83XX
	  and QLE82XX Converged Ethernet devices. This allows for DCB
	  get operations support through rtNetlink interface. Only CEE
	  mode of DCB is supported. PG and PFC values are related only
	  to Tx.

config QLGE
	tristate "QLogic QLGE 10Gb Ethernet Driver Support"
	depends on PCI
+2 −0
Original line number Diff line number Diff line
@@ -11,3 +11,5 @@ qlcnic-y := qlcnic_hw.o qlcnic_main.o qlcnic_init.o \
	qlcnic_minidump.o qlcnic_sriov_common.o

qlcnic-$(CONFIG_QLCNIC_SRIOV) += qlcnic_sriov_pf.o

qlcnic-$(CONFIG_QLCNIC_DCB) += qlcnic_dcb.o
+50 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "qlcnic_hdr.h"
#include "qlcnic_hw.h"
#include "qlcnic_83xx_hw.h"
#include "qlcnic_dcb.h"

#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 3
@@ -959,6 +960,7 @@ struct qlcnic_ipaddr {
#define __QLCNIC_SRIOV_CAPABLE		11
#define __QLCNIC_MBX_POLL_ENABLE	12
#define __QLCNIC_DIAG_MODE		13
#define __QLCNIC_DCB_STATE		14

#define QLCNIC_INTERRUPT_TEST		1
#define QLCNIC_LOOPBACK_TEST		2
@@ -1062,6 +1064,7 @@ struct qlcnic_adapter {
	struct delayed_work fw_work;
	struct delayed_work idc_aen_work;
	struct delayed_work mbx_poll_work;
	struct qlcnic_dcb *dcb;

	struct qlcnic_filter_hash fhash;
	struct qlcnic_filter_hash rx_fhash;
@@ -2092,4 +2095,51 @@ static inline bool qlcnic_sriov_vf_check(struct qlcnic_adapter *adapter)

	return status;
}

static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_adapter *adapter)
{
	struct qlcnic_dcb *dcb = adapter->dcb;

	if (dcb && dcb->ops->get_hw_capability)
		return dcb->ops->get_hw_capability(adapter);

	return 0;
}

static inline void qlcnic_dcb_free(struct qlcnic_adapter *adapter)
{
	struct qlcnic_dcb *dcb = adapter->dcb;

	if (dcb && dcb->ops->free)
		dcb->ops->free(adapter);
}

static inline int qlcnic_dcb_attach(struct qlcnic_adapter *adapter)
{
	struct qlcnic_dcb *dcb = adapter->dcb;

	if (dcb && dcb->ops->attach)
		return dcb->ops->attach(adapter);

	return 0;
}

static inline int
qlcnic_dcb_query_hw_capability(struct qlcnic_adapter *adapter, char *buf)
{
	struct qlcnic_dcb *dcb = adapter->dcb;

	if (dcb && dcb->ops->query_hw_capability)
		return dcb->ops->query_hw_capability(adapter, buf);

	return 0;
}

static inline void qlcnic_dcb_get_info(struct qlcnic_adapter *adapter)
{
	struct qlcnic_dcb *dcb = adapter->dcb;

	if (dcb && dcb->ops->get_info)
		dcb->ops->get_info(adapter);
}
#endif				/* __QLCNIC_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ static const struct qlcnic_mailbox_metadata qlcnic_83xx_mbx_tbl[] = {
	{QLCNIC_CMD_ADD_RCV_RINGS, 130, 26},
	{QLCNIC_CMD_CONFIG_VPORT, 4, 4},
	{QLCNIC_CMD_BC_EVENT_SETUP, 2, 1},
	{QLCNIC_CMD_DCB_QUERY_CAP, 1, 2},
};

const u32 qlcnic_83xx_ext_reg_tbl[] = {
+5 −0
Original line number Diff line number Diff line
@@ -635,6 +635,8 @@ int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *adapter)

	if (adapter->portnum == 0)
		qlcnic_set_drv_version(adapter);

	qlcnic_dcb_get_info(adapter);
	qlcnic_83xx_idc_attach_driver(adapter);

	return 0;
@@ -2228,6 +2230,9 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
	if (err)
		goto disable_mbx_intr;

	if (adapter->dcb && qlcnic_dcb_attach(adapter))
		qlcnic_clear_dcb_ops(adapter);

	/* Periodically monitor device status */
	qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work);
	return 0;
Loading