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

Commit 05afe93a authored by Mark Starovoytov's avatar Mark Starovoytov Committed by Gerrit - the friendly Code Review server
Browse files

atlantic forwarding driver v1.0.26



  [ATLDRV-660] - Wrong device ids are present in atl_main.c
  [ATLDRV-1113] - VLAN-PROMISC is turned off when PROMISC flag is set
  [ATLDRV-1124] - link is not up at 2.5G speed
  [ATLDRV-1105] - Allocate/destroy/disable/enable channels
  [ATLDRV-1114] - Send traffic via FWD ring
  [ATLDRV-1116] - Add support for FWD rings status / stats via ethtool
  [ATLDRV-1120] - reproduce descriptor writeback on disabled ring
  [ATLDRV-1126] - Print statistics for created FWD rings only

Co-authored-by: default avatarDmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Change-Id: Id400eab5481bfc120b02a7e284d84baab4d42600
Git-commit: e0e81b671f50044633de0738a8f2975466e2da45
Git-repo: https://github.com/aquantia/linux-4.14-atlantic-forwarding


[jineshk@codeaurora.org: Fix shift-count-overflow in DESCR_FIELD()]
Signed-off-by: default avatarJinesh K. Jayakumar <jineshk@codeaurora.org>
parent 2c0bd619
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ if AQFWD
config ATLFWD_FWD
       bool "Enable forwarding-engine API"
       default n
       ---help---
       help

         Say Y to enable the forwarding-engine API

@@ -17,7 +17,7 @@ config ATLFWD_FWD_RXBUF
       range 0 320
       default 160 if ATLFWD_FWD
       default 0
       ---help---
       help

         Amount of Rx buffer to reserve for the forwarding-engine
         rings. This sets the default value of the fwd_rx_buf_reserve
@@ -32,7 +32,7 @@ config ATLFWD_FWD_TXBUF
       range 0 160
       default 80 if ATLFWD_FWD
       default 0
       ---help---
       help

         Amount of Tx buffer to reserve for the forwarding-engine
         rings. This sets the default value of the fwd_tx_buf_reserve
@@ -41,6 +41,14 @@ config ATLFWD_FWD_TXBUF
         Value in kiB, 0 to 320, defaults to 80 if forwarding-engine
         API enabled, 0 otherwise.

config ATLFWD_FWD_NETLINK
        bool "Enable netlink control socket for forwarding engine"
        default n
        depends on ATLFWD_FWD
        help

          Expose forwarding engine APIs over the netlink socket.

endif

config AQFWD_QCOM
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ atlantic-fwd-objs := atl_fw.o \
		     atl_hwmon.o

atlantic-fwd-$(CONFIG_ATLFWD_FWD) += atl_fwd.o
atlantic-fwd-$(CONFIG_ATLFWD_FWD_NETLINK) += atl_fwdnl.o

atlantic-fwd-$(CONFIG_AQFWD_QCOM) += atl_qcom.o
atlantic-fwd-$(CONFIG_AQFWD_QCOM_IPA) += atl_qcom_ipa.o
+2 −57
Original line number Diff line number Diff line
@@ -18,74 +18,19 @@
#include <linux/netdevice.h>
#include <linux/moduleparam.h>

#define ATL_VERSION "1.0.25"
#define ATL_VERSION "1.0.26"

struct atl_nic;
enum atl_fwd_notify;

#include "atl_compat.h"
#include "atl_hw.h"
#include "atl_stats.h"

#define ATL_MAX_QUEUES 8

#include "atl_fwd.h"

struct atl_rx_ring_stats {
	uint64_t packets;
	uint64_t bytes;
	uint64_t linear_dropped;
	uint64_t alloc_skb_failed;
	uint64_t reused_head_page;
	uint64_t reused_data_page;
	uint64_t alloc_head_page;
	uint64_t alloc_data_page;
	uint64_t alloc_head_page_failed;
	uint64_t alloc_data_page_failed;
	uint64_t non_eop_descs;
	uint64_t mac_err;
	uint64_t csum_err;
	uint64_t multicast;
};

struct atl_tx_ring_stats {
	uint64_t packets;
	uint64_t bytes;
	uint64_t tx_busy;
	uint64_t tx_restart;
	uint64_t dma_map_failed;
};

struct atl_ring_stats {
	union {
		struct atl_rx_ring_stats rx;
		struct atl_tx_ring_stats tx;
	};
};

struct atl_ether_stats {
	uint64_t rx_pause;
	uint64_t tx_pause;
	uint64_t rx_ether_drops;
	uint64_t rx_ether_octets;
	uint64_t rx_ether_pkts;
	uint64_t rx_ether_broacasts;
	uint64_t rx_ether_multicasts;
	uint64_t rx_ether_crc_align_errs;
	uint64_t rx_filter_host;
	uint64_t rx_filter_lost;
};

struct atl_global_stats {
	struct atl_rx_ring_stats rx;
	struct atl_tx_ring_stats tx;

	/* MSM counters can't be reset without full HW reset, so
	 * store them in relative form:
	 * eth[i] == HW_counter - eth_base[i] */
	struct atl_ether_stats eth;
	struct atl_ether_stats eth_base;
};

enum {
	ATL_RXF_VLAN_BASE = 0,
	ATL_RXF_VLAN_MAX = ATL_VLAN_FLT_NUM,
+41 −7
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@

#include "atl_common.h"
#include "atl_ring.h"
#include "atl_fwdnl.h"

static uint32_t atl_ethtool_get_link(struct net_device *ndev)
{
@@ -640,7 +641,12 @@ static int atl_get_sset_count(struct net_device *ndev, int sset)
	case ETH_SS_STATS:
		return ARRAY_SIZE(tx_stat_descs) * (nic->nvecs + 1) +
		       ARRAY_SIZE(rx_stat_descs) * (nic->nvecs + 1) +
			ARRAY_SIZE(eth_stat_descs);
		       ARRAY_SIZE(eth_stat_descs)
#ifdef CONFIG_ATLFWD_FWD_NETLINK
		       + ARRAY_SIZE(tx_stat_descs) *
				 hweight_long(nic->fwd.ring_map[ATL_FWDIR_TX])
#endif
			;

	case ETH_SS_PRIV_FLAGS:
		return ARRAY_SIZE(atl_priv_flags);
@@ -689,6 +695,17 @@ static void atl_get_strings(struct net_device *ndev, uint32_t sset,
			snprintf(prefix, sizeof(prefix), "ring_%d_", i);
			atl_copy_stats_string_set(&p, prefix);
		}

#ifdef CONFIG_ATLFWD_FWD_NETLINK
		for (i = 0; i < ATL_NUM_FWD_RINGS; i++) {
			if (!atlfwd_nl_is_tx_fwd_ring_created(ndev, i))
				continue;

			snprintf(prefix, sizeof(prefix), "fwd_ring_%d_", i);
			atl_copy_stats_strings(&p, prefix, tx_stat_descs,
					       ARRAY_SIZE(tx_stat_descs));
		}
#endif
		return;

	case ETH_SS_PRIV_FLAGS:
@@ -730,6 +747,18 @@ static void atl_get_ethtool_stats(struct net_device *ndev,
		atl_get_ring_stats(&qvec->rx, &tmp);
		atl_write_stats(&tmp.rx, rx_stat_descs, data, uint64_t);
	}

#ifdef CONFIG_ATLFWD_FWD_NETLINK
	for (i = 0; i < ATL_NUM_FWD_RINGS; i++) {
		struct atl_ring_stats tmp;

		if (!atlfwd_nl_is_tx_fwd_ring_created(ndev, i))
			continue;

		atl_fwd_get_ring_stats(nic->fwd.rings[ATL_FWDIR_TX][i], &tmp);
		atl_write_stats(&tmp.tx, tx_stat_descs, data, uint64_t);
	}
#endif
}

static int atl_update_eee_pflags(struct atl_nic *nic)
@@ -1748,7 +1777,8 @@ static void atl_refresh_rxf_desc(struct atl_nic *nic,
	atl_for_each_rxf_idx(desc, idx)
		desc->update_rxf(nic, idx);

	atl_set_vlan_promisc(&nic->hw, nic->rxf_vlan.promisc_count);
	atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) ||
				       nic->rxf_vlan.promisc_count);
}

void atl_refresh_rxfs(struct atl_nic *nic)
@@ -1758,7 +1788,8 @@ void atl_refresh_rxfs(struct atl_nic *nic)
	atl_for_each_rxf_desc(desc)
		atl_refresh_rxf_desc(nic, desc);

	atl_set_vlan_promisc(&nic->hw, nic->rxf_vlan.promisc_count);
	atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) ||
				       nic->rxf_vlan.promisc_count);
}

static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx)
@@ -1798,7 +1829,8 @@ static bool atl_vlan_pull_from_promisc(struct atl_nic *nic, uint32_t idx)
	} while (idx & ATL_VIDX_FREE);

	kfree(map);
	atl_set_vlan_promisc(&nic->hw, vlan->promisc_count);
	atl_set_vlan_promisc(&nic->hw, (nic->ndev->flags & IFF_PROMISC) ||
				       vlan->promisc_count);
	return true;
}

@@ -1984,7 +2016,8 @@ int atl_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)
	if (idx == ATL_VIDX_NONE) {
		/* VID not found and no unused filters */
		vlan->promisc_count++;
		atl_set_vlan_promisc(&nic->hw, vlan->promisc_count);
		atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) ||
					        vlan->promisc_count);
		return 0;
	}

@@ -2030,7 +2063,8 @@ int atl_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid)
	if (!(idx & ATL_VIDX_FOUND)) {
		/* VID not present in filters, decrease promisc count */
		vlan->promisc_count--;
		atl_set_vlan_promisc(&nic->hw, vlan->promisc_count);
		atl_set_vlan_promisc(&nic->hw, (ndev->flags & IFF_PROMISC) ||
					       vlan->promisc_count);
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ struct atl_link_type atl_link_types[] = {
	LINK_TYPE("10GBaseT-FD", 10000, ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
		1, 1 << 11)
};
#define ATL_FW2_LINK_MSK (BIT(5) | BIT(8) | BIT(10) | BIT(11))
#define ATL_FW2_LINK_MSK (BIT(5) | BIT(8) | BIT(9) | BIT(10) | BIT(11))

const int atl_num_rates = ARRAY_SIZE(atl_link_types);

Loading