diff options
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/base/efx_port.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/efsys.h | 2 | ||||
-rw-r--r-- | drivers/net/sfc/sfc.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/sfc_ev.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/sfc_flow.c | 6 | ||||
-rw-r--r-- | drivers/net/sfc/sfc_rx.c | 44 |
6 files changed, 51 insertions, 7 deletions
diff --git a/drivers/net/sfc/base/efx_port.c b/drivers/net/sfc/base/efx_port.c index 518c2a22..ec8a1575 100644 --- a/drivers/net/sfc/base/efx_port.c +++ b/drivers/net/sfc/base/efx_port.c @@ -145,7 +145,7 @@ efx_port_loopback_set( EFSYS_ASSERT(link_mode < EFX_LINK_NMODES); if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode], - loopback_type) == 0) { + (int)loopback_type) == 0) { rc = ENOTSUP; goto fail1; } diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h index f428b624..5b52c222 100644 --- a/drivers/net/sfc/efsys.h +++ b/drivers/net/sfc/efsys.h @@ -141,6 +141,8 @@ prefetch_read_once(const volatile void *addr) #define __out_ecount_opt(_n) #define __out_bcount(_n) #define __out_bcount_opt(_n) +#define __out_bcount_part(_n, _l) +#define __out_bcount_part_opt(_n, _l) #define __deref_out diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index 49d7e937..2196c3f1 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -548,6 +548,8 @@ sfc_set_rss_defaults(struct sfc_adapter *sa) fail_hash_support_get: fail_scale_support_get: + efx_rx_fini(sa->nic); + fail_rx_init: efx_ev_fini(sa->nic); diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index 5fbebbf1..ba22f7ef 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -859,7 +859,7 @@ static int sfc_kvarg_perf_profile_handler(__rte_unused const char *key, const char *value_str, void *opaque) { - uint64_t *value = opaque; + uint32_t *value = opaque; if (strcasecmp(value_str, SFC_KVARG_PERF_PROFILE_THROUGHPUT) == 0) *value = EFX_EVQ_FLAGS_TYPE_THROUGHPUT; diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index e770b98e..fddc6706 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -107,7 +107,6 @@ sfc_flow_parse_init(const struct rte_flow_item *item, const uint8_t *spec; const uint8_t *mask; const uint8_t *last; - uint8_t match; uint8_t supp; unsigned int i; @@ -168,12 +167,11 @@ sfc_flow_parse_init(const struct rte_flow_item *item, return -rte_errno; } - /* Check that mask and spec not asks for more match than supp_mask */ + /* Check that mask does not ask for more match than supp_mask */ for (i = 0; i < size; i++) { - match = spec[i] | mask[i]; supp = ((const uint8_t *)supp_mask)[i]; - if ((match | supp) != supp) { + if (~supp & mask[i]) { rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, "Item's field is not supported"); diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 7816393b..8fc93d68 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -814,7 +814,7 @@ sfc_rx_mbuf_data_alignment(struct rte_mempool *mb_pool) order = MIN(order, rte_bsf32(data_off)); - return 1u << (order - 1); + return 1u << order; } static uint16_t @@ -1096,6 +1096,41 @@ sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types) #if EFSYS_OPT_RX_SCALE static int +sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa, + struct rte_eth_rss_conf *conf) +{ + efx_rx_hash_type_t efx_hash_types = sa->rss_hash_types; + + if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) { + if ((conf->rss_hf != 0 && conf->rss_hf != SFC_RSS_OFFLOADS) || + conf->rss_key != NULL) + return EINVAL; + } + + if (conf->rss_hf != 0) { + if ((conf->rss_hf & ~SFC_RSS_OFFLOADS) != 0) { + sfc_err(sa, "unsupported hash functions requested"); + return EINVAL; + } + + efx_hash_types = sfc_rte_to_efx_hash_type(conf->rss_hf); + } + + if (conf->rss_key != NULL) { + if (conf->rss_key_len != sizeof(sa->rss_key)) { + sfc_err(sa, "RSS key size is wrong (should be %lu)", + sizeof(sa->rss_key)); + return EINVAL; + } + rte_memcpy(sa->rss_key, conf->rss_key, sizeof(sa->rss_key)); + } + + sa->rss_hash_types = efx_hash_types; + + return 0; +} + +static int sfc_rx_rss_config(struct sfc_adapter *sa) { int rc = 0; @@ -1347,16 +1382,23 @@ sfc_rx_configure(struct sfc_adapter *sa) MIN(sa->rxq_count, EFX_MAXRSS) : 0; if (sa->rss_channels > 0) { + struct rte_eth_rss_conf *adv_conf_rss; unsigned int sw_index; for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index) sa->rss_tbl[sw_index] = sw_index % sa->rss_channels; + + adv_conf_rss = &dev_conf->rx_adv_conf.rss_conf; + rc = sfc_rx_process_adv_conf_rss(sa, adv_conf_rss); + if (rc != 0) + goto fail_rx_process_adv_conf_rss; } #endif done: return 0; +fail_rx_process_adv_conf_rss: fail_rx_qinit_info: fail_rxqs_realloc: fail_rxqs_alloc: |