From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id 105AC2B9E for ; Fri, 4 Mar 2016 23:28:59 +0100 (CET) Received: from pps.filterd (m0045602.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u24MS2tA025781; Fri, 4 Mar 2016 14:28:58 -0800 Received: from avcashub1.qlogic.com ([198.186.0.117]) by mx0a-0016ce01.pphosted.com with ESMTP id 21bguj2pc0-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Fri, 04 Mar 2016 14:28:58 -0800 Received: from AVMB3.qlogic.org ([fe80::689d:1159:4632:e0eb]) by avcashub3.qlogic.org ([::1]) with mapi id 14.03.0235.001; Fri, 4 Mar 2016 14:28:57 -0800 From: Rasesh Mody To: Chas Williams <3chas3@gmail.com>, "dev@dpdk.org" , "Bruce Richardson" Thread-Topic: [dpdk-dev] [PATCH 2/2] bnx2x: Determine rx/tx queue sizes sooner Thread-Index: AQHRQ2OI1lY0QiK5vkCnkJuvIRZQV59KQ05Q Date: Fri, 4 Mar 2016 22:28:57 +0000 Message-ID: <2552F74A0BCCBE4DBE2AD218C81B2811086B1539@avmb3.qlogic.org> References: <1451522271-16924-1-git-send-email-3chas3@gmail.com> <1451522271-16924-2-git-send-email-3chas3@gmail.com> In-Reply-To: <1451522271-16924-2-git-send-email-3chas3@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.4.10] disclaimer: bypass Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8094 signatures=670697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1601100000 definitions=main-1603040390 Cc: "Charles \(Chas\) Williams" Subject: Re: [dpdk-dev] [PATCH 2/2] bnx2x: Determine rx/tx queue sizes sooner 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: Fri, 04 Mar 2016 22:29:00 -0000 > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Chas Williams > Sent: Wednesday, December 30, 2015 4:38 PM >=20 > From: "Charles (Chas) Williams" >=20 > The VF needs to determine the queues sizes before .dev_infos_get so that = it > can hint to the upper layer the proper sizes. Move > bnx2x_vf_get_resources() to .eth_dev_init and probe with the guesses from > bnx2x_init_rte(). >=20 > Signed-off-by: Chas Williams <3chas3@gmail.com> > --- Acked-by: Rasesh Mody The change looks good. Thanks! Rasesh > drivers/net/bnx2x/bnx2x.c | 9 ++++++-- > drivers/net/bnx2x/bnx2x_ethdev.c | 46 ++++++++++++++++++++++-------- > ---------- > drivers/net/bnx2x/bnx2x_vfpf.c | 2 ++ > 3 files changed, 34 insertions(+), 23 deletions(-) >=20 > diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index > 67af5da..f003875 100644 > --- a/drivers/net/bnx2x/bnx2x.c > +++ b/drivers/net/bnx2x/bnx2x.c > @@ -9578,8 +9578,13 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc > *sc) >=20 > static void bnx2x_init_rte(struct bnx2x_softc *sc) { > - sc->max_tx_queues =3D 128; > - sc->max_rx_queues =3D 128; > + if (IS_VF(sc)) { > + sc->max_tx_queues =3D BNX2X_VF_MAX_QUEUES_PER_VF; > + sc->max_rx_queues =3D BNX2X_VF_MAX_QUEUES_PER_VF; > + } else { > + sc->max_tx_queues =3D 128; > + sc->max_rx_queues =3D 128; > + } > } >=20 > #define FW_HEADER_LEN 104 > diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c > b/drivers/net/bnx2x/bnx2x_ethdev.c > index 69df02e..fe8cfd0 100644 > --- a/drivers/net/bnx2x/bnx2x_ethdev.c > +++ b/drivers/net/bnx2x/bnx2x_ethdev.c > @@ -87,7 +87,6 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) { > struct bnx2x_softc *sc =3D dev->data->dev_private; > int mp_ncpus =3D sysconf(_SC_NPROCESSORS_CONF); > - int ret; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -121,25 +120,6 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) > return -ENXIO; > } >=20 > - if (IS_VF(sc)) { > - if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_mbx_msg), > - &sc->vf2pf_mbox_mapping, "vf2pf_mbox", > - RTE_CACHE_LINE_SIZE) !=3D 0) > - return -ENOMEM; > - > - sc->vf2pf_mbox =3D (struct bnx2x_vf_mbx_msg *)sc- > >vf2pf_mbox_mapping.vaddr; > - if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_bulletin), > - &sc->pf2vf_bulletin_mapping, "vf2pf_bull", > - RTE_CACHE_LINE_SIZE) !=3D 0) > - return -ENOMEM; > - > - sc->pf2vf_bulletin =3D (struct bnx2x_vf_bulletin *)sc- > >pf2vf_bulletin_mapping.vaddr; > - > - ret =3D bnx2x_vf_get_resources(sc, sc->num_queues, sc- > >num_queues); > - if (ret) > - return ret; > - } > - > return 0; > } >=20 > @@ -466,6 +446,7 @@ bnx2x_common_dev_init(struct rte_eth_dev > *eth_dev, int is_vf) > ret =3D bnx2x_attach(sc); > if (ret) { > PMD_DRV_LOG(ERR, "bnx2x_attach failed (%d)", ret); > + return ret; > } >=20 > eth_dev->data->mac_addrs =3D (struct ether_addr *)sc- > >link_params.mac_addr; @@ -479,7 +460,30 @@ > bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) > PMD_DRV_LOG(INFO, "portID=3D%d vendorID=3D0x%x deviceID=3D0x%x", > eth_dev->data->port_id, pci_dev->id.vendor_id, > pci_dev->id.device_id); >=20 > - return ret; > + if (IS_VF(sc)) { > + if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_mbx_msg), > + &sc->vf2pf_mbox_mapping, > "vf2pf_mbox", > + RTE_CACHE_LINE_SIZE) !=3D 0) > + return -ENOMEM; > + > + sc->vf2pf_mbox =3D (struct bnx2x_vf_mbx_msg *) > + sc->vf2pf_mbox_mapping.vaddr; > + > + if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_bulletin), > + &sc->pf2vf_bulletin_mapping, > "vf2pf_bull", > + RTE_CACHE_LINE_SIZE) !=3D 0) > + return -ENOMEM; > + > + sc->pf2vf_bulletin =3D (struct bnx2x_vf_bulletin *) > + sc->pf2vf_bulletin_mapping.vaddr; > + > + ret =3D bnx2x_vf_get_resources(sc, sc->max_tx_queues, > + sc->max_rx_queues); > + if (ret) > + return ret; > + } > + > + return 0; > } >=20 > static int > diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c > b/drivers/net/bnx2x/bnx2x_vfpf.c index 34b6360..bce734f 100644 > --- a/drivers/net/bnx2x/bnx2x_vfpf.c > +++ b/drivers/net/bnx2x/bnx2x_vfpf.c > @@ -282,6 +282,8 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, > uint8_t tx_count, uint8_t rx_ > sc->igu_sb_cnt =3D sc_resp.resc.num_sbs; > sc->igu_base_sb =3D sc_resp.resc.hw_sbs[0] & 0xFF; > sc->igu_dsb_id =3D -1; > + sc->max_tx_queues =3D sc_resp.resc.num_txqs; > + sc->max_rx_queues =3D sc_resp.resc.num_rxqs; >=20 > sc->link_params.chip_id =3D sc->devinfo.chip_id; > sc->doorbell_size =3D sc_resp.db_size; > -- > 2.5.0