From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0065.outbound.protection.outlook.com [104.47.40.65]) by dpdk.org (Postfix) with ESMTP id 6E108374F for ; Fri, 9 Sep 2016 16:20:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SonusNetworks.onmicrosoft.com; s=selector1-sonusnet-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=r3k4lBTbvzQxiuZjHYoSMHv89mo/y4gCKirOoJXl/+4=; b=gtuFjKRA6aFtmJQQWXd7k5EMeO35VGXle281yoMXLld8guDz1yaIb3bhrzZD+u3bGR19UOoci2hDPEvkYr2C3fQl1NTX6Zg280hCUAnRFu1V2vEG5DlKlH0LKDN2Aqopl/qgwTHe7UfdR/l2uC8dOCu2tQNET8Ue807H+5zfXh4= Received: from CY1PR03MB1503.namprd03.prod.outlook.com (10.163.17.21) by CY1PR03MB1502.namprd03.prod.outlook.com (10.163.17.20) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Fri, 9 Sep 2016 14:19:58 +0000 Received: from CY1PR03MB1503.namprd03.prod.outlook.com ([10.163.17.21]) by CY1PR03MB1503.namprd03.prod.outlook.com ([10.163.17.21]) with mapi id 15.01.0557.032; Fri, 9 Sep 2016 14:19:58 +0000 From: "Dey, Souvik" To: Yuanhan Liu CC: "dev@dpdk.org" , "stephen@networkplumber.org" Thread-Topic: [PATCH v4]net/virtio: add mtu set in virtio Thread-Index: AQHSCL7xEgAVZJyiaUu1GlORUNZIaKBtbHzggANRoICAAHiC0A== Date: Fri, 9 Sep 2016 14:19:57 +0000 Message-ID: References: <20160907041832.35384-1-sodey@sonusnet.com> <20160909070009.GS23158@yliu-dev.sh.intel.com> In-Reply-To: <20160909070009.GS23158@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sodey@sonusnet.com; x-originating-ip: [208.45.178.4] x-ms-office365-filtering-correlation-id: 53ed7117-513f-44e1-3c87-08d3d8bc6108 x-microsoft-exchange-diagnostics: 1; CY1PR03MB1502; 6:yZpttwT49/MfCUzCM0SaOG606Wo52LIjZ+1zKsn3/TbBkJzVx1h7TJ49fn1H6ZZzIRZsMqacRSArDGOSgIBMdaPQVt4f3knqXRFNc8uP5JUFOmQdRQdRUslZJNcgtwKqoMNfgBFz+tqLfRbluVYMNqo9R9XLw7ePp+Xd9tjVFotCCDpNBwymXVrUfzjiDTu7Bnnq7tGcPic9zvSsVic3YX0yOzo25CBxzfg+7qLdLGmHh2JwWZjOWRVCHmFrgi+EJuSn1AL9Dcn1JIwQzQhdrjTMLPyEIUqQ8smMVUjZnoE=; 5:7ORfDsNJdphJNjo5/V5w9uga8jUNUgkVNO6+7Ki/9u9cGudxejqlN8xUVEitf2VQtHc84G+rLIiJ4LaFkNiSiwPbDIrdFpbuQIERl4AdLT+eyAR2mp51QxsnWTBCCU22yO/vILx7Bvmuahp9grMb5A==; 24:3iPfxuzeUWE/cQ40G6xW+qwiBFsquD5NJzqZa5C4OfJhaDax57NtvzKy1TA8gF0AiBCZ661tavYASx8ephrLYmDJSximsmcREkda+qqaEDM=; 7:oymfd6rV7OykcJOo10Bgr/ToUbnD1RwAWecF9gMVOxM6r/z1g8aquDzlHTt+aJSviBeyFiDnuBmh9kjBC7XApHXmkQYVhbRWCqVE+60QjfxZx/EbHOK8EQtxhzVhLErAGQBKY0AarX2e8KZH11H3qrbn/g2osJ95kl11CS2U8JQizG4s0VcHGbrgYlGvQ9f/wsnDGY9KBjtSt8mtF7oA+vY6jjldI22PT4QMCTNpTCuGWToLruZ7Q/qV2umYpc6C x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1502; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR03MB1502; BCL:0; PCL:0; RULEID:; SRVR:CY1PR03MB1502; x-forefront-prvs: 00603B7EEF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(54534003)(13464003)(377454003)(51914003)(24454002)(199003)(19580395003)(6116002)(101416001)(86362001)(106116001)(106356001)(105586002)(586003)(11100500001)(102836003)(3846002)(99286002)(76576001)(19580405001)(92566002)(122556002)(33656002)(2950100001)(2900100001)(77096005)(50986999)(76176999)(54356999)(9686002)(8676002)(81156014)(10400500002)(81166006)(74316002)(8936002)(97736004)(7846002)(305945005)(68736007)(110136002)(189998001)(3280700002)(4326007)(7736002)(66066001)(5002640100001)(87936001)(5660300001)(7696004)(3900700001)(2906002)(3660700001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB1502; H:CY1PR03MB1503.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: sonusnet.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sonusnet.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Sep 2016 14:19:57.6597 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1502 Subject: Re: [dpdk-dev] [PATCH v4]net/virtio: add mtu set in virtio 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, 09 Sep 2016 14:20:01 -0000 Hi Liu, Yes agreed your comment. I will definitely remove the declaration as it is = not really required.=20 So the latest patch will look like this . Yes I did rush a bit to submit t= he patch last will correct my suite. So sending the patch in a reply if we = have more comments we can take a look and they re-submit the final reviewed= patch. Thanks for the help though.=20 --- drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio= _ethdev.c index 07d6449..da16ad4 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c +static int +virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct virtio_hw *hw =3D dev->data->dev_private; + if (mtu < VIRTIO_MIN_RX_BUFSIZE || mtu > VIRTIO_MAX_RX_PKTLEN) { + PMD_INIT_LOG(ERR, "Mtu should be between 64 and 9728\n"); + return -EINVAL; + } + return 0; +} + /* * dev_ops for virtio, bare necessities for basic operation */ @@ -664,6 +675,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops =3D = { .promiscuous_disable =3D virtio_dev_promiscuous_disable, .allmulticast_enable =3D virtio_dev_allmulticast_enable, .allmulticast_disable =3D virtio_dev_allmulticast_disable, + .mtu_set =3D virtio_mtu_set, =20 .dev_infos_get =3D virtio_dev_info_get, .stats_get =3D virtio_dev_stats_get, -- -- Regards, Souvik -----Original Message----- From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]=20 Sent: Friday, September 9, 2016 3:00 AM To: Dey, Souvik Cc: dev@dpdk.org; stephen@networkplumber.org Subject: Re: [PATCH v4]net/virtio: add mtu set in virtio On Wed, Sep 07, 2016 at 04:21:30AM +0000, Dey, Souvik wrote: > Hi Liu, > Submitted the version 4 of the patch as you suggested , Your patch is looking much better. But not really, you ignored few of my co= mments. > and have removed the Reviewed by line. > I have still kept the function definition as to follow the same suit as w= e have done for other eth_dev_ops. That's because most of the method implementions are after the reference, th= us the declaration is needed. For your case, I see no good reason to do that. BTW, if you disagree with m= y comment, you shoud made a reply, instead of rushing to sending a new vers= ion. > -- > Regards, > Souvik >=20 > -----Original Message----- > From: Dey, Souvik > Sent: Wednesday, September 7, 2016 12:19 AM > To: dev@dpdk.org; stephen@networkplumber.org;=20 > yuanhan.liu@linux.intel.com > Cc: Dey, Souvik > Subject: [PATCH v4]net/virtio: add mtu set in virtio >=20 >=20 > Virtio interfaces should also support setting of mtu, as in case of cloud= it is expected to have the consistent mtu across the infrastructure that t= he dhcp server sends and not hardcoded to 1500(default). >=20 > Changes in v4: Incorporated review comments. > Changes in v3: Corrected few style errors as reported by sys-stv. > Changes in v2: Incorporated review comments. DPDK prefers to put the change log to ... >=20 > Signed-off-by: Souvik Dey >=20 > --- ... here. So that they will be showed in mailing list (for review), but they will be = gone after apply. In another word, we don't like to see those change log in= git history, but we'd like to see them while review. > drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c=20 > b/drivers/net/virtio/virtio_ethdev.c > index 07d6449..da16ad4 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -92,6 +92,7 @@ static void virtio_mac_addr_add(struct rte_eth_dev *dev= , static void virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t ind= ex); static void virtio_mac_addr_set(struct rte_eth_dev *dev, > struct ether_addr *mac_addr); > +static int virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); > =20 > static int virtio_dev_queue_stats_mapping_set( > __rte_unused struct rte_eth_dev *eth_dev, @@ -652,6 +653,16 @@ virtio_d= ev_allmulticast_disable(struct rte_eth_dev *dev) > PMD_INIT_LOG(ERR, "Failed to disable allmulticast"); } > =20 > +static int > +virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > + struct virtio_hw *hw =3D dev->data->dev_private; > + if (mtu < VIRTIO_MIN_RX_BUFSIZE || mtu > VIRTIO_MAX_RX_PKTLEN) { > + PMD_INIT_LOG(ERR, "Mtu should be between 64 and 9728\n"); I still saw those numbers. --yliu