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 32C763979 for ; Tue, 10 Nov 2015 00:56:55 +0100 (CET) Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tA9Nupgl002463; Mon, 9 Nov 2015 15:56:52 -0800 Received: from avcashub1.qlogic.com (avcashub3.qlogic.com [198.70.193.117]) by mx0b-0016ce01.pphosted.com with ESMTP id 1y1h5uk043-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Nov 2015 15:56:52 -0800 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.192) with Microsoft SMTP Server id 14.3.235.1; Mon, 9 Nov 2015 15:56:49 -0800 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id tA9NuoiQ019419; Mon, 9 Nov 2015 15:56:50 -0800 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: Date: Mon, 9 Nov 2015 15:56:16 -0800 Message-ID: <1447113386-19346-2-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1447113386-19346-1-git-send-email-rasesh.mody@qlogic.com> References: <1447113386-19346-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7980 signatures=670655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1511090403 Cc: dev@dpdk.org, sony.chacko@qlogic.com Subject: [dpdk-dev] [PATCH v2 01/11] bnx2x: Update VF to support newer PF drivers 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: Mon, 09 Nov 2015 23:56:55 -0000 From: Harish Patil SR-IOV is supported using bnx2x poll mode driver running as VF driver and native linux driver running as PF (in host/hypervisor). There is no issue while running with the PF driver which is at the base version as that of PMD. However, there is a compatibility issue between newer out-of-box PF drivers with older VF driver. So the newer VFs would also need to send BNX2X_VF_TLV_PHYS_PORT_ID (among other TLVs) to differentiate between newer and older VFs. Signed-off-by: Harish Patil --- drivers/net/bnx2x/bnx2x_vfpf.c | 11 +++++++++-- drivers/net/bnx2x/bnx2x_vfpf.h | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c index 661f0a5..39fd59a 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/bnx2x/bnx2x_vfpf.c @@ -257,8 +257,15 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_ acq->bulletin_addr = sc->pf2vf_bulletin_mapping.paddr; - BNX2X_TLV_APPEND(acq, acq->first_tlv.length, BNX2X_VF_TLV_LIST_END, - sizeof(struct channel_list_end_tlv)); + /* Request physical port identifier */ + BNX2X_TLV_APPEND(acq, acq->first_tlv.length, + BNX2X_VF_TLV_PHYS_PORT_ID, + sizeof(struct channel_tlv)); + + BNX2X_TLV_APPEND(acq, + (acq->first_tlv.length + sizeof(struct channel_tlv)), + BNX2X_VF_TLV_LIST_END, + sizeof(struct channel_list_end_tlv)); /* requesting the resources in loop */ obtain_status = bnx2x_loop_obtain_resources(sc); diff --git a/drivers/net/bnx2x/bnx2x_vfpf.h b/drivers/net/bnx2x/bnx2x_vfpf.h index 94ce9f0..4f25321 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.h +++ b/drivers/net/bnx2x/bnx2x_vfpf.h @@ -34,12 +34,24 @@ struct vf_resource_query { #define BNX2X_VF_Q_FLAG_DHC 0x0200 #define BNX2X_VF_Q_FLAG_LEADING_RSS 0x0400 +#define TLV_BUFFER_SIZE 1024 + +/* general tlv header (used for both vf->pf request and pf->vf response) */ +struct channel_tlv { + uint16_t type; + uint16_t length; +}; + struct vf_first_tlv { uint16_t type; uint16_t length; uint32_t reply_offset; }; +struct tlv_buffer_size { + uint8_t tlv_buffer[TLV_BUFFER_SIZE]; +}; + /* tlv struct for all PF replies except acquire */ struct vf_common_reply_tlv { uint16_t type; @@ -244,12 +256,14 @@ union query_tlvs { struct vf_release_tlv release; struct vf_rss_tlv update_rss; struct channel_list_end_tlv list_end; + struct tlv_buffer_size tlv_buf_size; }; union resp_tlvs { struct vf_common_reply_tlv common_reply; struct vf_acquire_resp_tlv acquire_resp; struct channel_list_end_tlv list_end; + struct tlv_buffer_size tlv_buf_size; }; /* struct allocated by VF driver, PF sends updates to VF via bulletin */ @@ -300,6 +314,7 @@ enum channel_tlvs { BNX2X_VF_TLV_PF_SET_MAC, BNX2X_VF_TLV_PF_SET_VLAN, BNX2X_VF_TLV_UPDATE_RSS, + BNX2X_VF_TLV_PHYS_PORT_ID, BNX2X_VF_TLV_MAX }; -- 1.7.10.3