From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12201A04DE; Fri, 23 Oct 2020 08:42:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3828B6CCB; Fri, 23 Oct 2020 08:42:54 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 2E7506C98 for ; Fri, 23 Oct 2020 08:42:51 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.64]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 9671060065; Fri, 23 Oct 2020 06:42:49 +0000 (UTC) Received: from us4-mdac16-3.ut7.mdlocal (unknown [10.7.65.71]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 951612009B; Fri, 23 Oct 2020 06:42:49 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.31]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id E9CF122004F; Fri, 23 Oct 2020 06:42:48 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 3E98E940058; Fri, 23 Oct 2020 06:42:47 +0000 (UTC) Received: from [192.168.38.17] (10.17.10.39) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 23 Oct 2020 07:42:36 +0100 To: "Hyong Youb Kim (hyonkim)" , Wenzhuo Lu , Beilei Xing , "Bernard Iremonger" , Jeff Guo , "Ray Kinsella" , Neil Horman , Ajit Khaparde , Somnath Kotur , "John Daley (johndale)" , Haiyue Wang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , "Rasesh Mody" , Shahed Shaikh , "Thomas Monjalon" , Ferruh Yigit CC: "dev@dpdk.org" References: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com> <1603359758-13297-1-git-send-email-arybchenko@solarflare.com> <1603359758-13297-13-git-send-email-arybchenko@solarflare.com> From: Andrew Rybchenko Message-ID: Date: Fri, 23 Oct 2020 09:41:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.17.10.39] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25742.003 X-TM-AS-Result: No-11.790800-8.000000-10 X-TMASE-MatchedRID: oCj5caaCQynmLzc6AOD8DfHkpkyUphL9Ud7Bjfo+5jTVEYfep7SzpuKY 9D+ixKR4FZ1No86GcdSNqAGs7TOyCfxcXzlUQt0olVHM/F6YkvTpCJPdKwF/IVSOymiJfTYX/zS kYr7c6qCDOEHVM/tRlYmlzyMidQUr6mY+a8qhRJG8coKUcaOOvT17tS9vI0pxzP9LEqj2YnjPQk XuCrkdG4i7oCZO6EN3mLEC5fZiOdCioKUtUDGXZT8Ckw9b/GFe30ZykK+rMdoYMX/fk94vW+/yR kWfD4AnEpGBR+N0aLU/R3Sjv4UxLoir9MqcjAA9GjzBgnFZvQ6L/MoUdwG/+2h76/bDpGEr4qAB sUMuHjXFCqsXqdQRDf9sMyEyAbsDjaxZjYCZ9l3fhvTQ/n1nGQKflB9+9kWVirdgQROurNzO2b8 zqqoEt54DzBXlAELRxz2hvVqyDtNvAVPVxkfEITO9YdEjFZfCB4Id7CiQcz9iHNdoG1wDnNnoqu RwHY3BjRnLtFs7LneGj0VkVb9wHbtj+yZ6+At6cX6ZXfLrMpSTPLLOYCF5b0wRVBfzAxSINtxWZ jYmQXu3LFeYuHiMOblsSQ5j7J1hIdsopcBWWrrUOA5yLuHdhQ73P4/aDCIFdz3bnI4leYWwWbM0 s9anouRdnEX1rI/VkZOl7WKIImrvXOvQVlExsFZ0V5tYhzdWxEHRux+uk8h+ICquNi0WJDfjxcx ABGEi+oXbJtlq911snOXQI4eYZI0bglOyH+kkftwZ3X11IV0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.790800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25742.003 X-MDID: 1603435369-xxcRlkL63Xm2 X-PPE-DISP: 1603435369;xxcRlkL63Xm2 Subject: Re: [dpdk-dev] [PATCH v2 12/14] ethdev: remove legacy FDIR filter type support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/23/20 6:32 AM, Hyong Youb Kim (hyonkim) wrote: >> -----Original Message----- >> From: Andrew Rybchenko >> Sent: Thursday, October 22, 2020 6:43 PM >> To: Wenzhuo Lu ; Beilei Xing >> ; Bernard Iremonger >> ; Jeff Guo ; Ray Kinsella >> ; Neil Horman ; Ajit Khaparde >> ; Somnath Kotur >> ; John Daley (johndale) >> ; Hyong Youb Kim (hyonkim) ; >> Haiyue Wang ; Matan Azrad ; >> Shahaf Shuler ; Viacheslav Ovsiienko >> ; Rasesh Mody ; Shahed >> Shaikh ; Andrew Rybchenko >> ; Thomas Monjalon >> ; Ferruh Yigit >> Cc: dev@dpdk.org >> Subject: [PATCH v2 12/14] ethdev: remove legacy FDIR filter type support >> >> Instead of FDIR filters RTE flow API should be used. >> >> Signed-off-by: Andrew Rybchenko >> Acked-by: Ajit Khaparde >> Acked-by: Haiyue Wang >> --- >> - cleanup testpmd user guide >> - partially cleanup net/i40e documentation, please, review and >> suggest how to fix remaining flow_director_filter command > [...] >> drivers/net/enic/enic.h | 7 - >> drivers/net/enic/enic_clsf.c | 168 ---- >> drivers/net/enic/enic_ethdev.c | 48 -- > [...] >> diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h >> index 5f0ae395da..079f194275 100644 >> --- a/drivers/net/enic/enic.h >> +++ b/drivers/net/enic/enic.h >> @@ -394,12 +394,6 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx) >> } >> >> int dev_is_enic(struct rte_eth_dev *dev); >> -void enic_fdir_stats_get(struct enic *enic, >> - struct rte_eth_fdir_stats *stats); >> -int enic_fdir_add_fltr(struct enic *enic, >> - struct rte_eth_fdir_filter *params); >> -int enic_fdir_del_fltr(struct enic *enic, >> - struct rte_eth_fdir_filter *params); >> void enic_free_wq(void *txq); >> int enic_alloc_intr_resources(struct enic *enic); >> int enic_setup_finish(struct enic *enic); >> @@ -464,7 +458,6 @@ bool enic_use_vector_rx_handler(struct rte_eth_dev >> *eth_dev); >> void enic_pick_rx_handler(struct rte_eth_dev *eth_dev); >> void enic_pick_tx_handler(struct rte_eth_dev *eth_dev); >> void enic_fdir_info(struct enic *enic); >> -void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats); >> int enic_vf_representor_init(struct rte_eth_dev *eth_dev, void >> *init_params); >> int enic_vf_representor_uninit(struct rte_eth_dev *ethdev); >> int enic_fm_allocate_switch_domain(struct enic *pf); >> diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c >> index e206123ba5..1c837a4d09 100644 >> --- a/drivers/net/enic/enic_clsf.c >> +++ b/drivers/net/enic/enic_clsf.c >> @@ -42,17 +42,6 @@ static void copy_fltr_v2(struct filter_v2 *fltr, >> const struct rte_eth_fdir_input *input, >> const struct rte_eth_fdir_masks *masks); >> >> -void enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *stats) >> -{ >> - *stats = enic->fdir.stats; >> -} >> - >> -void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *info) >> -{ >> - info->mode = (enum rte_fdir_mode)enic->fdir.modes; >> - info->flow_types_mask[0] = enic->fdir.types_mask; >> -} >> - >> void enic_fdir_info(struct enic *enic) >> { >> enic->fdir.modes = (uint32_t)RTE_FDIR_MODE_PERFECT; >> @@ -305,163 +294,6 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct >> rte_eth_fdir_input *input, >> } >> } >> >> -int enic_fdir_del_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) >> -{ >> - int32_t pos; >> - struct enic_fdir_node *key; >> - /* See if the key is in the table */ >> - pos = rte_hash_del_key(enic->fdir.hash, params); >> - switch (pos) { >> - case -EINVAL: >> - case -ENOENT: >> - enic->fdir.stats.f_remove++; >> - return -EINVAL; >> - default: >> - /* The entry is present in the table */ >> - key = enic->fdir.nodes[pos]; >> - >> - /* Delete the filter */ >> - vnic_dev_classifier(enic->vdev, CLSF_DEL, >> - &key->fltr_id, NULL, NULL); >> - rte_free(key); >> - enic->fdir.nodes[pos] = NULL; >> - enic->fdir.stats.free++; >> - enic->fdir.stats.remove++; >> - break; >> - } >> - return 0; >> -} >> - >> -int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) >> -{ >> - struct enic_fdir_node *key; >> - struct filter_v2 fltr; >> - int32_t pos; >> - uint8_t do_free = 0; >> - uint16_t old_fltr_id = 0; >> - uint32_t flowtype_supported; >> - uint16_t flex_bytes; >> - uint16_t queue; >> - struct filter_action_v2 action; >> - >> - memset(&fltr, 0, sizeof(fltr)); >> - memset(&action, 0, sizeof(action)); >> - flowtype_supported = enic->fdir.types_mask >> - & (1 << params->input.flow_type); >> - >> - flex_bytes = ((params->input.flow_ext.flexbytes[1] << 8 & 0xFF00) | >> - (params->input.flow_ext.flexbytes[0] & 0xFF)); >> - >> - if (!enic->fdir.hash || >> - (params->input.flow_ext.vlan_tci & 0xFFF) || >> - !flowtype_supported || flex_bytes || >> - params->action.behavior /* drop */) { >> - enic->fdir.stats.f_add++; >> - return -ENOTSUP; >> - } >> - >> - /* Get the enicpmd RQ from the DPDK Rx queue */ >> - queue = enic_rte_rq_idx_to_sop_idx(params->action.rx_queue); >> - >> - if (!enic->rq[queue].in_use) >> - return -EINVAL; >> - >> - /* See if the key is already there in the table */ >> - pos = rte_hash_del_key(enic->fdir.hash, params); >> - switch (pos) { >> - case -EINVAL: >> - enic->fdir.stats.f_add++; >> - return -EINVAL; >> - case -ENOENT: >> - /* Add a new classifier entry */ >> - if (!enic->fdir.stats.free) { >> - enic->fdir.stats.f_add++; >> - return -ENOSPC; >> - } >> - key = rte_zmalloc("enic_fdir_node", >> - sizeof(struct enic_fdir_node), 0); >> - if (!key) { >> - enic->fdir.stats.f_add++; >> - return -ENOMEM; >> - } >> - break; >> - default: >> - /* The entry is already present in the table. >> - * Check if there is a change in queue >> - */ >> - key = enic->fdir.nodes[pos]; >> - enic->fdir.nodes[pos] = NULL; >> - if (unlikely(key->rq_index == queue)) { >> - /* Nothing to be done */ >> - enic->fdir.stats.f_add++; >> - pos = rte_hash_add_key(enic->fdir.hash, params); >> - if (pos < 0) { >> - dev_err(enic, "Add hash key failed\n"); >> - return pos; >> - } >> - enic->fdir.nodes[pos] = key; >> - dev_warning(enic, >> - "FDIR rule is already present\n"); >> - return 0; >> - } >> - >> - if (likely(enic->fdir.stats.free)) { >> - /* Add the filter and then delete the old one. >> - * This is to avoid packets from going into the >> - * default queue during the window between >> - * delete and add >> - */ >> - do_free = 1; >> - old_fltr_id = key->fltr_id; >> - } else { >> - /* No free slots in the classifier. >> - * Delete the filter and add the modified one later >> - */ >> - vnic_dev_classifier(enic->vdev, CLSF_DEL, >> - &key->fltr_id, NULL, NULL); >> - enic->fdir.stats.free++; >> - } >> - >> - break; >> - } >> - >> - key->filter = *params; >> - key->rq_index = queue; >> - >> - enic->fdir.copy_fltr_fn(&fltr, ¶ms->input, >> - &enic->rte_dev->data- >>> dev_conf.fdir_conf.mask); >> - action.type = FILTER_ACTION_RQ_STEERING; >> - action.rq_idx = queue; >> - >> - if (!vnic_dev_classifier(enic->vdev, CLSF_ADD, &queue, &fltr, >> - &action)) { >> - key->fltr_id = queue; >> - } else { >> - dev_err(enic, "Add classifier entry failed\n"); >> - enic->fdir.stats.f_add++; >> - rte_free(key); >> - return -1; >> - } >> - >> - if (do_free) >> - vnic_dev_classifier(enic->vdev, CLSF_DEL, &old_fltr_id, NULL, >> - NULL); >> - else{ >> - enic->fdir.stats.free--; >> - enic->fdir.stats.add++; >> - } >> - >> - pos = rte_hash_add_key(enic->fdir.hash, params); >> - if (pos < 0) { >> - enic->fdir.stats.f_add++; >> - dev_err(enic, "Add hash key failed\n"); >> - return pos; >> - } >> - >> - enic->fdir.nodes[pos] = key; >> - return 0; >> -} >> - >> void enic_clsf_destroy(struct enic *enic) >> { >> uint32_t index; > Hi, > > For enic: > > Acked-by: Hyong Youb Kim > > Looks like you mechanically removed the things that caused compilation > errors. That is fine. Once this patch series lands, I will post a > follow-up cleanup patch for enic: remove the entire enic_clsf.c and > remaining traces of fdir in enic.h. I've tried to trace back and in some cases remove variables and structure fields used for FDIR only, but it was not always easy and I've not dig too deep. That's true. It is much easier for driver maintainers. Thanks.