Commit d68de60f authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2014-06-05

This series contains updates to i40e and i40evf.

Jesse fixes an issue reported by Dave Jones where a couple of FD checks
ended up using bitwise OR where it should have been bitwise AND.

Neerav removes unused defines and macros for receive LRO.  Fix the driver
from allowing the user to set a larger MTU size that the hardware was
being configured to support.  Refactors send version which moves code in
two places into a small helper function.

Kamil modifies register diagnostics since register ranges can vary among
the different NVMs to avoid false test results.  So now we try to identify
the full range and use it for a register test and if we fail to define the
proper register range, we will only test the first register from that
group.  Then removes the check for large buffer since this was added in the
case this structure changed in the future, since the AQ definition is now
mature enough that this check is no longer necessary.

Mitch fixes i40evf driver to allocate descriptors in groups of 32 since the
hardware requires it.  Also fixes a crash when the ring size changed because
it would change the count before deallocating resources, causing the driver
to either free nonexistent buffers or leak leftover buffers.  Fixed the
driver to notify the VF for all types of resets so the VF can attempt a
graceful reinit.

Shannon refactors stats collection to create a unifying stats update routine
to call the various stat collection routines.  Removes rx_errors and
rx_missed stats since they were removed from the chip design.  Added
missing VSI statistics that the hardware offers but are not apart of the
standard netdev stats.

v2: dropped patch "i40e: Allow disabling of DCB via debugfs" from Neerav
    based on feedback from David Miller.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ebbe495f 41a9e55c
...@@ -1062,8 +1062,6 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, ...@@ -1062,8 +1062,6 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw,
cmd->vsi_flags = cpu_to_le16(vsi_ctx->flags); cmd->vsi_flags = cpu_to_le16(vsi_ctx->flags);
desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD));
if (sizeof(vsi_ctx->info) > I40E_AQ_LARGE_BUF)
desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);
status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info,
sizeof(vsi_ctx->info), cmd_details); sizeof(vsi_ctx->info), cmd_details);
...@@ -1204,8 +1202,6 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw, ...@@ -1204,8 +1202,6 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,
cmd->uplink_seid = cpu_to_le16(vsi_ctx->seid); cmd->uplink_seid = cpu_to_le16(vsi_ctx->seid);
desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF); desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF);
if (sizeof(vsi_ctx->info) > I40E_AQ_LARGE_BUF)
desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);
status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info,
sizeof(vsi_ctx->info), NULL); sizeof(vsi_ctx->info), NULL);
...@@ -1244,8 +1240,6 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, ...@@ -1244,8 +1240,6 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw,
cmd->uplink_seid = cpu_to_le16(vsi_ctx->seid); cmd->uplink_seid = cpu_to_le16(vsi_ctx->seid);
desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); desc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD));
if (sizeof(vsi_ctx->info) > I40E_AQ_LARGE_BUF)
desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);
status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info,
sizeof(vsi_ctx->info), cmd_details); sizeof(vsi_ctx->info), cmd_details);
......
...@@ -862,12 +862,11 @@ static void i40e_dbg_dump_eth_stats(struct i40e_pf *pf, ...@@ -862,12 +862,11 @@ static void i40e_dbg_dump_eth_stats(struct i40e_pf *pf,
" rx_bytes = \t%lld \trx_unicast = \t\t%lld \trx_multicast = \t%lld\n", " rx_bytes = \t%lld \trx_unicast = \t\t%lld \trx_multicast = \t%lld\n",
estats->rx_bytes, estats->rx_unicast, estats->rx_multicast); estats->rx_bytes, estats->rx_unicast, estats->rx_multicast);
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
" rx_broadcast = \t%lld \trx_discards = \t\t%lld \trx_errors = \t%lld\n", " rx_broadcast = \t%lld \trx_discards = \t\t%lld\n",
estats->rx_broadcast, estats->rx_discards, estats->rx_errors); estats->rx_broadcast, estats->rx_discards);
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
" rx_missed = \t%lld \trx_unknown_protocol = \t%lld \ttx_bytes = \t%lld\n", " rx_unknown_protocol = \t%lld \ttx_bytes = \t%lld\n",
estats->rx_missed, estats->rx_unknown_protocol, estats->rx_unknown_protocol, estats->tx_bytes);
estats->tx_bytes);
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
" tx_unicast = \t%lld \ttx_multicast = \t\t%lld \ttx_broadcast = \t%lld\n", " tx_unicast = \t%lld \ttx_multicast = \t\t%lld \ttx_broadcast = \t%lld\n",
estats->tx_unicast, estats->tx_multicast, estats->tx_broadcast); estats->tx_unicast, estats->tx_multicast, estats->tx_broadcast);
......
...@@ -67,17 +67,25 @@ static i40e_status i40e_diag_reg_pattern_test(struct i40e_hw *hw, ...@@ -67,17 +67,25 @@ static i40e_status i40e_diag_reg_pattern_test(struct i40e_hw *hw,
struct i40e_diag_reg_test_info i40e_reg_list[] = { struct i40e_diag_reg_test_info i40e_reg_list[] = {
/* offset mask elements stride */ /* offset mask elements stride */
{I40E_QTX_CTL(0), 0x0000FFBF, 4, I40E_QTX_CTL(1) - I40E_QTX_CTL(0)}, {I40E_QTX_CTL(0), 0x0000FFBF, 1,
{I40E_PFINT_ITR0(0), 0x00000FFF, 3, I40E_PFINT_ITR0(1) - I40E_PFINT_ITR0(0)}, I40E_QTX_CTL(1) - I40E_QTX_CTL(0)},
{I40E_PFINT_ITRN(0, 0), 0x00000FFF, 8, I40E_PFINT_ITRN(0, 1) - I40E_PFINT_ITRN(0, 0)}, {I40E_PFINT_ITR0(0), 0x00000FFF, 3,
{I40E_PFINT_ITRN(1, 0), 0x00000FFF, 8, I40E_PFINT_ITRN(1, 1) - I40E_PFINT_ITRN(1, 0)}, I40E_PFINT_ITR0(1) - I40E_PFINT_ITR0(0)},
{I40E_PFINT_ITRN(2, 0), 0x00000FFF, 8, I40E_PFINT_ITRN(2, 1) - I40E_PFINT_ITRN(2, 0)}, {I40E_PFINT_ITRN(0, 0), 0x00000FFF, 1,
{I40E_PFINT_STAT_CTL0, 0x0000000C, 1, 0}, I40E_PFINT_ITRN(0, 1) - I40E_PFINT_ITRN(0, 0)},
{I40E_PFINT_LNKLST0, 0x00001FFF, 1, 0}, {I40E_PFINT_ITRN(1, 0), 0x00000FFF, 1,
{I40E_PFINT_LNKLSTN(0), 0x000007FF, 64, I40E_PFINT_LNKLSTN(1) - I40E_PFINT_LNKLSTN(0)}, I40E_PFINT_ITRN(1, 1) - I40E_PFINT_ITRN(1, 0)},
{I40E_QINT_TQCTL(0), 0x000000FF, 64, I40E_QINT_TQCTL(1) - I40E_QINT_TQCTL(0)}, {I40E_PFINT_ITRN(2, 0), 0x00000FFF, 1,
{I40E_QINT_RQCTL(0), 0x000000FF, 64, I40E_QINT_RQCTL(1) - I40E_QINT_RQCTL(0)}, I40E_PFINT_ITRN(2, 1) - I40E_PFINT_ITRN(2, 0)},
{I40E_PFINT_ICR0_ENA, 0xF7F20000, 1, 0}, {I40E_PFINT_STAT_CTL0, 0x0000000C, 1, 0},
{I40E_PFINT_LNKLST0, 0x00001FFF, 1, 0},
{I40E_PFINT_LNKLSTN(0), 0x000007FF, 1,
I40E_PFINT_LNKLSTN(1) - I40E_PFINT_LNKLSTN(0)},
{I40E_QINT_TQCTL(0), 0x000000FF, 1,
I40E_QINT_TQCTL(1) - I40E_QINT_TQCTL(0)},
{I40E_QINT_RQCTL(0), 0x000000FF, 1,
I40E_QINT_RQCTL(1) - I40E_QINT_RQCTL(0)},
{I40E_PFINT_ICR0_ENA, 0xF7F20000, 1, 0},
{ 0 } { 0 }
}; };
...@@ -93,9 +101,25 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw) ...@@ -93,9 +101,25 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw)
u32 reg, mask; u32 reg, mask;
u32 i, j; u32 i, j;
for (i = 0; (i40e_reg_list[i].offset != 0) && !ret_code; i++) { for (i = 0; i40e_reg_list[i].offset != 0 &&
!ret_code; i++) {
/* set actual reg range for dynamically allocated resources */
if (i40e_reg_list[i].offset == I40E_QTX_CTL(0) &&
hw->func_caps.num_tx_qp != 0)
i40e_reg_list[i].elements = hw->func_caps.num_tx_qp;
if ((i40e_reg_list[i].offset == I40E_PFINT_ITRN(0, 0) ||
i40e_reg_list[i].offset == I40E_PFINT_ITRN(1, 0) ||
i40e_reg_list[i].offset == I40E_PFINT_ITRN(2, 0) ||
i40e_reg_list[i].offset == I40E_QINT_TQCTL(0) ||
i40e_reg_list[i].offset == I40E_QINT_RQCTL(0)) &&
hw->func_caps.num_msix_vectors != 0)
i40e_reg_list[i].elements =
hw->func_caps.num_msix_vectors - 1;
/* test register access */
mask = i40e_reg_list[i].mask; mask = i40e_reg_list[i].mask;
for (j = 0; (j < i40e_reg_list[i].elements) && !ret_code; j++) { for (j = 0; j < i40e_reg_list[i].elements && !ret_code; j++) {
reg = i40e_reg_list[i].offset + reg = i40e_reg_list[i].offset +
(j * i40e_reg_list[i].stride); (j * i40e_reg_list[i].stride);
ret_code = i40e_diag_reg_pattern_test(hw, reg, mask); ret_code = i40e_diag_reg_pattern_test(hw, reg, mask);
......
...@@ -62,6 +62,12 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = { ...@@ -62,6 +62,12 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = {
I40E_NETDEV_STAT(rx_crc_errors), I40E_NETDEV_STAT(rx_crc_errors),
}; };
static const struct i40e_stats i40e_gstrings_misc_stats[] = {
I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast),
I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast),
};
static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
struct ethtool_rxnfc *cmd); struct ethtool_rxnfc *cmd);
...@@ -78,7 +84,6 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, ...@@ -78,7 +84,6 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
static struct i40e_stats i40e_gstrings_stats[] = { static struct i40e_stats i40e_gstrings_stats[] = {
I40E_PF_STAT("rx_bytes", stats.eth.rx_bytes), I40E_PF_STAT("rx_bytes", stats.eth.rx_bytes),
I40E_PF_STAT("tx_bytes", stats.eth.tx_bytes), I40E_PF_STAT("tx_bytes", stats.eth.tx_bytes),
I40E_PF_STAT("rx_errors", stats.eth.rx_errors),
I40E_PF_STAT("tx_errors", stats.eth.tx_errors), I40E_PF_STAT("tx_errors", stats.eth.tx_errors),
I40E_PF_STAT("rx_dropped", stats.eth.rx_discards), I40E_PF_STAT("rx_dropped", stats.eth.rx_discards),
I40E_PF_STAT("tx_dropped", stats.eth.tx_discards), I40E_PF_STAT("tx_dropped", stats.eth.tx_discards),
...@@ -126,7 +131,9 @@ static struct i40e_stats i40e_gstrings_stats[] = { ...@@ -126,7 +131,9 @@ static struct i40e_stats i40e_gstrings_stats[] = {
* (sizeof(struct i40e_queue_stats) / sizeof(u64))) * (sizeof(struct i40e_queue_stats) / sizeof(u64)))
#define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats) #define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats)
#define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats) #define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats)
#define I40E_MISC_STATS_LEN ARRAY_SIZE(i40e_gstrings_misc_stats)
#define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \ #define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \
I40E_MISC_STATS_LEN + \
I40E_QUEUE_STATS_LEN((n))) I40E_QUEUE_STATS_LEN((n)))
#define I40E_PFC_STATS_LEN ( \ #define I40E_PFC_STATS_LEN ( \
(FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \ (FIELD_SIZEOF(struct i40e_pf, stats.priority_xoff_rx) + \
...@@ -649,6 +656,11 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, ...@@ -649,6 +656,11 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
data[i++] = (i40e_gstrings_net_stats[j].sizeof_stat == data[i++] = (i40e_gstrings_net_stats[j].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
for (j = 0; j < I40E_MISC_STATS_LEN; j++) {
p = (char *)vsi + i40e_gstrings_misc_stats[j].stat_offset;
data[i++] = (i40e_gstrings_misc_stats[j].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
}
rcu_read_lock(); rcu_read_lock();
for (j = 0; j < vsi->num_queue_pairs; j++) { for (j = 0; j < vsi->num_queue_pairs; j++) {
tx_ring = ACCESS_ONCE(vsi->tx_rings[j]); tx_ring = ACCESS_ONCE(vsi->tx_rings[j]);
...@@ -715,6 +727,11 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset, ...@@ -715,6 +727,11 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
i40e_gstrings_net_stats[i].stat_string); i40e_gstrings_net_stats[i].stat_string);
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
} }
for (i = 0; i < I40E_MISC_STATS_LEN; i++) {
snprintf(p, ETH_GSTRING_LEN, "%s",
i40e_gstrings_misc_stats[i].stat_string);
p += ETH_GSTRING_LEN;
}
for (i = 0; i < vsi->num_queue_pairs; i++) { for (i = 0; i < vsi->num_queue_pairs; i++) {
snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i); snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i);
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
......
This diff is collapsed.
...@@ -458,13 +458,13 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring, ...@@ -458,13 +458,13 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,
*/ */
if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) { if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {
/* Turn off ATR first */ /* Turn off ATR first */
if (pf->flags | I40E_FLAG_FD_ATR_ENABLED) { if (pf->flags & I40E_FLAG_FD_ATR_ENABLED) {
pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED;
dev_warn(&pdev->dev, "FD filter space full, ATR for further flows will be turned off\n"); dev_warn(&pdev->dev, "FD filter space full, ATR for further flows will be turned off\n");
pf->auto_disable_flags |= pf->auto_disable_flags |=
I40E_FLAG_FD_ATR_ENABLED; I40E_FLAG_FD_ATR_ENABLED;
pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT; pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT;
} else if (pf->flags | I40E_FLAG_FD_SB_ENABLED) { } else if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
pf->flags &= ~I40E_FLAG_FD_SB_ENABLED; pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n"); dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n");
pf->auto_disable_flags |= pf->auto_disable_flags |=
......
...@@ -179,7 +179,6 @@ enum i40e_ring_state_t { ...@@ -179,7 +179,6 @@ enum i40e_ring_state_t {
__I40E_TX_DETECT_HANG, __I40E_TX_DETECT_HANG,
__I40E_HANG_CHECK_ARMED, __I40E_HANG_CHECK_ARMED,
__I40E_RX_PS_ENABLED, __I40E_RX_PS_ENABLED,
__I40E_RX_LRO_ENABLED,
__I40E_RX_16BYTE_DESC_ENABLED, __I40E_RX_16BYTE_DESC_ENABLED,
}; };
...@@ -195,12 +194,6 @@ enum i40e_ring_state_t { ...@@ -195,12 +194,6 @@ enum i40e_ring_state_t {
set_bit(__I40E_TX_DETECT_HANG, &(ring)->state) set_bit(__I40E_TX_DETECT_HANG, &(ring)->state)
#define clear_check_for_tx_hang(ring) \ #define clear_check_for_tx_hang(ring) \
clear_bit(__I40E_TX_DETECT_HANG, &(ring)->state) clear_bit(__I40E_TX_DETECT_HANG, &(ring)->state)
#define ring_is_lro_enabled(ring) \
test_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define set_ring_lro_enabled(ring) \
set_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define clear_ring_lro_enabled(ring) \
clear_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define ring_is_16byte_desc_enabled(ring) \ #define ring_is_16byte_desc_enabled(ring) \
test_bit(__I40E_RX_16BYTE_DESC_ENABLED, &(ring)->state) test_bit(__I40E_RX_16BYTE_DESC_ENABLED, &(ring)->state)
#define set_ring_16byte_desc_enabled(ring) \ #define set_ring_16byte_desc_enabled(ring) \
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
/* Max default timeout in ms, */ /* Max default timeout in ms, */
#define I40E_MAX_NVM_TIMEOUT 18000 #define I40E_MAX_NVM_TIMEOUT 18000
/* Switch from mc to the 2usec global time (this is the GTIME resolution) */ /* Switch from ms to the 1usec global time (this is the GTIME resolution) */
#define I40E_MS_TO_GTIME(time) (((time) * 1000) / 2) #define I40E_MS_TO_GTIME(time) ((time) * 1000)
/* forward declaration */ /* forward declaration */
struct i40e_hw; struct i40e_hw;
...@@ -955,6 +955,16 @@ struct i40e_vsi_context { ...@@ -955,6 +955,16 @@ struct i40e_vsi_context {
struct i40e_aqc_vsi_properties_data info; struct i40e_aqc_vsi_properties_data info;
}; };
struct i40e_veb_context {
u16 seid;
u16 uplink_seid;
u16 veb_number;
u16 vebs_allocated;
u16 vebs_unallocated;
u16 flags;
struct i40e_aqc_get_veb_parameters_completion info;
};
/* Statistics collected by each port, VSI, VEB, and S-channel */ /* Statistics collected by each port, VSI, VEB, and S-channel */
struct i40e_eth_stats { struct i40e_eth_stats {
u64 rx_bytes; /* gorc */ u64 rx_bytes; /* gorc */
...@@ -962,8 +972,6 @@ struct i40e_eth_stats { ...@@ -962,8 +972,6 @@ struct i40e_eth_stats {
u64 rx_multicast; /* mprc */ u64 rx_multicast; /* mprc */
u64 rx_broadcast; /* bprc */ u64 rx_broadcast; /* bprc */
u64 rx_discards; /* rdpc */ u64 rx_discards; /* rdpc */
u64 rx_errors; /* repc */
u64 rx_missed; /* rmpc */
u64 rx_unknown_protocol; /* rupp */ u64 rx_unknown_protocol; /* rupp */
u64 tx_bytes; /* gotc */ u64 tx_bytes; /* gotc */
u64 tx_unicast; /* uptc */ u64 tx_unicast; /* uptc */
......
...@@ -178,7 +178,6 @@ enum i40e_ring_state_t { ...@@ -178,7 +178,6 @@ enum i40e_ring_state_t {
__I40E_TX_DETECT_HANG, __I40E_TX_DETECT_HANG,
__I40E_HANG_CHECK_ARMED, __I40E_HANG_CHECK_ARMED,
__I40E_RX_PS_ENABLED, __I40E_RX_PS_ENABLED,
__I40E_RX_LRO_ENABLED,
__I40E_RX_16BYTE_DESC_ENABLED, __I40E_RX_16BYTE_DESC_ENABLED,
}; };
...@@ -194,12 +193,6 @@ enum i40e_ring_state_t { ...@@ -194,12 +193,6 @@ enum i40e_ring_state_t {
set_bit(__I40E_TX_DETECT_HANG, &(ring)->state) set_bit(__I40E_TX_DETECT_HANG, &(ring)->state)
#define clear_check_for_tx_hang(ring) \ #define clear_check_for_tx_hang(ring) \
clear_bit(__I40E_TX_DETECT_HANG, &(ring)->state) clear_bit(__I40E_TX_DETECT_HANG, &(ring)->state)
#define ring_is_lro_enabled(ring) \
test_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define set_ring_lro_enabled(ring) \
set_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define clear_ring_lro_enabled(ring) \
clear_bit(__I40E_RX_LRO_ENABLED, &(ring)->state)
#define ring_is_16byte_desc_enabled(ring) \ #define ring_is_16byte_desc_enabled(ring) \
test_bit(__I40E_RX_16BYTE_DESC_ENABLED, &(ring)->state) test_bit(__I40E_RX_16BYTE_DESC_ENABLED, &(ring)->state)
#define set_ring_16byte_desc_enabled(ring) \ #define set_ring_16byte_desc_enabled(ring) \
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
/* Max default timeout in ms, */ /* Max default timeout in ms, */
#define I40E_MAX_NVM_TIMEOUT 18000 #define I40E_MAX_NVM_TIMEOUT 18000
/* Switch from mc to the 2usec global time (this is the GTIME resolution) */ /* Switch from ms to the 1usec global time (this is the GTIME resolution) */
#define I40E_MS_TO_GTIME(time) (((time) * 1000) / 2) #define I40E_MS_TO_GTIME(time) ((time) * 1000)
/* forward declaration */ /* forward declaration */
struct i40e_hw; struct i40e_hw;
...@@ -955,6 +955,16 @@ struct i40e_vsi_context { ...@@ -955,6 +955,16 @@ struct i40e_vsi_context {
struct i40e_aqc_vsi_properties_data info; struct i40e_aqc_vsi_properties_data info;
}; };
struct i40e_veb_context {
u16 seid;
u16 uplink_seid;
u16 veb_number;
u16 vebs_allocated;
u16 vebs_unallocated;
u16 flags;
struct i40e_aqc_get_veb_parameters_completion info;
};
/* Statistics collected by each port, VSI, VEB, and S-channel */ /* Statistics collected by each port, VSI, VEB, and S-channel */
struct i40e_eth_stats { struct i40e_eth_stats {
u64 rx_bytes; /* gorc */ u64 rx_bytes; /* gorc */
...@@ -962,8 +972,6 @@ struct i40e_eth_stats { ...@@ -962,8 +972,6 @@ struct i40e_eth_stats {
u64 rx_multicast; /* mprc */ u64 rx_multicast; /* mprc */
u64 rx_broadcast; /* bprc */ u64 rx_broadcast; /* bprc */
u64 rx_discards; /* rdpc */ u64 rx_discards; /* rdpc */
u64 rx_errors; /* repc */
u64 rx_missed; /* rmpc */
u64 rx_unknown_protocol; /* rupp */ u64 rx_unknown_protocol; /* rupp */
u64 tx_bytes; /* gotc */ u64 tx_bytes; /* gotc */
u64 tx_unicast; /* uptc */ u64 tx_unicast; /* uptc */
......
...@@ -80,7 +80,7 @@ struct i40e_vsi { ...@@ -80,7 +80,7 @@ struct i40e_vsi {
#define I40EVF_MIN_TXD 64 #define I40EVF_MIN_TXD 64
#define I40EVF_MAX_RXD 4096 #define I40EVF_MAX_RXD 4096
#define I40EVF_MIN_RXD 64 #define I40EVF_MIN_RXD 64
#define I40EVF_REQ_DESCRIPTOR_MULTIPLE 8 #define I40EVF_REQ_DESCRIPTOR_MULTIPLE 32
/* Supported Rx Buffer Sizes */ /* Supported Rx Buffer Sizes */
#define I40EVF_RXBUFFER_64 64 /* Used for packet split */ #define I40EVF_RXBUFFER_64 64 /* Used for packet split */
...@@ -196,10 +196,12 @@ struct i40evf_adapter { ...@@ -196,10 +196,12 @@ struct i40evf_adapter {
struct i40e_ring *tx_rings[I40E_MAX_VSI_QP]; struct i40e_ring *tx_rings[I40E_MAX_VSI_QP];
u32 tx_timeout_count; u32 tx_timeout_count;
struct list_head mac_filter_list; struct list_head mac_filter_list;
u32 tx_desc_count;
/* RX */ /* RX */
struct i40e_ring *rx_rings[I40E_MAX_VSI_QP]; struct i40e_ring *rx_rings[I40E_MAX_VSI_QP];
u64 hw_csum_rx_error; u64 hw_csum_rx_error;
u32 rx_desc_count;
int num_msix_vectors; int num_msix_vectors;
struct msix_entry *msix_entries; struct msix_entry *msix_entries;
......
...@@ -47,8 +47,6 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = { ...@@ -47,8 +47,6 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {
I40EVF_STAT("rx_multicast", current_stats.rx_multicast), I40EVF_STAT("rx_multicast", current_stats.rx_multicast),
I40EVF_STAT("rx_broadcast", current_stats.rx_broadcast), I40EVF_STAT("rx_broadcast", current_stats.rx_broadcast),
I40EVF_STAT("rx_discards", current_stats.rx_discards), I40EVF_STAT("rx_discards", current_stats.rx_discards),
I40EVF_STAT("rx_errors", current_stats.rx_errors),
I40EVF_STAT("rx_missed", current_stats.rx_missed),
I40EVF_STAT("rx_unknown_protocol", current_stats.rx_unknown_protocol), I40EVF_STAT("rx_unknown_protocol", current_stats.rx_unknown_protocol),
I40EVF_STAT("tx_bytes", current_stats.tx_bytes), I40EVF_STAT("tx_bytes", current_stats.tx_bytes),
I40EVF_STAT("tx_unicast", current_stats.tx_unicast), I40EVF_STAT("tx_unicast", current_stats.tx_unicast),
...@@ -224,13 +222,11 @@ static void i40evf_get_ringparam(struct net_device *netdev, ...@@ -224,13 +222,11 @@ static void i40evf_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring) struct ethtool_ringparam *ring)
{ {
struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_adapter *adapter = netdev_priv(netdev);
struct i40e_ring *tx_ring = adapter->tx_rings[0];
struct i40e_ring *rx_ring = adapter->rx_rings[0];
ring->rx_max_pending = I40EVF_MAX_RXD; ring->rx_max_pending = I40EVF_MAX_RXD;
ring->tx_max_pending = I40EVF_MAX_TXD; ring->tx_max_pending = I40EVF_MAX_TXD;
ring->rx_pending = rx_ring->count; ring->rx_pending = adapter->rx_desc_count;
ring->tx_pending = tx_ring->count; ring->tx_pending = adapter->tx_desc_count;
} }
/** /**
...@@ -246,7 +242,6 @@ static int i40evf_set_ringparam(struct net_device *netdev, ...@@ -246,7 +242,6 @@ static int i40evf_set_ringparam(struct net_device *netdev,
{ {
struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_adapter *adapter = netdev_priv(netdev);
u32 new_rx_count, new_tx_count; u32 new_rx_count, new_tx_count;
int i;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL; return -EINVAL;
...@@ -262,17 +257,16 @@ static int i40evf_set_ringparam(struct net_device *netdev, ...@@ -262,17 +257,16 @@ static int i40evf_set_ringparam(struct net_device *netdev,
new_rx_count = ALIGN(new_rx_count, I40EVF_REQ_DESCRIPTOR_MULTIPLE); new_rx_count = ALIGN(new_rx_count, I40EVF_REQ_DESCRIPTOR_MULTIPLE);
/* if nothing to do return success */ /* if nothing to do return success */
if ((new_tx_count == adapter->tx_rings[0]->count) && if ((new_tx_count == adapter->tx_desc_count) &&
(new_rx_count == adapter->rx_rings[0]->count)) (new_rx_count == adapter->rx_desc_count))
return 0; return 0;
for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { adapter->tx_desc_count = new_tx_count;
adapter->tx_rings[0]->count = new_tx_count; adapter->rx_desc_count = new_rx_count;
adapter->rx_rings[0]->count = new_rx_count;
}
if (netif_running(netdev)) if (netif_running(netdev))
i40evf_reinit_locked(adapter); i40evf_reinit_locked(adapter);
return 0; return 0;
} }
......
...@@ -1091,14 +1091,14 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter) ...@@ -1091,14 +1091,14 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
tx_ring->queue_index = i; tx_ring->queue_index = i;
tx_ring->netdev = adapter->netdev; tx_ring->netdev = adapter->netdev;
tx_ring->dev = &adapter->pdev->dev; tx_ring->dev = &adapter->pdev->dev;
tx_ring->count = I40EVF_DEFAULT_TXD; tx_ring->count = adapter->tx_desc_count;
adapter->tx_rings[i] = tx_ring; adapter->tx_rings[i] = tx_ring;
rx_ring = &tx_ring[1]; rx_ring = &tx_ring[1];
rx_ring->queue_index = i; rx_ring->queue_index = i;
rx_ring->netdev = adapter->netdev; rx_ring->netdev = adapter->netdev;
rx_ring->dev = &adapter->pdev->dev; rx_ring->dev = &adapter->pdev->dev;
rx_ring->count = I40EVF_DEFAULT_RXD; rx_ring->count = adapter->rx_desc_count;
adapter->rx_rings[i] = rx_ring; adapter->rx_rings[i] = rx_ring;
} }
...@@ -1669,6 +1669,7 @@ static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter) ...@@ -1669,6 +1669,7 @@ static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter)
int i, err = 0; int i, err = 0;
for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) {
adapter->tx_rings[i]->count = adapter->tx_desc_count;
err = i40evf_setup_tx_descriptors(adapter->tx_rings[i]); err = i40evf_setup_tx_descriptors(adapter->tx_rings[i]);
if (!err) if (!err)
continue; continue;
...@@ -1696,6 +1697,7 @@ static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter) ...@@ -1696,6 +1697,7 @@ static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter)
int i, err = 0; int i, err = 0;
for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) {
adapter->rx_rings[i]->count = adapter->rx_desc_count;
err = i40evf_setup_rx_descriptors(adapter->rx_rings[i]); err = i40evf_setup_rx_descriptors(adapter->rx_rings[i]);
if (!err) if (!err)
continue; continue;
...@@ -2092,6 +2094,8 @@ static void i40evf_init_task(struct work_struct *work) ...@@ -2092,6 +2094,8 @@ static void i40evf_init_task(struct work_struct *work)
adapter->watchdog_timer.data = (unsigned long)adapter; adapter->watchdog_timer.data = (unsigned long)adapter;
mod_timer(&adapter->watchdog_timer, jiffies + 1); mod_timer(&adapter->watchdog_timer, jiffies + 1);
adapter->tx_desc_count = I40EVF_DEFAULT_TXD;
adapter->rx_desc_count = I40EVF_DEFAULT_RXD;
err = i40evf_init_interrupt_scheme(adapter); err = i40evf_init_interrupt_scheme(adapter);
if (err) if (err)
goto err_sw_init; goto err_sw_init;
......
...@@ -748,9 +748,8 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter, ...@@ -748,9 +748,8 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
stats->tx_broadcast; stats->tx_broadcast;
adapter->net_stats.rx_bytes = stats->rx_bytes; adapter->net_stats.rx_bytes = stats->rx_bytes;
adapter->net_stats.tx_bytes = stats->tx_bytes; adapter->net_stats.tx_bytes = stats->tx_bytes;
adapter->net_stats.rx_errors = stats->rx_errors;
adapter->net_stats.tx_errors = stats->tx_errors; adapter->net_stats.tx_errors = stats->tx_errors;
adapter->net_stats.rx_dropped = stats->rx_missed; adapter->net_stats.rx_dropped = stats->rx_discards;
adapter->net_stats.tx_dropped = stats->tx_discards; adapter->net_stats.tx_dropped = stats->tx_discards;
adapter->current_stats = *stats; adapter->current_stats = *stats;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment