[{"id":1776593,"web_url":"http://patchwork.ozlabs.org/comment/1776593/","msgid":"<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-27T20:23:22","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes\n<vinicius.gomes@intel.com> wrote:\n> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)\n> +{\n> +       struct cbs_sched_data *q = qdisc_priv(sch);\n> +       struct net_device *dev = qdisc_dev(sch);\n> +\n> +       if (!opt)\n> +               return -EINVAL;\n> +\n> +       /* FIXME: this means that we can only install this qdisc\n> +        * \"under\" mqprio. Do we need a more generic way to retrieve\n> +        * the queue, or do we pass the netdev_queue to the driver?\n> +        */\n> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);\n> +\n> +       return cbs_change(sch, opt);\n> +}\n\nYeah it is ugly to assume its parent is mqprio, at least you should\nerror out if it is not the case.\n\nI am not sure how we can solve this elegantly, perhaps you should\nextend mqprio rather than add a new one?","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"YRZMWtpJ\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2Tmg23JYz9t66\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 06:23:47 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751922AbdI0UXo (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 16:23:44 -0400","from mail-pg0-f65.google.com ([74.125.83.65]:34058 \"EHLO\n\tmail-pg0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751663AbdI0UXn (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 27 Sep 2017 16:23:43 -0400","by mail-pg0-f65.google.com with SMTP id u18so10299403pgo.1\n\tfor <netdev@vger.kernel.org>; Wed, 27 Sep 2017 13:23:43 -0700 (PDT)","by 10.100.160.131 with HTTP; Wed, 27 Sep 2017 13:23:22 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=XaRJPT92W/uxEZjeYXRwAhz5LzWX2HuBnb6xGfxH0jY=;\n\tb=YRZMWtpJaIp9eAugejWeEcknizz2z9yOirxFola1sIU+DM/4zvDUH2NABydbepIa4l\n\tkTFrXlF0zpQ1Cgq+W372oACYLwcCEfJW66XI4Zlq+J0f2KhaCRcL3A6BzRDnl1sO+z17\n\tWSN8uY9Zgi2yk5ptuY6V8HXqJOlHMNgbe1lIo2q2jb0Q1DWi9UN5ghKHObIlAdikhoym\n\twt+wRtsuBCdvM0S6DGPbuOqpOurnO40DMPAgQsFmSCCh0+vT8HteUmWJkiq+sWbn3CV2\n\tskE1ZtEJAkmD4NJaofIf5G5f8IuDI2zrgpiRsJeE89D8xPXfj1EDQGXMMcE3WP7hg7J1\n\t13kA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=XaRJPT92W/uxEZjeYXRwAhz5LzWX2HuBnb6xGfxH0jY=;\n\tb=as4JHK4Zr/+SKxHZCUTYN4RUIPPyAVthg5JV3BiSipM4wJzTR0LNlnh/QF4OALOpWk\n\tzZ96SjcIIjgM8IR0IFGs41KxPtNSX6YIiwXwLrcOViviS76fM/24LgEBZjYffMfwWVC6\n\tr+/YSnuJT5jg1nLDbaw38Ar9zS1ImMNNPaepIcDTbp05jam4mPXyZIJTa03NnA6hwZsU\n\tfaORw0DhdCUdIKucdTRr0p6yZWvs9XuW+PHUjRRlSA3b+8nHaybf3bhE+t8ROHRtxvub\n\ty3mxi4/mGls+3T8LZaE+KK13HiAafx6pBfI74k52OntIeT4BgrZNjK/5zVo65iD/CRRZ\n\t4i4w==","X-Gm-Message-State":"AHPjjUi1sWVNtZdYYcp+3RXbxOj6Twc8Fj+wK5G4pWmFtlj2YcWYY5X0\n\tfDWlcIVl6dbCaPsuxKusOMVap3u7kDZQvRmyGY2LxA==","X-Google-Smtp-Source":"AOwi7QC4uFzuuUU2gwyc8ll3YgtOFHedjPpKAFnw0Igpd+4awzaCCVyx+IXHs/sofZUphawDApNUxHASLg9+RTIP6Cw=","X-Received":"by 10.98.26.74 with SMTP id a71mr2281880pfa.286.1506543823120;\n\tWed, 27 Sep 2017 13:23:43 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170926233916.11774-3-vinicius.gomes@intel.com>","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Wed, 27 Sep 2017 13:23:22 -0700","Message-ID":"<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","To":"Vinicius Costa Gomes <vinicius.gomes@intel.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tintel-wired-lan <intel-wired-lan@lists.osuosl.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJiri Pirko <jiri@resnulli.us>, andre.guedes@intel.com,\n\tivan.briano@intel.com, jesus.sanchez-palencia@intel.com,\n\tboon.leong.ong@intel.com, richardcochran@gmail.com, henrik@austad.us","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776623,"web_url":"http://patchwork.ozlabs.org/comment/1776623/","msgid":"<87lgkzg7xv.fsf@intel.com>","list_archive_url":null,"date":"2017-09-27T21:14:52","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":72272,"url":"http://patchwork.ozlabs.org/api/people/72272/","name":"Vinicius Costa Gomes","email":"vinicius.gomes@intel.com"},"content":"Hi,\n\nCong Wang <xiyou.wangcong@gmail.com> writes:\n\n> On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes\n> <vinicius.gomes@intel.com> wrote:\n>> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)\n>> +{\n>> +       struct cbs_sched_data *q = qdisc_priv(sch);\n>> +       struct net_device *dev = qdisc_dev(sch);\n>> +\n>> +       if (!opt)\n>> +               return -EINVAL;\n>> +\n>> +       /* FIXME: this means that we can only install this qdisc\n>> +        * \"under\" mqprio. Do we need a more generic way to retrieve\n>> +        * the queue, or do we pass the netdev_queue to the driver?\n>> +        */\n>> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);\n>> +\n>> +       return cbs_change(sch, opt);\n>> +}\n>\n> Yeah it is ugly to assume its parent is mqprio, at least you should\n> error out if it is not the case.\n\nWill add an error for this, for now.\n\n>\n> I am not sure how we can solve this elegantly, perhaps you should\n> extend mqprio rather than add a new one?\n\nIs the alternative hinted in the FIXME worse? Instead of passing the\nindex of the hardware queue to the driver we pass the pointer to a\nnetdev_queue to the driver and it \"discovers\" the HW queue from that.\n\n\nCheers,\n--\nVinicius","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2Vvh16Pzz9t39\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 07:14:56 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751905AbdI0VOx (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 17:14:53 -0400","from mga05.intel.com ([192.55.52.43]:43876 \"EHLO mga05.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750829AbdI0VOx (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 17:14:53 -0400","from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga105.fm.intel.com with ESMTP; 27 Sep 2017 14:14:52 -0700","from ellie.jf.intel.com (HELO ellie) ([10.24.13.66])\n\tby fmsmga006.fm.intel.com with ESMTP; 27 Sep 2017 14:14:52 -0700"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,446,1500966000\"; d=\"scan'208\";a=\"156849760\"","From":"Vinicius Costa Gomes <vinicius.gomes@intel.com>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tintel-wired-lan <intel-wired-lan@lists.osuosl.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJiri Pirko <jiri@resnulli.us>, andre.guedes@intel.com,\n\tivan.briano@intel.com, jesus.sanchez-palencia@intel.com,\n\tboon.leong.ong@intel.com, richardcochran@gmail.com, henrik@austad.us","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","In-Reply-To":"<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>\n\t<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>","User-Agent":"Notmuch/0.21 (http://notmuchmail.org) Emacs/25.1.1\n\t(x86_64-pc-linux-gnu)","Date":"Wed, 27 Sep 2017 14:14:52 -0700","Message-ID":"<87lgkzg7xv.fsf@intel.com>","MIME-Version":"1.0","Content-Type":"text/plain","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776679,"web_url":"http://patchwork.ozlabs.org/comment/1776679/","msgid":"<4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com>","list_archive_url":null,"date":"2017-09-27T22:57:24","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":72279,"url":"http://patchwork.ozlabs.org/api/people/72279/","name":"Jesus Sanchez-Palencia","email":"jesus.sanchez-palencia@intel.com"},"content":"Hi,\n\n\nOn 09/27/2017 02:14 PM, Vinicius Costa Gomes wrote:\n> Hi,\n> \n> Cong Wang <xiyou.wangcong@gmail.com> writes:\n> \n>> On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes\n>> <vinicius.gomes@intel.com> wrote:\n>>> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)\n>>> +{\n>>> +       struct cbs_sched_data *q = qdisc_priv(sch);\n>>> +       struct net_device *dev = qdisc_dev(sch);\n>>> +\n>>> +       if (!opt)\n>>> +               return -EINVAL;\n>>> +\n>>> +       /* FIXME: this means that we can only install this qdisc\n>>> +        * \"under\" mqprio. Do we need a more generic way to retrieve\n>>> +        * the queue, or do we pass the netdev_queue to the driver?\n>>> +        */\n>>> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);\n>>> +\n>>> +       return cbs_change(sch, opt);\n>>> +}\n>>\n>> Yeah it is ugly to assume its parent is mqprio, at least you should\n>> error out if it is not the case.\n> \n> Will add an error for this, for now.\n> \n>>\n>> I am not sure how we can solve this elegantly, perhaps you should\n>> extend mqprio rather than add a new one?\n> \n> Is the alternative hinted in the FIXME worse? Instead of passing the\n> index of the hardware queue to the driver we pass the pointer to a\n> netdev_queue to the driver and it \"discovers\" the HW queue from that.\n\nWhat if we keep passing the index, but calculate it from the netdev_queue\npointer instead?\n\ni.e.:  q->queue = sch->dev_queue - netdev_get_tx_queue(dev, 0);\n\nAt least it wouldn't rely on the root qdisc being of any specific type.\n\nRegards,\nJesus","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2YL21V7Bz9t1G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 09:04:26 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752239AbdI0XEX (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 19:04:23 -0400","from mga06.intel.com ([134.134.136.31]:17613 \"EHLO mga06.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752231AbdI0XEW (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 19:04:22 -0400","from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga104.jf.intel.com with ESMTP; 27 Sep 2017 16:04:22 -0700","from darjeeling.jf.intel.com (HELO [10.7.159.68]) ([10.7.159.68])\n\tby orsmga001.jf.intel.com with ESMTP; 27 Sep 2017 16:04:22 -0700"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,446,1500966000\"; d=\"scan'208\";a=\"1176475245\"","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","To":"Vinicius Costa Gomes <vinicius.gomes@intel.com>,\n\tCong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tintel-wired-lan <intel-wired-lan@lists.osuosl.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJiri Pirko <jiri@resnulli.us>, andre.guedes@intel.com,\n\tivan.briano@intel.com, boon.leong.ong@intel.com,\n\trichardcochran@gmail.com, henrik@austad.us","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>\n\t<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>\n\t<87lgkzg7xv.fsf@intel.com>","From":"Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>","Message-ID":"<4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com>","Date":"Wed, 27 Sep 2017 15:57:24 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<87lgkzg7xv.fsf@intel.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1776686,"web_url":"http://patchwork.ozlabs.org/comment/1776686/","msgid":"<1506553861.4536.2.camel@intel.com>","list_archive_url":null,"date":"2017-09-27T23:11:01","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":72323,"url":"http://patchwork.ozlabs.org/api/people/72323/","name":"Andre Guedes","email":"andre.guedes@intel.com"},"content":"On Wed, 2017-09-27 at 15:57 -0700, Jesus Sanchez-Palencia wrote:\n> Hi,\n> \n> \n> On 09/27/2017 02:14 PM, Vinicius Costa Gomes wrote:\n> > Hi,\n> > \n> > Cong Wang <xiyou.wangcong@gmail.com> writes:\n> > \n> > > On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes\n> > > <vinicius.gomes@intel.com> wrote:\n> > > > +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)\n> > > > +{\n> > > > +       struct cbs_sched_data *q = qdisc_priv(sch);\n> > > > +       struct net_device *dev = qdisc_dev(sch);\n> > > > +\n> > > > +       if (!opt)\n> > > > +               return -EINVAL;\n> > > > +\n> > > > +       /* FIXME: this means that we can only install this qdisc\n> > > > +        * \"under\" mqprio. Do we need a more generic way to retrieve\n> > > > +        * the queue, or do we pass the netdev_queue to the driver?\n> > > > +        */\n> > > > +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);\n> > > > +\n> > > > +       return cbs_change(sch, opt);\n> > > > +}\n> > > \n> > > Yeah it is ugly to assume its parent is mqprio, at least you should\n> > > error out if it is not the case.\n> > \n> > Will add an error for this, for now.\n> > \n> > > \n> > > I am not sure how we can solve this elegantly, perhaps you should\n> > > extend mqprio rather than add a new one?\n> > \n> > Is the alternative hinted in the FIXME worse? Instead of passing the\n> > index of the hardware queue to the driver we pass the pointer to a\n> > netdev_queue to the driver and it \"discovers\" the HW queue from that.\n\nI don't see why we should move the queue index \"discovery\" into the driver. The\ndriver layer should be dead simple and getting the queue index from the upper\nlayer (qdisc) looks right to me.\n\n> What if we keep passing the index, but calculate it from the netdev_queue\n> pointer instead?\n> \n> i.e.:  q->queue = sch->dev_queue - netdev_get_tx_queue(dev, 0);\n> \n> At least it wouldn't rely on the root qdisc being of any specific type.\n\n+1\n\n- Andre","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2YTp61xtz9t6C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 09:11:10 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752457AbdI0XLI (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 27 Sep 2017 19:11:08 -0400","from mga03.intel.com ([134.134.136.65]:46831 \"EHLO mga03.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752447AbdI0XLH (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 27 Sep 2017 19:11:07 -0400","from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Sep 2017 16:11:06 -0700","from fmsmsx108.amr.corp.intel.com ([10.18.124.206])\n\tby orsmga004.jf.intel.com with ESMTP; 27 Sep 2017 16:11:06 -0700","from fmsmsx121.amr.corp.intel.com (10.18.125.36) by\n\tFMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP\n\tServer (TLS) id 14.3.319.2; Wed, 27 Sep 2017 16:11:06 -0700","from crsmsx104.amr.corp.intel.com (172.18.63.32) by\n\tfmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP\n\tServer (TLS) id 14.3.319.2; Wed, 27 Sep 2017 16:11:06 -0700","from crsmsx101.amr.corp.intel.com ([169.254.1.79]) by\n\tCRSMSX104.amr.corp.intel.com ([169.254.6.169]) with mapi id\n\t14.03.0319.002; Wed, 27 Sep 2017 17:11:03 -0600"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,446,1500966000\"; \n\td=\"p7s'?scan'208\";a=\"133003087\"","From":"\"Guedes, Andre\" <andre.guedes@intel.com>","To":"\"Sanchez-Palencia, Jesus\" <jesus.sanchez-palencia@intel.com>,\n\t\"Gomes, Vinicius\" <vinicius.gomes@intel.com>,\n\t\"xiyou.wangcong@gmail.com\" <xiyou.wangcong@gmail.com>","CC":"\"jiri@resnulli.us\" <jiri@resnulli.us>,\n\t\"jhs@mojatatu.com\" <jhs@mojatatu.com>,\n\t\"Ong, Boon Leong\" <boon.leong.ong@intel.com>,\n\t\"richardcochran@gmail.com\" <richardcochran@gmail.com>,\n\t\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>,\n\t\"henrik@austad.us\" <henrik@austad.us>,\n\t\"Briano, Ivan\" <ivan.briano@intel.com>,\n\t\"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","Thread-Topic":"[next-queue PATCH 2/3] net/sched: Introduce Credit Based\n\tShaper (CBS) qdisc","Thread-Index":"AQHTNyC38MAx/oAcKUuipmJ6l7btfqLJk0EAgAAOYwCAABymAIAAA86A","Date":"Wed, 27 Sep 2017 23:11:01 +0000","Message-ID":"<1506553861.4536.2.camel@intel.com>","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>\n\t<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>\n\t<87lgkzg7xv.fsf@intel.com>\n\t<4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com>","In-Reply-To":"<4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"yes","X-MS-TNEF-Correlator":"","x-originating-ip":"[10.24.13.6]","Content-Type":"multipart/signed; micalg=sha-1;\n\tprotocol=\"application/x-pkcs7-signature\";\n\tboundary=\"=-pA1c75+KfcOBsKRXHQ6r\"","MIME-Version":"1.0","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1777306,"web_url":"http://patchwork.ozlabs.org/comment/1777306/","msgid":"<CAM_iQpUUUrYeyqYK-CDAXzuKcy9FDtq_etQQvO4D4uCjV6As-w@mail.gmail.com>","list_archive_url":null,"date":"2017-09-28T22:34:47","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Wed, Sep 27, 2017 at 2:14 PM, Vinicius Costa Gomes\n<vinicius.gomes@intel.com> wrote:\n> Hi,\n>\n> Cong Wang <xiyou.wangcong@gmail.com> writes:\n>\n>> On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes\n>> <vinicius.gomes@intel.com> wrote:\n>>> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)\n>>> +{\n>>> +       struct cbs_sched_data *q = qdisc_priv(sch);\n>>> +       struct net_device *dev = qdisc_dev(sch);\n>>> +\n>>> +       if (!opt)\n>>> +               return -EINVAL;\n>>> +\n>>> +       /* FIXME: this means that we can only install this qdisc\n>>> +        * \"under\" mqprio. Do we need a more generic way to retrieve\n>>> +        * the queue, or do we pass the netdev_queue to the driver?\n>>> +        */\n>>> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);\n>>> +\n>>> +       return cbs_change(sch, opt);\n>>> +}\n>>\n>> Yeah it is ugly to assume its parent is mqprio, at least you should\n>> error out if it is not the case.\n>\n> Will add an error for this, for now.\n>\n>>\n>> I am not sure how we can solve this elegantly, perhaps you should\n>> extend mqprio rather than add a new one?\n>\n> Is the alternative hinted in the FIXME worse? Instead of passing the\n> index of the hardware queue to the driver we pass the pointer to a\n> netdev_queue to the driver and it \"discovers\" the HW queue from that.\n\nDoes this way solve the dependency on mqprio? If yes then it is good.\nAnd you have to fix it before merge, we don't have any qdisc depending\na specific type of qdisc to be its parent.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"UIvBNoJQ\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y38dr2pYWz9t3k\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 29 Sep 2017 08:35:12 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751360AbdI1WfJ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 Sep 2017 18:35:09 -0400","from mail-pf0-f195.google.com ([209.85.192.195]:36060 \"EHLO\n\tmail-pf0-f195.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750832AbdI1WfI (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 28 Sep 2017 18:35:08 -0400","by mail-pf0-f195.google.com with SMTP id f84so2606450pfj.3\n\tfor <netdev@vger.kernel.org>; Thu, 28 Sep 2017 15:35:07 -0700 (PDT)","by 10.100.160.131 with HTTP; Thu, 28 Sep 2017 15:34:47 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=nAjbj3zvsZIT+kgquzyekrV4BVwmXigBqI70fVtquu4=;\n\tb=UIvBNoJQdu2HlfWpcB8d6AdQ8HhgzDhBla9lhbhfAcxaLuuRKjZFDMuOrkUeJ3/1Hm\n\trPrscym/W/j9YnO51OmJTxoPuXY0rPnbIcbSnACAZmCAoHyFk52AwIaeec8CwwKL7/l0\n\t2qebj57z9d2UvQ+1nVhNZlvuACBtdGM67aZMCjKsSHkQWZTlA3PYhf+ix2OlVMTRMxuF\n\tMOeKBu9sFMHhSRZ4dt2Dq8Mcw3lzvPUz+PtTESInMSdxFH34QML8KO6NQWYoc97SvEBk\n\tuHQscUqfwY+TC2/Z0DNIPGGhPIWMvOEOVxr2mu7kjzhp+W9YFBQYPHVYCxjSC22ryw4Z\n\tqdMw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=nAjbj3zvsZIT+kgquzyekrV4BVwmXigBqI70fVtquu4=;\n\tb=sSh6O0q8kj+9KyetAzhCAyaeVrhlXN/z0HL3a7mc2+5Y6KlvqZUwReKDss7D7HeTWj\n\t8EG8DftWYaEsg01MyBvsq7rMiBY0NF8wzyJmZkfFZ/8iff9wZFL8JuR2578WjsgcICWl\n\t1frzJkibz+fkzykeyrKyL5KJ7xfp3HFjw15o9zzaukA+vBsotGKvfRk/2zgnwOyuLMKO\n\t3Lrmp0wMqndtxYQFSM4rbOvlyV7Jrqflw86f6xm9eVoOgQHJlLx4B2hgp9GUX+UHRa02\n\tjJdjkL67nKWzGeOoqylqpSmO661yJ7Qd1MxJjSdQkOD7vLKy974zh3OGw9fN3xUHlz9q\n\tJ6xw==","X-Gm-Message-State":"AHPjjUgd+VzxC3SK2Z+HOn6F1ZziDl/uzEn33H9ByhRecBDRpXv05F+9\n\tyq1Tqkzxe8JYJZxIMJV66jrym97+XR10tZsTlD0=","X-Google-Smtp-Source":"AOwi7QBZr5kpoN/eqNX9UM3Nni718DtTiTJav+91JnYjpStPOeV9BUziIYzdOfrnisLiM5+iaPvWrtWQIxKoWERYK9k=","X-Received":"by 10.84.253.23 with SMTP id z23mr5002208pll.210.1506638107509; \n\tThu, 28 Sep 2017 15:35:07 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<87lgkzg7xv.fsf@intel.com>","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>\n\t<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>\n\t<87lgkzg7xv.fsf@intel.com>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Thu, 28 Sep 2017 15:34:47 -0700","Message-ID":"<CAM_iQpUUUrYeyqYK-CDAXzuKcy9FDtq_etQQvO4D4uCjV6As-w@mail.gmail.com>","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","To":"Vinicius Costa Gomes <vinicius.gomes@intel.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tintel-wired-lan <intel-wired-lan@lists.osuosl.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJiri Pirko <jiri@resnulli.us>, andre.guedes@intel.com,\n\tIvan Briano <ivan.briano@intel.com>,\n\tjesus.sanchez-palencia@intel.com, boon.leong.ong@intel.com,\n\trichardcochran@gmail.com, Henrik Austad <henrik@austad.us>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1777315,"web_url":"http://patchwork.ozlabs.org/comment/1777315/","msgid":"<87ing2fmmq.fsf@intel.com>","list_archive_url":null,"date":"2017-09-28T23:07:25","subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","submitter":{"id":72272,"url":"http://patchwork.ozlabs.org/api/people/72272/","name":"Vinicius Costa Gomes","email":"vinicius.gomes@intel.com"},"content":"Hi,\n\nCong Wang <xiyou.wangcong@gmail.com> writes:\n\n[...]\n\n>>>\n>>> I am not sure how we can solve this elegantly, perhaps you should\n>>> extend mqprio rather than add a new one?\n>>\n>> Is the alternative hinted in the FIXME worse? Instead of passing the\n>> index of the hardware queue to the driver we pass the pointer to a\n>> netdev_queue to the driver and it \"discovers\" the HW queue from that.\n>\n> Does this way solve the dependency on mqprio? If yes then it is good.\n> And you have to fix it before merge, we don't have any qdisc depending\n> a specific type of qdisc to be its parent.\n\nYes, it does. And if we do like Jesus pointed out, we can do this on the\nCBS qdisc side, no need to change the driver.\n\n\nCheers,\n--\nVinicius","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y39M65ynFz9sRq\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 29 Sep 2017 09:07:30 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751464AbdI1XH0 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 Sep 2017 19:07:26 -0400","from mga14.intel.com ([192.55.52.115]:49864 \"EHLO mga14.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750857AbdI1XH0 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tThu, 28 Sep 2017 19:07:26 -0400","from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Sep 2017 16:07:25 -0700","from ellie.jf.intel.com (HELO ellie) ([10.24.13.28])\n\tby fmsmga006.fm.intel.com with ESMTP; 28 Sep 2017 16:07:25 -0700"],"X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,451,1500966000\"; d=\"scan'208\";a=\"157316257\"","From":"Vinicius Costa Gomes <vinicius.gomes@intel.com>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tintel-wired-lan <intel-wired-lan@lists.osuosl.org>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\tJiri Pirko <jiri@resnulli.us>, andre.guedes@intel.com,\n\tIvan Briano <ivan.briano@intel.com>,\n\tjesus.sanchez-palencia@intel.com, boon.leong.ong@intel.com,\n\trichardcochran@gmail.com, Henrik Austad <henrik@austad.us>","Subject":"Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper\n\t(CBS) qdisc","In-Reply-To":"<CAM_iQpUUUrYeyqYK-CDAXzuKcy9FDtq_etQQvO4D4uCjV6As-w@mail.gmail.com>","References":"<20170926233916.11774-1-vinicius.gomes@intel.com>\n\t<20170926233916.11774-3-vinicius.gomes@intel.com>\n\t<CAM_iQpVrz+e=TYHYqaYyUWRP528GSZXx8EnN1yPhZK8eLvP4Yw@mail.gmail.com>\n\t<87lgkzg7xv.fsf@intel.com>\n\t<CAM_iQpUUUrYeyqYK-CDAXzuKcy9FDtq_etQQvO4D4uCjV6As-w@mail.gmail.com>","User-Agent":"Notmuch/0.21 (http://notmuchmail.org) Emacs/25.1.1\n\t(x86_64-pc-linux-gnu)","Date":"Thu, 28 Sep 2017 16:07:25 -0700","Message-ID":"<87ing2fmmq.fsf@intel.com>","MIME-Version":"1.0","Content-Type":"text/plain","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]