drivers/i40e: fix X722 macro absence result in compile
PATCH v2 1/2 drivers/i40e: fix X722 macro absence result in compile
Since some register only be supported by X722 but may not be supported by other NICs, so add X722 macro to distinguish that to avoid compile error when the X722 macro is undefined.
Fixes d0a349409bd7 (“i40e: support AQ based RSS config”)
Fixes 001a1c0f98f4 ("ethdev: get registers width")
Fixes a0454b5d2e08 (“i40e: update device ids”)
Fixes 647d1eaf758b (“i40evf: support AQ based RSS config”)
Fixes 3058891a2b02 (“net/i40e: move PCI device ids to the driver”)
Fixes d9efd0136ac1 (“i40e: add EEPROM and registers dumping”)
Signed-off-by Jeff Guo <[email protected]>
---
v2:
fix compile error when x722 macro is not define.
--- drivers/net/i40e/i40e_ethdev.c | 36 ++++++++++++++- drivers/net/i40e/i40e_ethdev.h | 17 +++++++ drivers/net/i40e/i40e_ethdev_vf.c | 27 +++++++++++ drivers/net/i40e/i40e_regs.h | 96 +++++++++++++++++++++++++++++++++++++++ drivers/net/i40e/i40e_rxtx.c | 18 +++++++- 5 files changed, 191 insertions(+), 3 deletions(-)
drivers/net/i40e/i40e_ethdev.c +34 -2
@@ -468,13 +468,17 @@ static const struct rte_pci_id pci_id_i40e_map[] = { { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28) }, +#ifdef X722_SUPPORT +#ifdef X722_A0_SUPPORT { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_X722_A0) }, +#endif /* X722_A0_SUPPORT */ { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722) }, { RTE_PCI_DEVICE(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722) }, +#endif /* X722_SUPPORT */ { .vendor_id = 0, /* sentinel */ }, };
@@ -3182,6 +3186,7 @@ i40e_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size)if (!lut)return -EINVAL ; +#ifdef X722_SUPPORT if (pf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_get_rss_lut (hw, vsi->vsi_id, TRUE, lut, lut_size);
@@ -3190,12 +3195,15 @@ i40e_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *lut_dw = (uint32_t *)lut;uint16_t i, lut_size_dw = lut_size /4 ;for (i =0 ; i < lut_size_dw; i++) lut_dw[i] =I40E_READ_REG (hw,I40E_PFQF_HLUT (i)); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return 0 ; }
@@ -3213,6 +3221,7 @@ i40e_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) pf =I40E_VSI_TO_PF (vsi); hw =I40E_VSI_TO_HW (vsi); +#ifdef X722_SUPPORT if (pf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_set_rss_lut (hw, vsi->vsi_id, TRUE, lut, lut_size);
@@ -3221,13 +3230,16 @@ i40e_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *lut_dw = (uint32_t *)lut;uint16_t i, lut_size_dw = lut_size /4 ;for (i =0 ; i < lut_size_dw; i++)I40E_WRITE_REG (hw,I40E_PFQF_HLUT (i), lut_dw[i]);I40E_WRITE_FLUSH (hw); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return 0 ; }
@@ -3508,8 +3520,10 @@ i40e_pf_parameter_init(struct rte_eth_dev *dev) pf->lan_nb_qps =1 ; }else { pf->flags |=I40E_FLAG_RSS ; +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_X722 ) pf->flags |=I40E_FLAG_RSS_AQ_CAPABLE ; +#endif /* X722_SUPPORT */ pf->lan_nb_qps = pf->lan_nb_qp_max; } qp_count += pf->lan_nb_qps;
@@ -6302,6 +6316,7 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len)return -EINVAL ; } +#ifdef X722_SUPPORT if (pf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) {struct i40e_aqc_get_set_rss_key_data *key_dw = (struct i40e_aqc_get_set_rss_key_data *)key;
@@ -6311,13 +6326,16 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len)PMD_INIT_LOG (ERR ,"Failed to configure RSS key " "via AQ"); }else { +#endif /* X722_SUPPORT */ uint32_t *hash_key = (uint32_t *)key;uint16_t i;for (i =0 ; i <=I40E_PFQF_HKEY_MAX_INDEX ; i++)i40e_write_rx_ctl (hw,I40E_PFQF_HKEY (i), hash_key[i]);I40E_WRITE_FLUSH (hw); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return ret; }
@@ -6332,6 +6350,7 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)if (!key || !key_len)return -EINVAL ; +#ifdef X722_SUPPORT if (pf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_get_rss_key (hw, vsi->vsi_id, (struct i40e_aqc_get_set_rss_key_data *)key);
@@ -6340,12 +6359,16 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *key_dw = (uint32_t *)key;uint16_t i;for (i =0 ; i <=I40E_PFQF_HKEY_MAX_INDEX ; i++) key_dw[i] =i40e_read_rx_ctl (hw,I40E_PFQF_HKEY (i)); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ + *key_len = (I40E_PFQF_HKEY_MAX_INDEX +1 ) *sizeof (uint32_t );return 0 ;
@@ -9610,8 +9633,17 @@ static int i40e_get_regs(struct rte_eth_dev *dev,const struct i40e_reg_info *reg_info;if (ptr_data ==NULL ) { - regs->length =I40E_GLGEN_STAT_CLEAR +4 ; - regs->width =sizeof (uint32_t ); +#ifdef X722_SUPPORT +if (hw->mac.type ==I40E_MAC_X722 ) { + regs->length =I40E_GLGEN_STAT_CLEAR +4 ; +#else + regs->length =I40E_GLVEBVL_BPCH ( +I40E_GLVEBVL_BPCH_MAX_INDEX ) +0x8 ; +#endif /* X722_SUPPORT */ + regs->width =sizeof (uint32_t ); +#ifdef X722_SUPPORT + } +#endif /* X722_SUPPORT */ return 0 ; }
drivers/net/i40e/i40e_ethdev.h +17 -0
@@ -125,7 +125,10 @@ enum i40e_flxpld_layer_idx {#define I40E_FLAG_HEADER_SPLIT_ENABLED (1ULL << 5)#define I40E_FLAG_FDIR (1ULL << 6)#define I40E_FLAG_VXLAN (1ULL << 7) +#ifdef X722_SUPPORT #define I40E_FLAG_RSS_AQ_CAPABLE (1ULL << 8) +#endif /* X722_SUPPORT */ +#ifdef X722_SUPPORT #define I40E_FLAG_ALL (I40E_FLAG_RSS | \ I40E_FLAG_DCB | \ I40E_FLAG_VMDQ | \
@@ -135,6 +138,16 @@ enum i40e_flxpld_layer_idx { I40E_FLAG_FDIR | \ I40E_FLAG_VXLAN | \ I40E_FLAG_RSS_AQ_CAPABLE) +#else +#define I40E_FLAG_ALL (I40E_FLAG_RSS | \ + I40E_FLAG_DCB | \ + I40E_FLAG_VMDQ | \ + I40E_FLAG_SRIOV | \ + I40E_FLAG_HEADER_SPLIT_DISABLED | \ + I40E_FLAG_HEADER_SPLIT_ENABLED | \ + I40E_FLAG_FDIR | \ + I40E_FLAG_VXLAN) +#endif /* X722_SUPPORT */ #define I40E_RSS_OFFLOAD_ALL ( \ ETH_RSS_FRAG_IPV4 | \
@@ -650,7 +663,11 @@ i40e_get_vsi_from_adapter(struct i40e_adapter *adapter)return NULL ; hw =I40E_DEV_PRIVATE_TO_HW (adapter); +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_VF || hw->mac.type ==I40E_MAC_X722_VF ) { +#else +if (hw->mac.type ==I40E_MAC_VF ) { +#endif /* X722_SUPPORT */ struct i40e_vf *vf =I40EVF_DEV_PRIVATE_TO_VF (adapter);return &vf->vsi; }else {
drivers/net/i40e/i40e_ethdev_vf.c +27 -0
@@ -1112,9 +1112,17 @@ i40evf_get_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link)static const struct rte_pci_id pci_id_i40evf_map[] = { {RTE_PCI_DEVICE (I40E_INTEL_VENDOR_ID ,I40E_DEV_ID_VF ) }, {RTE_PCI_DEVICE (I40E_INTEL_VENDOR_ID ,I40E_DEV_ID_VF_HV ) }, +#ifdef X722_SUPPORT +#ifdef X722_A0_SUPPORT +#if defined(INTEGRATED_VF) || defined(VF_DRIVER) {RTE_PCI_DEVICE (I40E_INTEL_VENDOR_ID ,I40E_DEV_ID_X722_A0_VF ) }, +#endif /* INTEGRATED_VF || VF_DRIVER */ +#endif /* X722_A0_SUPPORT */ +#if defined(INTEGRATED_VF) || defined(VF_DRIVER) || defined(I40E_NDIS_SUPPORT) {RTE_PCI_DEVICE (I40E_INTEL_VENDOR_ID ,I40E_DEV_ID_X722_VF ) }, {RTE_PCI_DEVICE (I40E_INTEL_VENDOR_ID ,I40E_DEV_ID_X722_VF_HV ) }, +#endif /* INTEGRATED_VF || VF_DRIVER || I40E_NDIS_SUPPORT */ +#endif /* X722_SUPPORT */ { .vendor_id =0 ,/* sentinel */ }, };
@@ -1277,8 +1285,10 @@ i40evf_init_vf(struct rte_eth_dev *dev) goto err_alloc; } +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_X722_VF ) vf->flags =I40E_FLAG_RSS_AQ_CAPABLE ; +#endif /* X722_SUPPORT */ vf->vsi.vsi_id = vf->vsi_res->vsi_id; vf->vsi.type = vf->vsi_res->vsi_type; vf->vsi.nb_qps = vf->vsi_res->num_queue_pairs;
@@ -2340,6 +2350,7 @@ i40evf_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size)if (!lut)return -EINVAL ; +#ifdef X722_SUPPORT if (vf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_get_rss_lut (hw, vsi->vsi_id, FALSE, lut, lut_size);
@@ -2348,12 +2359,15 @@ i40evf_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *lut_dw = (uint32_t *)lut;uint16_t i, lut_size_dw = lut_size /4 ;for (i =0 ; i < lut_size_dw; i++) lut_dw[i] =I40E_READ_REG (hw,I40E_VFQF_HLUT (i)); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return 0 ; }
@@ -2371,6 +2385,7 @@ i40evf_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) vf =I40E_VSI_TO_VF (vsi); hw =I40E_VSI_TO_HW (vsi); +#ifdef X722_SUPPORT if (vf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_set_rss_lut (hw, vsi->vsi_id, FALSE, lut, lut_size);
@@ -2379,13 +2394,16 @@ i40evf_set_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *lut_dw = (uint32_t *)lut;uint16_t i, lut_size_dw = lut_size /4 ;for (i =0 ; i < lut_size_dw; i++)I40E_WRITE_REG (hw,I40E_VFQF_HLUT (i), lut_dw[i]);I40EVF_WRITE_FLUSH (hw); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return 0 ; }
@@ -2484,6 +2502,7 @@ i40evf_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len)return -EINVAL ; } +#ifdef X722_SUPPORT if (vf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) {struct i40e_aqc_get_set_rss_key_data *key_dw = (struct i40e_aqc_get_set_rss_key_data *)key;
@@ -2493,13 +2512,16 @@ i40evf_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len)PMD_INIT_LOG (ERR ,"Failed to configure RSS key " "via AQ"); }else { +#endif /* X722_SUPPORT */ uint32_t *hash_key = (uint32_t *)key;uint16_t i;for (i =0 ; i <=I40E_VFQF_HKEY_MAX_INDEX ; i++)i40e_write_rx_ctl (hw,I40E_VFQF_HKEY (i), hash_key[i]);I40EVF_WRITE_FLUSH (hw); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ return ret; }
@@ -2514,6 +2536,7 @@ i40evf_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)if (!key || !key_len)return -EINVAL ; +#ifdef X722_SUPPORT if (vf->flags &I40E_FLAG_RSS_AQ_CAPABLE ) { ret =i40e_aq_get_rss_key (hw, vsi->vsi_id, (struct i40e_aqc_get_set_rss_key_data *)key);
@@ -2522,12 +2545,16 @@ i40evf_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len) return ret; } }else { +#endif /* X722_SUPPORT */ uint32_t *key_dw = (uint32_t *)key;uint16_t i;for (i =0 ; i <=I40E_VFQF_HKEY_MAX_INDEX ; i++) key_dw[i] =i40e_read_rx_ctl (hw,I40E_VFQF_HKEY (i)); +#ifdef X722_SUPPORT } +#endif /* X722_SUPPORT */ + *key_len = (I40E_VFQF_HKEY_MAX_INDEX +1 ) *sizeof (uint32_t );return 0 ;
drivers/net/i40e/i40e_regs.h +96 -0
361 lines not on this page · raw message
drivers/net/i40e/i40e_rxtx.c +17 -1
@@ -2199,7 +2199,11 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,uint16_t base, bsf, tc_mapping;int use_def_burst_func =1 ; +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_VF || hw->mac.type ==I40E_MAC_X722_VF ) { +#else +if (hw->mac.type ==I40E_MAC_VF ) { +#endif /* X722_SUPPORT */ struct i40e_vf *vf =I40EVF_DEV_PRIVATE_TO_VF (dev->data->dev_private); vsi = &vf->vsi;
@@ -2239,7 +2243,12 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, rxq->nb_rx_desc = nb_desc; rxq->rx_free_thresh = rx_conf->rx_free_thresh; rxq->queue_id = queue_idx; + +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_VF || hw->mac.type ==I40E_MAC_X722_VF ) +#else +if (hw->mac.type ==I40E_MAC_VF ) +#endif /* X722_SUPPORT */ rxq->reg_idx = queue_idx;else /* PF device */ rxq->reg_idx = vsi->base_queue +
@@ -2416,7 +2425,11 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,uint16_t tx_rs_thresh, tx_free_thresh;uint16_t i, base, bsf, tc_mapping; +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_VF || hw->mac.type ==I40E_MAC_X722_VF ) { +#else +if (hw->mac.type ==I40E_MAC_VF ) { +#endif /* X722_SUPPORT */ struct i40e_vf *vf =I40EVF_DEV_PRIVATE_TO_VF (dev->data->dev_private); vsi = &vf->vsi;
@@ -2544,12 +2557,15 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->hthresh = tx_conf->tx_thresh.hthresh; txq->wthresh = tx_conf->tx_thresh.wthresh; txq->queue_id = queue_idx; +#ifdef X722_SUPPORT if (hw->mac.type ==I40E_MAC_VF || hw->mac.type ==I40E_MAC_X722_VF ) +#else +if (hw->mac.type ==I40E_MAC_VF ) +#endif /* X722_SUPPORT */ txq->reg_idx = queue_idx;else /* PF device */ txq->reg_idx = vsi->base_queue +i40e_get_queue_offset_by_qindex (pf, queue_idx); - txq->port_id = dev->data->port_id; txq->txq_flags = tx_conf->txq_flags; txq->vsi = vsi;
Signature · 1 line
1.9.3
PATCH v2 2/2 drivers/i40e: fix the hash filter invalid calculation in X722
As X722 extracts IPv4 header to Field Vector different with XL710/X710, need to corresponding to modify the fields of IPv4 header in input set to map different default Field Vector Table of different NICs.
Signed-off-by Jeff Guo <[email protected]>
---
v2:
fix compile error when x722 macro is not defined and simplify the code to avoid duplication.
--- drivers/net/i40e/i40e_ethdev.c | 73 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 13 deletions(-)
drivers/net/i40e/i40e_ethdev.c +60 -13
@@ -211,6 +211,16 @@#define I40E_REG_INSET_L3_SRC_IP4 0x0001800000000000ULL/* Destination IPv4 address */ #define I40E_REG_INSET_L3_DST_IP4 0x0000001800000000ULL +#ifdef X722_SUPPORT +/* Source IPv4 address for X722 */ +#define I40E_X722_REG_INSET_L3_SRC_IP4 0x0006000000000000ULL +/* Destination IPv4 address for X722 */ +#define I40E_X722_REG_INSET_L3_DST_IP4 0x0000060000000000ULL +/* IPv4 Protocol */ +#define I40E_X722_REG_INSET_L3_IP4_PROTO 0x0010000000000000ULL +/* IPv4 Time to Live */ +#define I40E_X722_REG_INSET_L3_IP4_TTL 0x0010000000000000ULL +#endif /* IPv4 Type of Service (TOS) */ #define I40E_REG_INSET_L3_IP4_TOS 0x0040000000000000ULL/* IPv4 Protocol */
@@ -7581,7 +7591,7 @@ i40e_parse_input_set(uint64_t *inset,* and vice versa */ static uint64_t -i40e_translate_input_set_reg (uint64_t input) +i40e_translate_input_set_reg (enum i40e_mac_type type,uint64_t input) {uint64_t val =0 ;uint16_t i;
@@ -7589,17 +7599,13 @@ i40e_translate_input_set_reg(uint64_t input)static const struct {uint64_t inset;uint64_t inset_reg; - } inset_map[] = { + } inset_map_common[] = { {I40E_INSET_DMAC ,I40E_REG_INSET_L2_DMAC }, {I40E_INSET_SMAC ,I40E_REG_INSET_L2_SMAC }, {I40E_INSET_VLAN_OUTER ,I40E_REG_INSET_L2_OUTER_VLAN }, {I40E_INSET_VLAN_INNER ,I40E_REG_INSET_L2_INNER_VLAN }, {I40E_INSET_LAST_ETHER_TYPE ,I40E_REG_INSET_LAST_ETHER_TYPE }, - {I40E_INSET_IPV4_SRC ,I40E_REG_INSET_L3_SRC_IP4 }, - {I40E_INSET_IPV4_DST ,I40E_REG_INSET_L3_DST_IP4 }, {I40E_INSET_IPV4_TOS ,I40E_REG_INSET_L3_IP4_TOS }, - {I40E_INSET_IPV4_PROTO ,I40E_REG_INSET_L3_IP4_PROTO }, - {I40E_INSET_IPV4_TTL ,I40E_REG_INSET_L3_IP4_TTL }, {I40E_INSET_IPV6_SRC ,I40E_REG_INSET_L3_SRC_IP6 }, {I40E_INSET_IPV6_DST ,I40E_REG_INSET_L3_DST_IP6 }, {I40E_INSET_IPV6_TC ,I40E_REG_INSET_L3_IP6_TC },
@@ -7627,16 +7633,56 @@ i40e_translate_input_set_reg(uint64_t input) {I40E_INSET_FLEX_PAYLOAD_W7, I40E_REG_INSET_FLEX_PAYLOAD_WORD7}, {I40E_INSET_FLEX_PAYLOAD_W8, I40E_REG_INSET_FLEX_PAYLOAD_WORD8}, }; +#ifdef X722_SUPPORT + +/* some different registers map in x722*/ +static const struct { +uint64_t inset; +uint64_t inset_reg; + } inset_map_diff_x722[] = { + {I40E_INSET_IPV4_SRC ,I40E_X722_REG_INSET_L3_SRC_IP4 }, + {I40E_INSET_IPV4_DST ,I40E_X722_REG_INSET_L3_DST_IP4 }, + {I40E_INSET_IPV4_PROTO ,I40E_X722_REG_INSET_L3_IP4_PROTO }, + {I40E_INSET_IPV4_TTL ,I40E_X722_REG_INSET_L3_IP4_TTL }, + }; +#endif + +static const struct { +uint64_t inset; +uint64_t inset_reg; + } inset_map_diff_not_x722[] = { + {I40E_INSET_IPV4_SRC ,I40E_REG_INSET_L3_SRC_IP4 }, + {I40E_INSET_IPV4_DST ,I40E_REG_INSET_L3_DST_IP4 }, + {I40E_INSET_IPV4_PROTO ,I40E_REG_INSET_L3_IP4_PROTO }, + {I40E_INSET_IPV4_TTL ,I40E_REG_INSET_L3_IP4_TTL }, + };if (input ==0 )return val;/* Translate input set to register aware inset */ -for (i =0 ; i <RTE_DIM (inset_map); i++) { -if (input & inset_map[i].inset) - val |= inset_map[i].inset_reg; +#ifdef X722_SUPPORT +if (type ==I40E_MAC_X722 ) { +for (i =0 ; i <RTE_DIM (inset_map_diff_x722); i++) { +if (input & inset_map_diff_x722[i].inset) + val |= inset_map_diff_x722[i].inset_reg; + } + }else { +for (i =0 ; i <RTE_DIM (inset_map_diff_not_x722); i++) { +if (input & inset_map_diff_not_x722[i].inset) + val |= inset_map_diff_not_x722[i].inset_reg; + } + } +#else +for (i =0 ; i <RTE_DIM (inset_map_diff_not_x722); i++) { +if (input & inset_map_diff_not_x722[i].inset) + val |= inset_map_diff_not_x722[i].inset_reg; + } +#endif +for (i =0 ; i <RTE_DIM (inset_map_common); i++) { +if (input & inset_map_common[i].inset) + val |= inset_map_common[i].inset_reg; } -return val; }
@@ -7719,7 +7765,8 @@ i40e_filter_input_set_init(struct i40e_pf *pf) I40E_INSET_MASK_NUM_REG);if (num <0 )return ; - inset_reg =i40e_translate_input_set_reg (input_set); + inset_reg =i40e_translate_input_set_reg (hw->mac.type, + input_set);i40e_check_write_reg (hw,I40E_PRTQF_FD_INSET (pctype,0 ), (uint32_t )(inset_reg &UINT32_MAX ));
@@ -7810,7 +7857,7 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw,if (num <0 )return -EINVAL ; - inset_reg |=i40e_translate_input_set_reg (input_set); + inset_reg |=i40e_translate_input_set_reg (hw->mac.type, input_set);i40e_check_write_reg (hw,I40E_GLQF_HASH_INSET (0 , pctype), (uint32_t )(inset_reg &UINT32_MAX ));
@@ -7888,7 +7935,7 @@ i40e_fdir_filter_inset_select(struct i40e_pf *pf,if (num <0 )return -EINVAL ; - inset_reg |=i40e_translate_input_set_reg (input_set); + inset_reg |=i40e_translate_input_set_reg (hw->mac.type, input_set);i40e_check_write_reg (hw,I40E_PRTQF_FD_INSET (pctype,0 ), (uint32_t )(inset_reg &UINT32_MAX ));
Signature · 1 line
1.9.3