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

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

Merge branch 'be2net-next'



Sathya Perla says:

====================
be2net: patch set

Hi Dave, pls consider commiting the following patches to the net-next tree.
Thanks!

Patch 1 replaces the be_max_eqs() macro with two new macros called
be_max_nic_eqs() and be_max_func_eqs() to clear confusion in that part
of the code.

Patch 2 adds support to configure asymmetric number of rx/tx queues via
ethtool set-channels option.

Patch 3 disables EVB when VFs are not enabled on a BE3 SR-IOV config to
avoid the broadcast echo problem.

Patch 4 updates copyright markings in be2net src files

Patch 5 updates the be2net maintainers' list
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4c88aaf3 d2ee76fa
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -10280,10 +10280,9 @@ W: http://www.avagotech.com
S:	Supported
F:	drivers/scsi/be2iscsi/

Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER
Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER (be2net)
M:	Sathya Perla <sathya.perla@broadcom.com>
M:	Ajit Khaparde <ajit.khaparde@broadcom.com>
M:	Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
M:	Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
M:	Somnath Kotur <somnath.kotur@broadcom.com>
L:	netdev@vger.kernel.org
+33 −7
Original line number Diff line number Diff line
/*
 * Copyright (C) 2005 - 2015 Emulex
 * Copyright (C) 2005 - 2016 Broadcom
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
@@ -443,6 +443,7 @@ struct be_resources {
	u16 max_iface_count;
	u16 max_mcc_count;
	u16 max_evt_qs;
	u16 max_nic_evt_qs;	/* NIC's share of evt qs */
	u32 if_cap_flags;
	u32 vf_if_cap_flags;	/* VF if capability flags */
	u32 flags;
@@ -525,7 +526,8 @@ struct be_adapter {
	spinlock_t mcc_lock;	/* For serializing mcc cmds to BE card */
	spinlock_t mcc_cq_lock;

	u16 cfg_num_qs;		/* configured via set-channels */
	u16 cfg_num_rx_irqs;		/* configured via set-channels */
	u16 cfg_num_tx_irqs;		/* configured via set-channels */
	u16 num_evt_qs;
	u16 num_msix_vec;
	struct be_eq_obj eq_obj[MAX_EVT_QS];
@@ -644,18 +646,42 @@ struct be_adapter {
#define be_max_txqs(adapter)		(adapter->res.max_tx_qs)
#define be_max_prio_txqs(adapter)	(adapter->res.max_prio_tx_qs)
#define be_max_rxqs(adapter)		(adapter->res.max_rx_qs)
#define be_max_eqs(adapter)		(adapter->res.max_evt_qs)
/* Max number of EQs available for the function (NIC + RoCE (if enabled)) */
#define be_max_func_eqs(adapter)	(adapter->res.max_evt_qs)
/* Max number of EQs available avaialble only for NIC */
#define be_max_nic_eqs(adapter)		(adapter->res.max_nic_evt_qs)
#define be_if_cap_flags(adapter)	(adapter->res.if_cap_flags)
#define be_max_pf_pool_rss_tables(adapter)	\
				(adapter->pool_res.max_rss_tables)
/* Max irqs avaialble for NIC */
#define be_max_irqs(adapter)		\
			(min_t(u16, be_max_nic_eqs(adapter), num_online_cpus()))

static inline u16 be_max_qs(struct be_adapter *adapter)
/* Max irqs *needed* for RX queues */
static inline u16 be_max_rx_irqs(struct be_adapter *adapter)
{
	/* If no RSS, need atleast the one def RXQ */
	/* If no RSS, need atleast one irq for def-RXQ */
	u16 num = max_t(u16, be_max_rss(adapter), 1);

	num = min(num, be_max_eqs(adapter));
	return min_t(u16, num, num_online_cpus());
	return min_t(u16, num, be_max_irqs(adapter));
}

/* Max irqs *needed* for TX queues */
static inline u16 be_max_tx_irqs(struct be_adapter *adapter)
{
	return min_t(u16, be_max_txqs(adapter), be_max_irqs(adapter));
}

/* Max irqs *needed* for combined queues */
static inline u16 be_max_qp_irqs(struct be_adapter *adapter)
{
	return min(be_max_tx_irqs(adapter), be_max_rx_irqs(adapter));
}

/* Max irqs *needed* for RX and TX queues together */
static inline u16 be_max_any_irqs(struct be_adapter *adapter)
{
	return max(be_max_tx_irqs(adapter), be_max_rx_irqs(adapter));
}

/* Is BE in pvid_tagging mode */
+11 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2005 - 2015 Emulex
 * Copyright (C) 2005 - 2016 Broadcom
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
@@ -87,6 +87,11 @@ static struct be_cmd_priv_map cmd_priv_map[] = {
		CMD_SUBSYSTEM_LOWLEVEL,
		BE_PRIV_DEVCFG | BE_PRIV_DEVSEC
	},
	{
		OPCODE_COMMON_SET_HSW_CONFIG,
		CMD_SUBSYSTEM_COMMON,
		BE_PRIV_DEVCFG | BE_PRIV_VHADM
	},
};

static bool be_cmd_allowed(struct be_adapter *adapter, u8 opcode, u8 subsystem)
@@ -3850,6 +3855,10 @@ int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
	void *ctxt;
	int status;

	if (!be_cmd_allowed(adapter, OPCODE_COMMON_SET_HSW_CONFIG,
			    CMD_SUBSYSTEM_COMMON))
		return -EPERM;

	spin_lock_bh(&adapter->mcc_lock);

	wrb = wrb_from_mccq(adapter);
@@ -3871,7 +3880,7 @@ int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
		AMAP_SET_BITS(struct amap_set_hsw_context, pvid_valid, ctxt, 1);
		AMAP_SET_BITS(struct amap_set_hsw_context, pvid, ctxt, pvid);
	}
	if (!BEx_chip(adapter) && hsw_mode) {
	if (hsw_mode) {
		AMAP_SET_BITS(struct amap_set_hsw_context, interface_id,
			      ctxt, adapter->hba_port_num);
		AMAP_SET_BITS(struct amap_set_hsw_context, pport, ctxt, 1);
+1 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2005 - 2015 Emulex
 * Copyright (C) 2005 - 2016 Broadcom
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
+25 −6
Original line number Diff line number Diff line
/*
 * Copyright (C) 2005 - 2015 Emulex
 * Copyright (C) 2005 - 2016 Broadcom
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
@@ -1196,9 +1196,17 @@ static void be_get_channels(struct net_device *netdev,
			    struct ethtool_channels *ch)
{
	struct be_adapter *adapter = netdev_priv(netdev);
	u16 num_rx_irqs = max_t(u16, adapter->num_rss_qs, 1);

	ch->combined_count = adapter->num_evt_qs;
	ch->max_combined = be_max_qs(adapter);
	/* num_tx_qs is always same as the number of irqs used for TX */
	ch->combined_count = min(adapter->num_tx_qs, num_rx_irqs);
	ch->rx_count = num_rx_irqs - ch->combined_count;
	ch->tx_count = adapter->num_tx_qs - ch->combined_count;

	ch->max_combined = be_max_qp_irqs(adapter);
	/* The user must create atleast one combined channel */
	ch->max_rx = be_max_rx_irqs(adapter) - 1;
	ch->max_tx = be_max_tx_irqs(adapter) - 1;
}

static int be_set_channels(struct net_device  *netdev,
@@ -1207,11 +1215,22 @@ static int be_set_channels(struct net_device *netdev,
	struct be_adapter *adapter = netdev_priv(netdev);
	int status;

	if (ch->rx_count || ch->tx_count || ch->other_count ||
	    !ch->combined_count || ch->combined_count > be_max_qs(adapter))
	/* we support either only combined channels or a combination of
	 * combined and either RX-only or TX-only channels.
	 */
	if (ch->other_count || !ch->combined_count ||
	    (ch->rx_count && ch->tx_count))
		return -EINVAL;

	if (ch->combined_count > be_max_qp_irqs(adapter) ||
	    (ch->rx_count &&
	     (ch->rx_count + ch->combined_count) > be_max_rx_irqs(adapter)) ||
	    (ch->tx_count &&
	     (ch->tx_count + ch->combined_count) > be_max_tx_irqs(adapter)))
		return -EINVAL;

	adapter->cfg_num_qs = ch->combined_count;
	adapter->cfg_num_rx_irqs = ch->combined_count + ch->rx_count;
	adapter->cfg_num_tx_irqs = ch->combined_count + ch->tx_count;

	status = be_update_queues(adapter);
	return be_cmd_status(status);
Loading