{"id":809031,"url":"http://patchwork.ozlabs.org/api/1.0/patches/809031/?format=json","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.0/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<1504310354-42773-2-git-send-email-f.fainelli@gmail.com>","date":"2017-09-01T23:59:11","name":"[net-next,1/4] net: dsa: Allow switch drivers to indicate number of TX queues","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"8f095523aee3b738ff5eab7f4df75bc49fee9ca7","submitter":{"id":2800,"url":"http://patchwork.ozlabs.org/api/1.0/people/2800/?format=json","name":"Florian Fainelli","email":"f.fainelli@gmail.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.0/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1504310354-42773-2-git-send-email-f.fainelli@gmail.com/mbox/","series":[{"id":1131,"url":"http://patchwork.ozlabs.org/api/1.0/series/1131/?format=json","date":"2017-09-01T23:59:10","name":"net: dsa: Allow switch drivers to indicate number of TX queues","version":1,"mbox":"http://patchwork.ozlabs.org/series/1131/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809031/checks/","tags":{},"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=\"sCV+a3Ia\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkbwV3T0sz9t16\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  2 Sep 2017 10:05:30 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752642AbdIBAFY (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 20:05:24 -0400","from mail-qt0-f194.google.com ([209.85.216.194]:33771 \"EHLO\n\tmail-qt0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752329AbdIBAFT (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 1 Sep 2017 20:05:19 -0400","by mail-qt0-f194.google.com with SMTP id h15so1255353qta.0\n\tfor <netdev@vger.kernel.org>; Fri, 01 Sep 2017 17:05:19 -0700 (PDT)","from stb-bld-04.irv.broadcom.com ([192.19.255.250])\n\tby smtp.gmail.com with ESMTPSA id\n\ti7sm1013192qtb.58.2017.09.01.17.05.15\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 01 Sep 2017 17:05:17 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=BpGIGzJAH9UesxRKN8w5tPC5E/WP+tgSUGyHkpC+Zck=;\n\tb=sCV+a3Iacxj1AI3F97ZCZD9o8o7g6DJuebHocKM3u4heQWrTDSuKYnHX/OC9dH9XxS\n\t0gtTu96KDTIxXhXiaNu2wn1emPgYHI7FkW2dzL9m7R5u5n34keFLYGNGaCjsJyjo9E+7\n\tgMQHcKLt53d/yIz8PUxT0JMR2bv67YR0GkN/60uG/x+kUdtt0/GT8YrlpYuym8c2iYAw\n\tKLNtxFUXyqrLqbQLXFiyn62/nqTcMsXSaaKeBIEw7nW9Ozq9EK4nBUxJrVenC9l5Pi9n\n\tfodJfvZD1h0NreuEJV/LeJN4td+pbOxNMfT6dQ+Mv39cLJmWpeVefV78TZIggDk0lkxO\n\t3MIA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=BpGIGzJAH9UesxRKN8w5tPC5E/WP+tgSUGyHkpC+Zck=;\n\tb=fAGRdRRhHAegGt8Xfz6+1BAqXJ7JuQtXdGREQI0rKVGWPhqQnfZ0BeYMBf3PQyqC5z\n\tF84b975qmXxuoL8L9OTXYKjl7/FAX2cTkaBlceWwnbjbIvEI67QTxcetq2ggu8kyleuL\n\thZNNm+GJacxbArYEXmj+2moevQ8l+iANV6t0AMtbiKFF0uRIGIjP7i58BKbnGRiBj0y3\n\t6kxNCM9bZi/2KjyzjrHxhzwpxVD3KesuppQsqwu+Ts2Zf0unNMjHtytWc3ws3yEwBRHy\n\t7fmXrWu0KVjW5YjRxbFDdF2Xn6CT3kBCRgOzURYFx8fLFIgog5RoFfbm4Vxm5VHpi+17\n\ta0PA==","X-Gm-Message-State":"AHPjjUjLxOydkkCL14z7eN0/2BrCvucTN2Lh0FlL7KH0IxlVY3OENSpg\n\thWGExmHbpnOjQ+Y/qxc=","X-Google-Smtp-Source":"ADKCNb74+6ajQiXUlyLZ2dAbuy11nyfBMq2IVD67l38uzQELzfl9VfS+UZF2Ilw+2FdXsV/3ANzLvA==","X-Received":"by 10.200.52.155 with SMTP id w27mr5179757qtb.254.1504310718319; \n\tFri, 01 Sep 2017 17:05:18 -0700 (PDT)","From":"Florian Fainelli <f.fainelli@gmail.com>","To":"netdev@vger.kernel.org","Cc":"davem@davemloft.net, andrew@lunn.ch,\n\tvivien.didelot@savoirfairelinux.com, jiri@resnulli.us,\n\tjhs@mojatatu.com, xiyou.wangcong@gmail.com,\n\tFlorian Fainelli <f.fainelli@gmail.com>","Subject":"[PATCH net-next 1/4] net: dsa: Allow switch drivers to indicate\n\tnumber of TX queues","Date":"Fri,  1 Sep 2017 16:59:11 -0700","Message-Id":"<1504310354-42773-2-git-send-email-f.fainelli@gmail.com>","X-Mailer":"git-send-email 1.9.1","In-Reply-To":"<1504310354-42773-1-git-send-email-f.fainelli@gmail.com>","References":"<1504310354-42773-1-git-send-email-f.fainelli@gmail.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"Let switch drivers indicate how many TX queues they support. Some\nswitches, such as Broadcom Starfighter 2 are designed with 8 egress\nqueues. Future changes will allow us to leverage the queue mapping and\ndirect the transmission towards a particular queue.\n\nSigned-off-by: Florian Fainelli <f.fainelli@gmail.com>\n---\n include/net/dsa.h | 3 +++\n net/dsa/slave.c   | 8 ++++++--\n 2 files changed, 9 insertions(+), 2 deletions(-)","diff":"diff --git a/include/net/dsa.h b/include/net/dsa.h\nindex 398ca8d70ccd..dd44d6ce1097 100644\n--- a/include/net/dsa.h\n+++ b/include/net/dsa.h\n@@ -243,6 +243,9 @@ struct dsa_switch {\n \t/* devlink used to represent this switch device */\n \tstruct devlink\t\t*devlink;\n \n+\t/* Number of switch port queues */\n+\tunsigned int\t\tnum_tx_queues;\n+\n \t/* Dynamically allocated ports, keep last */\n \tsize_t num_ports;\n \tstruct dsa_port ports[];\ndiff --git a/net/dsa/slave.c b/net/dsa/slave.c\nindex 78e78a6e6833..2afa99506f8b 100644\n--- a/net/dsa/slave.c\n+++ b/net/dsa/slave.c\n@@ -1259,8 +1259,12 @@ int dsa_slave_create(struct dsa_port *port, const char *name)\n \tcpu_dp = ds->dst->cpu_dp;\n \tmaster = cpu_dp->netdev;\n \n-\tslave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name,\n-\t\t\t\t NET_NAME_UNKNOWN, ether_setup);\n+\tif (!ds->num_tx_queues)\n+\t\tds->num_tx_queues = 1;\n+\n+\tslave_dev = alloc_netdev_mqs(sizeof(struct dsa_slave_priv), name,\n+\t\t\t\t     NET_NAME_UNKNOWN, ether_setup,\n+\t\t\t\t     ds->num_tx_queues, 1);\n \tif (slave_dev == NULL)\n \t\treturn -ENOMEM;\n \n","prefixes":["net-next","1/4"]}