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

Commit 9216ccec authored by Vadim Solomin's avatar Vadim Solomin Committed by Jinesh K. Jayakumar
Browse files

atlantic-forwarding driver v1.0.17



Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>
Signed-off-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>

commit e33d7cc426eeef71a43bde6adb1da7ffb46552f7
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Tue Mar 5 19:40:01 2019 +0300

    Version 1.0.17

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 2d7d735bcc5c2520c789758742e2811e0f5eceaf
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Sat Mar 2 02:24:14 2019 +0300

    Allow custom memory allocators for atl_fwd_request_ring() (AQ041)

    Separate allocators can be used for descriptor and buffer memory.

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 26b46a07b4b3fe021602f36d4e5c1f46de286366
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Thu Feb 21 00:53:33 2019 +0300

    Improve error reporting for forwarding-engine ring creation (AQ041)

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 88a949f997e5c955b066e2f2277a8befc361c63c
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Sat Mar 2 03:32:30 2019 +0300

    Put PHY into low-power state on ifdown or disabling link

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 2f8a72824f43615e0336be5a43f859589fe85564
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Sat Mar 2 03:20:46 2019 +0300

    Use __GFP_NOWARN for Rx buffers only in NAPI poll (AQ037)

    Initial buffer fill during ring allocation on ifup used to allocate
    buffers with GFP_ATOMIC | __GFP_NOWARN, for no good reason. Just use
    GFP_KERNEL in that case.

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 7d12da3f72ff0c33da2a6c21c4cf388bf21c23bb
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Sat Mar 2 03:06:48 2019 +0300

    Clamp max number of rings as reported by ethtool to num_present_cpus() (AQ037)

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit e6b368fce6c1cad07c54bae595ddbbdbdaaccca1
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Sat Mar 2 03:39:37 2019 +0300

    Disable LRO by default until all issues are resolved.

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 0a5c5f6fc418282dae8beee956e1eab7bc168143
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Fri Feb 15 01:01:12 2019 +0300

    Use new FW interface to control ethernet padding stripping

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit c83b3fb99ea3a969c21fc2ee41a9743070c6c45b
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Thu Feb 14 02:28:42 2019 +0300

    Implement FW settings table access

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 637b5031d1f4cd49f6b53283a72439ee716c4bdf
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Tue Feb 12 23:58:44 2019 +0300

    Free link interrupt before reconfiguring the rings

     Fixes ATLDRV-775

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit 827276bcaff5a8045f8d4781a416ca498336bee2
Author: Vadim Solomin <vadim.solomin@aquantia.com>
Date:   Wed Jan 23 17:45:04 2019 +0300

    Fix MSM register writes

    Signed-off-by: default avatarVadim Solomin <vadim.solomin@aquantia.com>

commit b84f58235d90555385ac866a0365ac352ebc8222
Author: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Date:   Fri Jan 18 15:50:53 2019 +0300

    Fix legacy interrupt handling

    Do not set auto-clear register for legacy interrupt.
    Use BIT() function for ring-index fto get an expected mask in the interrupt handler.

commit c8f432e9a8c9acb445900f0a156eecdbd4314001
Author: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Date:   Tue Jan 15 17:21:32 2019 +0300

    Add bacward compatibility for Linux 4.1

    Signed-off-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>

CRs-Fixed: 2435505
Change-Id: I793c5d16cf245b6b0e08df5b705f0fbbf32d5529
Git-commit: 1bae566ed23376e38d84af02939e9f39cb5ba47e
Git-repo: https://github.com/aquantia/linux-4.14-atlantic-forwarding


[jineshk@codeaurora.org: fix compilation and checker errors in atl_fwd.c]
Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent d7e13e27
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
#include <linux/netdevice.h>
#include <linux/moduleparam.h>

#define ATL_VERSION "1.0.16"
#define ATL_VERSION "1.0.17"

struct atl_nic;

@@ -307,6 +307,7 @@ extern const struct ethtool_ops atl_ethtool_ops;
extern int atl_max_queues;
extern unsigned atl_rx_linear;
extern unsigned atl_min_intr_delay;
extern int atl_enable_msi;

/* Logging conviniency macros.
 *
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
/* From commit aff171641d181ea573380efc3f559c9de4741fc5 */
int atl_compat_pci_irq_vector(struct pci_dev *dev, unsigned int nr)
{
#ifdef CONFIG_PCI_MSI
	if (dev->msix_enabled) {
		struct msi_desc *entry;
		int i = 0;
@@ -42,6 +43,7 @@ int atl_compat_pci_irq_vector(struct pci_dev *dev, unsigned int nr)
		if (WARN_ON_ONCE(nr > 0))
			return -EINVAL;
	}
#endif

	return dev->irq + nr;
}
+26 −0
Original line number Diff line number Diff line
@@ -143,4 +143,30 @@ static inline void page_ref_inc(struct page *page)

#endif	/* 4.6.0 */

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)

/* introduced in commit c7f5d105495a38ed09e70d825f75d9d7d5407264
 * stub it */
static inline int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
{
	return -ENODEV;
}

#endif	/* 4.5.0 */

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
#define ETHTOOL_RX_FLOW_SPEC_RING      0x00000000FFFFFFFFLL
#define ETHTOOL_RX_FLOW_SPEC_RING_VF   0x000000FF00000000LL
#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
static inline __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
{
	return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie;
};
static inline __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
{
	return (ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie) >>
				ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
};
#endif	/* 4.2.0 */

#endif
+23 −16
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ static int atl_ethtool_set_settings(struct net_device *ndev,

	atl_ethtool_set_common(cmd, lstate,
		(unsigned long *)&cmd->advertising, &tmp, true, speed);
	hw->mcp.ops->set_link(hw);
	hw->mcp.ops->set_link(hw, false);
	return 0;
}

@@ -350,8 +350,14 @@ static void atl_get_channels(struct net_device *ndev,
	struct ethtool_channels *chan)
{
	struct atl_nic *nic = netdev_priv(ndev);
	int max_rings;

	if (atl_enable_msi)
		max_rings = min_t(int, ATL_MAX_QUEUES, num_present_cpus());
	else
		max_rings = 1;

	chan->max_combined = ATL_MAX_QUEUES;
	chan->max_combined = max_rings;
	chan->combined_count = nic->nvecs;
	if (nic->flags & ATL_FL_MULTIPLE_VECTORS)
		chan->max_other = chan->other_count = ATL_NUM_NON_RING_IRQS;
@@ -793,26 +799,27 @@ static int atl_set_pad_stripping(struct atl_nic *nic, bool on)
{
	struct atl_hw *hw = &nic->hw;
	int ret;
	uint32_t ctrl;
	uint32_t msm_opts;

	ret = atl_hwsem_get(hw, ATL_MCP_SEM_MSM);
	if (ret)
		return ret;
	if (hw->mcp.fw_rev < 0x0300008e)
		return -EOPNOTSUPP;

	ret = __atl_msm_read(hw, ATL_MSM_GEN_CTRL, &ctrl);
	ret = atl_read_fwsettings_word(hw, atl_fw2_setings_msm_opts,
		&msm_opts);
	if (ret)
		goto unlock;

	if (on)
		ctrl |= BIT(5);
	else
		ctrl &= ~BIT(5);
		return ret;

	ret = __atl_msm_write(hw, ATL_MSM_GEN_CTRL, ctrl);
	msm_opts &= ~atl_fw2_settings_msm_opts_strip_pad;
	msm_opts |= !!on << atl_fw2_settings_msm_opts_strip_pad_shift;

unlock:
	atl_hwsem_put(hw, ATL_MCP_SEM_MSM);
	ret = atl_write_fwsettings_word(hw, atl_fw2_setings_msm_opts,
		msm_opts);
	if (ret)
		return ret;

	/* Restart aneg to make FW apply the new settings */
	hw->mcp.ops->restart_aneg(hw);
	return 0;
}

static uint32_t atl_get_priv_flags(struct net_device *ndev)
+21 −4
Original line number Diff line number Diff line
@@ -295,6 +295,10 @@ static void atl_fw2_set_link(struct atl_hw *hw, bool force)

	bits = atl_set_fw_bits(hw, 1);

	/* If no modes are advertized, put PHY into low-power */
	if (!bits)
		hi_bits |= atl_fw2_link_drop;

	hi_bits |= bits >> 32;

	atl_write(hw, ATL_MCP_SCRATCH(FW2_LINK_REQ_LOW), bits);
@@ -352,7 +356,8 @@ static int atl_fw2_enable_wol(struct atl_hw *hw)
	atl_lock_fw(hw);

	ret = atl_write_mcp_mem(hw, 0, msg,
		(info->len + offsetof(struct drvIface, fw2xOffloads) + 3) & ~3);
		(info->len + offsetof(struct drvIface, fw2xOffloads) + 3) & ~3,
		MCP_AREA_CONFIG);
	if (ret) {
		atl_dev_err("Failed to upload sleep proxy info to FW\n");
		goto free;
@@ -374,12 +379,11 @@ static int atl_fw2_enable_wol(struct atl_hw *hw)
	return ret;
}

int atl_read_fwstat_word(struct atl_hw *hw, uint32_t offt, uint32_t *val)
int atl_read_mcp_word(struct atl_hw *hw, uint32_t offt, uint32_t *val)
{
	int ret;
	uint32_t addr = hw->mcp.fw_stat_addr + (offt & ~3);

	ret = atl_read_mcp_mem(hw, addr, val, 4);
	ret = atl_read_mcp_mem(hw, offt & ~3, val, 4);
	if (ret)
		return ret;

@@ -446,6 +450,7 @@ static struct atl_fw_ops atl_fw_ops[2] = {
int atl_fw_init(struct atl_hw *hw)
{
	uint32_t tries, reg, major;
	int ret;

	tries = busy_wait(10000, mdelay(1), reg, atl_read(hw, 0x18), !reg);
	if (!reg) {
@@ -466,5 +471,17 @@ int atl_fw_init(struct atl_hw *hw)
	hw->mcp.fw_rev = reg;
	hw->mcp.fw_stat_addr = atl_read(hw, ATL_MCP_SCRATCH(FW_STAT_STRUCT));

	if (major > 1) {
		ret = atl_read_fwstat_word(hw, atl_fw2_stat_settings_addr,
			&hw->mcp.fw_settings_addr);
		if (ret)
			return ret;

		ret = atl_read_fwstat_word(hw, atl_fw2_stat_settings_len,
			&hw->mcp.fw_settings_len);
		if (ret)
			return ret;
	}

	return hw->mcp.ops->wait_fw_init(hw);
}
Loading