From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0b-0016ce01.pphosted.com [67.231.156.153]) by dpdk.org (Postfix) with ESMTP id CFA605A35 for ; Sat, 7 May 2016 06:31:08 +0200 (CEST) Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u474U8Cs030194 for ; Fri, 6 May 2016 21:31:08 -0700 Received: from avcashub1.qlogic.com ([198.186.0.116]) by mx0b-0016ce01.pphosted.com with ESMTP id 22s225rjb1-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 06 May 2016 21:31:08 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.191) with Microsoft SMTP Server id 14.3.235.1; Fri, 6 May 2016 21:31:07 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id u474V7jf022600; Fri, 6 May 2016 21:31:07 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: CC: , Sony Chacko Date: Fri, 6 May 2016 21:30:20 -0700 Message-ID: <1462595421-22505-9-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1462595421-22505-1-git-send-email-rasesh.mody@qlogic.com> References: <1462595421-22505-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8157 signatures=670715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1605070067 Subject: [dpdk-dev] [PATCH 8/9] qede: enable vf-vf traffic with unmatched dest addr X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 04:31:09 -0000 From: Sony Chacko This patch enables VF to VF traffic with unmatched destination address. Signed-off-by: Sony Chacko --- drivers/net/qede/base/ecore_l2.c | 19 +++++++++++----- drivers/net/qede/qede_eth_if.c | 45 +++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index 8a1a26a..9e6ef5a 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -227,11 +227,11 @@ ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn, * SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_DROP_ALL, * !!(accept_filter & ECORE_ACCEPT_NONE)); */ -/* - * SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL, - * (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && - * !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); - */ + + SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL, + (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && + !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); + SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_DROP_ALL, !(!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) || !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); @@ -275,6 +275,15 @@ ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn, SET_FIELD(*state, ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL, !!(accept_filter & ECORE_ACCEPT_BCAST)); + /* @DPDK */ + /* ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL and + * ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL + * needs to be set for VF-VF communication to work + * when dest macaddr is unknown. + */ + SET_FIELD(*state, ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL, + (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && + !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); DP_VERBOSE(p_hwfn, ECORE_MSG_SP, "p_ramrod->tx_mode.state = 0x%x\n", diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index fd07d8b..b6f6487 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -377,33 +377,38 @@ qed_configure_filter_mcast(struct ecore_dev *edev, return ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL); } -int -qed_configure_filter_rx_mode(struct ecore_dev *edev, - enum qed_filter_rx_mode_type type) +int qed_configure_filter_rx_mode(struct ecore_dev *edev, + enum qed_filter_rx_mode_type type) { - struct ecore_filter_accept_flags accept_flags; + struct ecore_filter_accept_flags flags; - memset(&accept_flags, 0, sizeof(accept_flags)); + memset(&flags, 0, sizeof(flags)); - accept_flags.update_rx_mode_config = 1; - accept_flags.update_tx_mode_config = 1; - accept_flags.rx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | - ECORE_ACCEPT_MCAST_MATCHED | - ECORE_ACCEPT_BCAST; - accept_flags.tx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | + flags.update_rx_mode_config = 1; + flags.update_tx_mode_config = 1; + flags.rx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | ECORE_ACCEPT_MCAST_MATCHED | ECORE_ACCEPT_BCAST; - if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; - else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED; - else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC | - QED_FILTER_RX_MODE_TYPE_PROMISC)) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED | - ECORE_ACCEPT_MCAST_UNMATCHED; + flags.tx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | + ECORE_ACCEPT_MCAST_MATCHED | + ECORE_ACCEPT_BCAST; + + if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) { + flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; + if (IS_VF(edev)) { + flags.tx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; + DP_INFO(edev, "Enabling Tx unmatched flag for VF\n"); + } + } else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) { + flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED; + } else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC | + QED_FILTER_RX_MODE_TYPE_PROMISC)) { + flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED | + ECORE_ACCEPT_MCAST_UNMATCHED; + } - return ecore_filter_accept_cmd(edev, 0, accept_flags, false, false, + return ecore_filter_accept_cmd(edev, 0, flags, false, false, ECORE_SPQ_MODE_CB, NULL); } -- 1.7.10.3