aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-10-01 21:32:55 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-01 21:32:55 -0400
commitd3d5df2c4b86786ea792b073f0df9cd82f7efcaa (patch)
tree1b7658dbe2e5a8db6ba3d166812b153b2fabcb13 /drivers/net/ethernet/sfc
parentd342894c5d2f8c7df194c793ec4059656e09ca31 (diff)
parent6ac7ef1487a040483d89a95045efc5185a71268f (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says: ==================== Some bug fixes that should go into 3.7: 1. Fix oops when removing device with SR-IOV enabled. (This regression was introduced by the last set of changes, so the fix does not need to be applied to any earlier kernel versions.) 2. Fix firmware structure field lookup bug that resulted in missing sensor information. 3. Fix bug that makes self-test do very little in some configurations. 4. Fix the numbering of ethtool RX flow steering filters to reflect the real hardware priorities. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r--drivers/net/ethernet/sfc/bitfield.h22
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c11
-rw-r--r--drivers/net/ethernet/sfc/filter.c108
-rw-r--r--drivers/net/ethernet/sfc/filter.h7
-rw-r--r--drivers/net/ethernet/sfc/mcdi.h6
-rw-r--r--drivers/net/ethernet/sfc/selftest.c3
-rw-r--r--drivers/net/ethernet/sfc/siena_sriov.c1
7 files changed, 76 insertions, 82 deletions
diff --git a/drivers/net/ethernet/sfc/bitfield.h b/drivers/net/ethernet/sfc/bitfield.h
index b26a954c27fc..5400a33f254f 100644
--- a/drivers/net/ethernet/sfc/bitfield.h
+++ b/drivers/net/ethernet/sfc/bitfield.h
@@ -120,10 +120,10 @@ typedef union efx_oword {
120 * [0,high-low), with garbage in bits [high-low+1,...). 120 * [0,high-low), with garbage in bits [high-low+1,...).
121 */ 121 */
122#define EFX_EXTRACT_NATIVE(native_element, min, max, low, high) \ 122#define EFX_EXTRACT_NATIVE(native_element, min, max, low, high) \
123 (((low > max) || (high < min)) ? 0 : \ 123 ((low) > (max) || (high) < (min) ? 0 : \
124 ((low > min) ? \ 124 (low) > (min) ? \
125 ((native_element) >> (low - min)) : \ 125 (native_element) >> ((low) - (min)) : \
126 ((native_element) << (min - low)))) 126 (native_element) << ((min) - (low)))
127 127
128/* 128/*
129 * Extract bit field portion [low,high) from the 64-bit little-endian 129 * Extract bit field portion [low,high) from the 64-bit little-endian
@@ -142,27 +142,27 @@ typedef union efx_oword {
142#define EFX_EXTRACT_OWORD64(oword, low, high) \ 142#define EFX_EXTRACT_OWORD64(oword, low, high) \
143 ((EFX_EXTRACT64((oword).u64[0], 0, 63, low, high) | \ 143 ((EFX_EXTRACT64((oword).u64[0], 0, 63, low, high) | \
144 EFX_EXTRACT64((oword).u64[1], 64, 127, low, high)) & \ 144 EFX_EXTRACT64((oword).u64[1], 64, 127, low, high)) & \
145 EFX_MASK64(high + 1 - low)) 145 EFX_MASK64((high) + 1 - (low)))
146 146
147#define EFX_EXTRACT_QWORD64(qword, low, high) \ 147#define EFX_EXTRACT_QWORD64(qword, low, high) \
148 (EFX_EXTRACT64((qword).u64[0], 0, 63, low, high) & \ 148 (EFX_EXTRACT64((qword).u64[0], 0, 63, low, high) & \
149 EFX_MASK64(high + 1 - low)) 149 EFX_MASK64((high) + 1 - (low)))
150 150
151#define EFX_EXTRACT_OWORD32(oword, low, high) \ 151#define EFX_EXTRACT_OWORD32(oword, low, high) \
152 ((EFX_EXTRACT32((oword).u32[0], 0, 31, low, high) | \ 152 ((EFX_EXTRACT32((oword).u32[0], 0, 31, low, high) | \
153 EFX_EXTRACT32((oword).u32[1], 32, 63, low, high) | \ 153 EFX_EXTRACT32((oword).u32[1], 32, 63, low, high) | \
154 EFX_EXTRACT32((oword).u32[2], 64, 95, low, high) | \ 154 EFX_EXTRACT32((oword).u32[2], 64, 95, low, high) | \
155 EFX_EXTRACT32((oword).u32[3], 96, 127, low, high)) & \ 155 EFX_EXTRACT32((oword).u32[3], 96, 127, low, high)) & \
156 EFX_MASK32(high + 1 - low)) 156 EFX_MASK32((high) + 1 - (low)))
157 157
158#define EFX_EXTRACT_QWORD32(qword, low, high) \ 158#define EFX_EXTRACT_QWORD32(qword, low, high) \
159 ((EFX_EXTRACT32((qword).u32[0], 0, 31, low, high) | \ 159 ((EFX_EXTRACT32((qword).u32[0], 0, 31, low, high) | \
160 EFX_EXTRACT32((qword).u32[1], 32, 63, low, high)) & \ 160 EFX_EXTRACT32((qword).u32[1], 32, 63, low, high)) & \
161 EFX_MASK32(high + 1 - low)) 161 EFX_MASK32((high) + 1 - (low)))
162 162
163#define EFX_EXTRACT_DWORD(dword, low, high) \ 163#define EFX_EXTRACT_DWORD(dword, low, high) \
164 (EFX_EXTRACT32((dword).u32[0], 0, 31, low, high) & \ 164 (EFX_EXTRACT32((dword).u32[0], 0, 31, low, high) & \
165 EFX_MASK32(high + 1 - low)) 165 EFX_MASK32((high) + 1 - (low)))
166 166
167#define EFX_OWORD_FIELD64(oword, field) \ 167#define EFX_OWORD_FIELD64(oword, field) \
168 EFX_EXTRACT_OWORD64(oword, EFX_LOW_BIT(field), \ 168 EFX_EXTRACT_OWORD64(oword, EFX_LOW_BIT(field), \
@@ -442,10 +442,10 @@ typedef union efx_oword {
442 cpu_to_le32(EFX_INSERT_NATIVE(min, max, low, high, value)) 442 cpu_to_le32(EFX_INSERT_NATIVE(min, max, low, high, value))
443 443
444#define EFX_INPLACE_MASK64(min, max, low, high) \ 444#define EFX_INPLACE_MASK64(min, max, low, high) \
445 EFX_INSERT64(min, max, low, high, EFX_MASK64(high + 1 - low)) 445 EFX_INSERT64(min, max, low, high, EFX_MASK64((high) + 1 - (low)))
446 446
447#define EFX_INPLACE_MASK32(min, max, low, high) \ 447#define EFX_INPLACE_MASK32(min, max, low, high) \
448 EFX_INSERT32(min, max, low, high, EFX_MASK32(high + 1 - low)) 448 EFX_INSERT32(min, max, low, high, EFX_MASK32((high) + 1 - (low)))
449 449
450#define EFX_SET_OWORD64(oword, low, high, value) do { \ 450#define EFX_SET_OWORD64(oword, low, high, value) do { \
451 (oword).u64[0] = (((oword).u64[0] \ 451 (oword).u64[0] = (((oword).u64[0] \
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 9df556c01b8e..90f078eff8e6 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -337,7 +337,8 @@ static int efx_fill_loopback_test(struct efx_nic *efx,
337 unsigned int test_index, 337 unsigned int test_index,
338 struct ethtool_string *strings, u64 *data) 338 struct ethtool_string *strings, u64 *data)
339{ 339{
340 struct efx_channel *channel = efx_get_channel(efx, 0); 340 struct efx_channel *channel =
341 efx_get_channel(efx, efx->tx_channel_offset);
341 struct efx_tx_queue *tx_queue; 342 struct efx_tx_queue *tx_queue;
342 343
343 efx_for_each_channel_tx_queue(tx_queue, channel) { 344 efx_for_each_channel_tx_queue(tx_queue, channel) {
@@ -960,9 +961,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
960 int rc; 961 int rc;
961 962
962 /* Check that user wants us to choose the location */ 963 /* Check that user wants us to choose the location */
963 if (rule->location != RX_CLS_LOC_ANY && 964 if (rule->location != RX_CLS_LOC_ANY)
964 rule->location != RX_CLS_LOC_FIRST &&
965 rule->location != RX_CLS_LOC_LAST)
966 return -EINVAL; 965 return -EINVAL;
967 966
968 /* Range-check ring_cookie */ 967 /* Range-check ring_cookie */
@@ -976,9 +975,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
976 rule->m_ext.data[1])) 975 rule->m_ext.data[1]))
977 return -EINVAL; 976 return -EINVAL;
978 977
979 efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL, 978 efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL, 0,
980 (rule->location == RX_CLS_LOC_FIRST) ?
981 EFX_FILTER_FLAG_RX_OVERRIDE_IP : 0,
982 (rule->ring_cookie == RX_CLS_FLOW_DISC) ? 979 (rule->ring_cookie == RX_CLS_FLOW_DISC) ?
983 0xfff : rule->ring_cookie); 980 0xfff : rule->ring_cookie);
984 981
diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c
index c3fd61f0a95c..8af42cd1feda 100644
--- a/drivers/net/ethernet/sfc/filter.c
+++ b/drivers/net/ethernet/sfc/filter.c
@@ -162,20 +162,12 @@ static void efx_filter_push_rx_config(struct efx_nic *efx)
162 !!(table->spec[EFX_FILTER_INDEX_UC_DEF].flags & 162 !!(table->spec[EFX_FILTER_INDEX_UC_DEF].flags &
163 EFX_FILTER_FLAG_RX_RSS)); 163 EFX_FILTER_FLAG_RX_RSS));
164 EFX_SET_OWORD_FIELD( 164 EFX_SET_OWORD_FIELD(
165 filter_ctl, FRF_CZ_UNICAST_NOMATCH_IP_OVERRIDE,
166 !!(table->spec[EFX_FILTER_INDEX_UC_DEF].flags &
167 EFX_FILTER_FLAG_RX_OVERRIDE_IP));
168 EFX_SET_OWORD_FIELD(
169 filter_ctl, FRF_CZ_MULTICAST_NOMATCH_Q_ID, 165 filter_ctl, FRF_CZ_MULTICAST_NOMATCH_Q_ID,
170 table->spec[EFX_FILTER_INDEX_MC_DEF].dmaq_id); 166 table->spec[EFX_FILTER_INDEX_MC_DEF].dmaq_id);
171 EFX_SET_OWORD_FIELD( 167 EFX_SET_OWORD_FIELD(
172 filter_ctl, FRF_CZ_MULTICAST_NOMATCH_RSS_ENABLED, 168 filter_ctl, FRF_CZ_MULTICAST_NOMATCH_RSS_ENABLED,
173 !!(table->spec[EFX_FILTER_INDEX_MC_DEF].flags & 169 !!(table->spec[EFX_FILTER_INDEX_MC_DEF].flags &
174 EFX_FILTER_FLAG_RX_RSS)); 170 EFX_FILTER_FLAG_RX_RSS));
175 EFX_SET_OWORD_FIELD(
176 filter_ctl, FRF_CZ_MULTICAST_NOMATCH_IP_OVERRIDE,
177 !!(table->spec[EFX_FILTER_INDEX_MC_DEF].flags &
178 EFX_FILTER_FLAG_RX_OVERRIDE_IP));
179 } 171 }
180 172
181 efx_writeo(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL); 173 efx_writeo(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL);
@@ -480,14 +472,12 @@ static u32 efx_filter_build(efx_oword_t *filter, struct efx_filter_spec *spec)
480 472
481 case EFX_FILTER_TABLE_RX_MAC: { 473 case EFX_FILTER_TABLE_RX_MAC: {
482 bool is_wild = spec->type == EFX_FILTER_MAC_WILD; 474 bool is_wild = spec->type == EFX_FILTER_MAC_WILD;
483 EFX_POPULATE_OWORD_8( 475 EFX_POPULATE_OWORD_7(
484 *filter, 476 *filter,
485 FRF_CZ_RMFT_RSS_EN, 477 FRF_CZ_RMFT_RSS_EN,
486 !!(spec->flags & EFX_FILTER_FLAG_RX_RSS), 478 !!(spec->flags & EFX_FILTER_FLAG_RX_RSS),
487 FRF_CZ_RMFT_SCATTER_EN, 479 FRF_CZ_RMFT_SCATTER_EN,
488 !!(spec->flags & EFX_FILTER_FLAG_RX_SCATTER), 480 !!(spec->flags & EFX_FILTER_FLAG_RX_SCATTER),
489 FRF_CZ_RMFT_IP_OVERRIDE,
490 !!(spec->flags & EFX_FILTER_FLAG_RX_OVERRIDE_IP),
491 FRF_CZ_RMFT_RXQ_ID, spec->dmaq_id, 481 FRF_CZ_RMFT_RXQ_ID, spec->dmaq_id,
492 FRF_CZ_RMFT_WILDCARD_MATCH, is_wild, 482 FRF_CZ_RMFT_WILDCARD_MATCH, is_wild,
493 FRF_CZ_RMFT_DEST_MAC_HI, spec->data[2], 483 FRF_CZ_RMFT_DEST_MAC_HI, spec->data[2],
@@ -567,49 +557,62 @@ static int efx_filter_search(struct efx_filter_table *table,
567} 557}
568 558
569/* 559/*
570 * Construct/deconstruct external filter IDs. These must be ordered 560 * Construct/deconstruct external filter IDs. At least the RX filter
571 * by matching priority, for RX NFC semantics. 561 * IDs must be ordered by matching priority, for RX NFC semantics.
572 * 562 *
573 * Each RX MAC filter entry has a flag for whether it can override an 563 * Deconstruction needs to be robust against invalid IDs so that
574 * RX IP filter that also matches. So we assign locations for MAC 564 * efx_filter_remove_id_safe() and efx_filter_get_filter_safe() can
575 * filters with overriding behaviour, then for IP filters, then for 565 * accept user-provided IDs.
576 * MAC filters without overriding behaviour.
577 */ 566 */
578 567
579#define EFX_FILTER_MATCH_PRI_RX_MAC_OVERRIDE_IP 0 568#define EFX_FILTER_MATCH_PRI_COUNT 5
580#define EFX_FILTER_MATCH_PRI_RX_DEF_OVERRIDE_IP 1 569
581#define EFX_FILTER_MATCH_PRI_NORMAL_BASE 2 570static const u8 efx_filter_type_match_pri[EFX_FILTER_TYPE_COUNT] = {
571 [EFX_FILTER_TCP_FULL] = 0,
572 [EFX_FILTER_UDP_FULL] = 0,
573 [EFX_FILTER_TCP_WILD] = 1,
574 [EFX_FILTER_UDP_WILD] = 1,
575 [EFX_FILTER_MAC_FULL] = 2,
576 [EFX_FILTER_MAC_WILD] = 3,
577 [EFX_FILTER_UC_DEF] = 4,
578 [EFX_FILTER_MC_DEF] = 4,
579};
580
581static const enum efx_filter_table_id efx_filter_range_table[] = {
582 EFX_FILTER_TABLE_RX_IP, /* RX match pri 0 */
583 EFX_FILTER_TABLE_RX_IP,
584 EFX_FILTER_TABLE_RX_MAC,
585 EFX_FILTER_TABLE_RX_MAC,
586 EFX_FILTER_TABLE_RX_DEF, /* RX match pri 4 */
587 EFX_FILTER_TABLE_COUNT, /* TX match pri 0; invalid */
588 EFX_FILTER_TABLE_COUNT, /* invalid */
589 EFX_FILTER_TABLE_TX_MAC,
590 EFX_FILTER_TABLE_TX_MAC, /* TX match pri 3 */
591};
582 592
583#define EFX_FILTER_INDEX_WIDTH 13 593#define EFX_FILTER_INDEX_WIDTH 13
584#define EFX_FILTER_INDEX_MASK ((1 << EFX_FILTER_INDEX_WIDTH) - 1) 594#define EFX_FILTER_INDEX_MASK ((1 << EFX_FILTER_INDEX_WIDTH) - 1)
585 595
586static inline u32 efx_filter_make_id(enum efx_filter_table_id table_id, 596static inline u32
587 unsigned int index, u8 flags) 597efx_filter_make_id(const struct efx_filter_spec *spec, unsigned int index)
588{ 598{
589 unsigned int match_pri = EFX_FILTER_MATCH_PRI_NORMAL_BASE + table_id; 599 unsigned int range;
590 600
591 if (flags & EFX_FILTER_FLAG_RX_OVERRIDE_IP) { 601 range = efx_filter_type_match_pri[spec->type];
592 if (table_id == EFX_FILTER_TABLE_RX_MAC) 602 if (!(spec->flags & EFX_FILTER_FLAG_RX))
593 match_pri = EFX_FILTER_MATCH_PRI_RX_MAC_OVERRIDE_IP; 603 range += EFX_FILTER_MATCH_PRI_COUNT;
594 else if (table_id == EFX_FILTER_TABLE_RX_DEF)
595 match_pri = EFX_FILTER_MATCH_PRI_RX_DEF_OVERRIDE_IP;
596 }
597 604
598 return match_pri << EFX_FILTER_INDEX_WIDTH | index; 605 return range << EFX_FILTER_INDEX_WIDTH | index;
599} 606}
600 607
601static inline enum efx_filter_table_id efx_filter_id_table_id(u32 id) 608static inline enum efx_filter_table_id efx_filter_id_table_id(u32 id)
602{ 609{
603 unsigned int match_pri = id >> EFX_FILTER_INDEX_WIDTH; 610 unsigned int range = id >> EFX_FILTER_INDEX_WIDTH;
604 611
605 switch (match_pri) { 612 if (range < ARRAY_SIZE(efx_filter_range_table))
606 case EFX_FILTER_MATCH_PRI_RX_MAC_OVERRIDE_IP: 613 return efx_filter_range_table[range];
607 return EFX_FILTER_TABLE_RX_MAC; 614 else
608 case EFX_FILTER_MATCH_PRI_RX_DEF_OVERRIDE_IP: 615 return EFX_FILTER_TABLE_COUNT; /* invalid */
609 return EFX_FILTER_TABLE_RX_DEF;
610 default:
611 return match_pri - EFX_FILTER_MATCH_PRI_NORMAL_BASE;
612 }
613} 616}
614 617
615static inline unsigned int efx_filter_id_index(u32 id) 618static inline unsigned int efx_filter_id_index(u32 id)
@@ -619,12 +622,9 @@ static inline unsigned int efx_filter_id_index(u32 id)
619 622
620static inline u8 efx_filter_id_flags(u32 id) 623static inline u8 efx_filter_id_flags(u32 id)
621{ 624{
622 unsigned int match_pri = id >> EFX_FILTER_INDEX_WIDTH; 625 unsigned int range = id >> EFX_FILTER_INDEX_WIDTH;
623 626
624 if (match_pri < EFX_FILTER_MATCH_PRI_NORMAL_BASE) 627 if (range < EFX_FILTER_MATCH_PRI_COUNT)
625 return EFX_FILTER_FLAG_RX | EFX_FILTER_FLAG_RX_OVERRIDE_IP;
626 else if (match_pri <=
627 EFX_FILTER_MATCH_PRI_NORMAL_BASE + EFX_FILTER_TABLE_RX_DEF)
628 return EFX_FILTER_FLAG_RX; 628 return EFX_FILTER_FLAG_RX;
629 else 629 else
630 return EFX_FILTER_FLAG_TX; 630 return EFX_FILTER_FLAG_TX;
@@ -633,14 +633,15 @@ static inline u8 efx_filter_id_flags(u32 id)
633u32 efx_filter_get_rx_id_limit(struct efx_nic *efx) 633u32 efx_filter_get_rx_id_limit(struct efx_nic *efx)
634{ 634{
635 struct efx_filter_state *state = efx->filter_state; 635 struct efx_filter_state *state = efx->filter_state;
636 unsigned int table_id = EFX_FILTER_TABLE_RX_DEF; 636 unsigned int range = EFX_FILTER_MATCH_PRI_COUNT - 1;
637 enum efx_filter_table_id table_id;
637 638
638 do { 639 do {
640 table_id = efx_filter_range_table[range];
639 if (state->table[table_id].size != 0) 641 if (state->table[table_id].size != 0)
640 return ((EFX_FILTER_MATCH_PRI_NORMAL_BASE + table_id) 642 return range << EFX_FILTER_INDEX_WIDTH |
641 << EFX_FILTER_INDEX_WIDTH) +
642 state->table[table_id].size; 643 state->table[table_id].size;
643 } while (table_id--); 644 } while (range--);
644 645
645 return 0; 646 return 0;
646} 647}
@@ -718,7 +719,7 @@ s32 efx_filter_insert_filter(struct efx_nic *efx, struct efx_filter_spec *spec,
718 netif_vdbg(efx, hw, efx->net_dev, 719 netif_vdbg(efx, hw, efx->net_dev,
719 "%s: filter type %d index %d rxq %u set", 720 "%s: filter type %d index %d rxq %u set",
720 __func__, spec->type, filter_idx, spec->dmaq_id); 721 __func__, spec->type, filter_idx, spec->dmaq_id);
721 rc = efx_filter_make_id(table->id, filter_idx, spec->flags); 722 rc = efx_filter_make_id(spec, filter_idx);
722 723
723out: 724out:
724 spin_unlock_bh(&state->lock); 725 spin_unlock_bh(&state->lock);
@@ -781,8 +782,7 @@ int efx_filter_remove_id_safe(struct efx_nic *efx,
781 spin_lock_bh(&state->lock); 782 spin_lock_bh(&state->lock);
782 783
783 if (test_bit(filter_idx, table->used_bitmap) && 784 if (test_bit(filter_idx, table->used_bitmap) &&
784 spec->priority == priority && 785 spec->priority == priority) {
785 !((spec->flags ^ filter_flags) & EFX_FILTER_FLAG_RX_OVERRIDE_IP)) {
786 efx_filter_table_clear_entry(efx, table, filter_idx); 786 efx_filter_table_clear_entry(efx, table, filter_idx);
787 if (table->used == 0) 787 if (table->used == 0)
788 efx_filter_table_reset_search_depth(table); 788 efx_filter_table_reset_search_depth(table);
@@ -833,8 +833,7 @@ int efx_filter_get_filter_safe(struct efx_nic *efx,
833 spin_lock_bh(&state->lock); 833 spin_lock_bh(&state->lock);
834 834
835 if (test_bit(filter_idx, table->used_bitmap) && 835 if (test_bit(filter_idx, table->used_bitmap) &&
836 spec->priority == priority && 836 spec->priority == priority) {
837 !((spec->flags ^ filter_flags) & EFX_FILTER_FLAG_RX_OVERRIDE_IP)) {
838 *spec_buf = *spec; 837 *spec_buf = *spec;
839 rc = 0; 838 rc = 0;
840 } else { 839 } else {
@@ -927,8 +926,7 @@ s32 efx_filter_get_rx_ids(struct efx_nic *efx,
927 goto out; 926 goto out;
928 } 927 }
929 buf[count++] = efx_filter_make_id( 928 buf[count++] = efx_filter_make_id(
930 table_id, filter_idx, 929 &table->spec[filter_idx], filter_idx);
931 table->spec[filter_idx].flags);
932 } 930 }
933 } 931 }
934 } 932 }
diff --git a/drivers/net/ethernet/sfc/filter.h b/drivers/net/ethernet/sfc/filter.h
index 3c77802aed6c..5cb54723b824 100644
--- a/drivers/net/ethernet/sfc/filter.h
+++ b/drivers/net/ethernet/sfc/filter.h
@@ -61,16 +61,12 @@ enum efx_filter_priority {
61 * according to the indirection table. 61 * according to the indirection table.
62 * @EFX_FILTER_FLAG_RX_SCATTER: Enable DMA scatter on the receiving 62 * @EFX_FILTER_FLAG_RX_SCATTER: Enable DMA scatter on the receiving
63 * queue. 63 * queue.
64 * @EFX_FILTER_FLAG_RX_OVERRIDE_IP: Enables a MAC filter to override
65 * any IP filter that matches the same packet. By default, IP
66 * filters take precedence.
67 * @EFX_FILTER_FLAG_RX: Filter is for RX 64 * @EFX_FILTER_FLAG_RX: Filter is for RX
68 * @EFX_FILTER_FLAG_TX: Filter is for TX 65 * @EFX_FILTER_FLAG_TX: Filter is for TX
69 */ 66 */
70enum efx_filter_flags { 67enum efx_filter_flags {
71 EFX_FILTER_FLAG_RX_RSS = 0x01, 68 EFX_FILTER_FLAG_RX_RSS = 0x01,
72 EFX_FILTER_FLAG_RX_SCATTER = 0x02, 69 EFX_FILTER_FLAG_RX_SCATTER = 0x02,
73 EFX_FILTER_FLAG_RX_OVERRIDE_IP = 0x04,
74 EFX_FILTER_FLAG_RX = 0x08, 70 EFX_FILTER_FLAG_RX = 0x08,
75 EFX_FILTER_FLAG_TX = 0x10, 71 EFX_FILTER_FLAG_TX = 0x10,
76}; 72};
@@ -88,8 +84,7 @@ enum efx_filter_flags {
88 * 84 *
89 * The @priority field is used by software to determine whether a new 85 * The @priority field is used by software to determine whether a new
90 * filter may replace an old one. The hardware priority of a filter 86 * filter may replace an old one. The hardware priority of a filter
91 * depends on the filter type and %EFX_FILTER_FLAG_RX_OVERRIDE_IP 87 * depends on the filter type.
92 * flag.
93 */ 88 */
94struct efx_filter_spec { 89struct efx_filter_spec {
95 u8 type:4; 90 u8 type:4;
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h
index dc25caaa3983..3ba2e5b5a9cc 100644
--- a/drivers/net/ethernet/sfc/mcdi.h
+++ b/drivers/net/ethernet/sfc/mcdi.h
@@ -113,11 +113,13 @@ extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev);
113#define MCDI_EVENT_FIELD(_ev, _field) \ 113#define MCDI_EVENT_FIELD(_ev, _field) \
114 EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field) 114 EFX_QWORD_FIELD(_ev, MCDI_EVENT_ ## _field)
115#define MCDI_ARRAY_FIELD(_buf, _field1, _type, _index, _field2) \ 115#define MCDI_ARRAY_FIELD(_buf, _field1, _type, _index, _field2) \
116 EFX_DWORD_FIELD( \ 116 EFX_EXTRACT_DWORD( \
117 *((efx_dword_t *) \ 117 *((efx_dword_t *) \
118 (MCDI_ARRAY_PTR(_buf, _field1, _type, _index) + \ 118 (MCDI_ARRAY_PTR(_buf, _field1, _type, _index) + \
119 (MC_CMD_ ## _type ## _TYPEDEF_ ## _field2 ## _OFST & ~3))), \ 119 (MC_CMD_ ## _type ## _TYPEDEF_ ## _field2 ## _OFST & ~3))), \
120 MC_CMD_ ## _type ## _TYPEDEF_ ## _field2) 120 MC_CMD_ ## _type ## _TYPEDEF_ ## _field2 ## _LBN & 0x1f, \
121 (MC_CMD_ ## _type ## _TYPEDEF_ ## _field2 ## _LBN & 0x1f) + \
122 MC_CMD_ ## _type ## _TYPEDEF_ ## _field2 ## _WIDTH - 1)
121 123
122extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); 124extern void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len);
123extern int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, 125extern int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index 96068d15b601..ce72ae4f399f 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -614,7 +614,8 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests,
614{ 614{
615 enum efx_loopback_mode mode; 615 enum efx_loopback_mode mode;
616 struct efx_loopback_state *state; 616 struct efx_loopback_state *state;
617 struct efx_channel *channel = efx_get_channel(efx, 0); 617 struct efx_channel *channel =
618 efx_get_channel(efx, efx->tx_channel_offset);
618 struct efx_tx_queue *tx_queue; 619 struct efx_tx_queue *tx_queue;
619 int rc = 0; 620 int rc = 0;
620 621
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c
index a8f48a455849..d49b53dc2a50 100644
--- a/drivers/net/ethernet/sfc/siena_sriov.c
+++ b/drivers/net/ethernet/sfc/siena_sriov.c
@@ -1035,6 +1035,7 @@ efx_sriov_get_channel_name(struct efx_channel *channel, char *buf, size_t len)
1035static const struct efx_channel_type efx_sriov_channel_type = { 1035static const struct efx_channel_type efx_sriov_channel_type = {
1036 .handle_no_channel = efx_sriov_handle_no_channel, 1036 .handle_no_channel = efx_sriov_handle_no_channel,
1037 .pre_probe = efx_sriov_probe_channel, 1037 .pre_probe = efx_sriov_probe_channel,
1038 .post_remove = efx_channel_dummy_op_void,
1038 .get_name = efx_sriov_get_channel_name, 1039 .get_name = efx_sriov_get_channel_name,
1039 /* no copy operation; channel must not be reallocated */ 1040 /* no copy operation; channel must not be reallocated */
1040 .keep_eventq = true, 1041 .keep_eventq = true,