aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.vnet.ibm.com>2014-04-28 04:05:09 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-28 13:44:10 -0400
commitd66cb37e96644fcc498d2abe61cd34e4392b9175 (patch)
tree34c2b8db988fe7dd1a4418f4cd688f7c09910ff3 /drivers/s390
parent290b8348c0ef7f23de8a974d83c96fc095d3bda7 (diff)
qeth: Add new priority queueing options
The existing options for priority queueing within OSA devices were based on the now partially defunct TOS field. This patch adds two new options as follows: - prio_queueing_skb: bases priority queueing on skb-priority - prio_queueing_vlan: uses the priority code point in the 802.1Q header Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_core.h2
-rw-r--r--drivers/s390/net/qeth_core_main.c15
-rw-r--r--drivers/s390/net/qeth_core_sys.c14
3 files changed, 27 insertions, 4 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 0a4148d2d962..a2088af51cc5 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -268,6 +268,8 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
268#define QETH_NO_PRIO_QUEUEING 0 268#define QETH_NO_PRIO_QUEUEING 0
269#define QETH_PRIO_Q_ING_PREC 1 269#define QETH_PRIO_Q_ING_PREC 1
270#define QETH_PRIO_Q_ING_TOS 2 270#define QETH_PRIO_Q_ING_TOS 2
271#define QETH_PRIO_Q_ING_SKB 3
272#define QETH_PRIO_Q_ING_VLAN 4
271 273
272/* Packing */ 274/* Packing */
273#define QETH_LOW_WATERMARK_PACK 2 275#define QETH_LOW_WATERMARK_PACK 2
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index dca5161beaed..34993009a9e1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3677,12 +3677,9 @@ EXPORT_SYMBOL_GPL(qeth_qdio_output_handler);
3677int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb, 3677int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
3678 int ipv, int cast_type) 3678 int ipv, int cast_type)
3679{ 3679{
3680 __be16 *tci;
3680 u8 tos; 3681 u8 tos;
3681 3682
3682 if (!ipv && (card->info.type == QETH_CARD_TYPE_OSD ||
3683 card->info.type == QETH_CARD_TYPE_OSX))
3684 return card->qdio.default_out_queue;
3685
3686 if (cast_type && card->info.is_multicast_different) 3683 if (cast_type && card->info.is_multicast_different)
3687 return card->info.is_multicast_different & 3684 return card->info.is_multicast_different &
3688 (card->qdio.no_out_queues - 1); 3685 (card->qdio.no_out_queues - 1);
@@ -3710,6 +3707,16 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
3710 return 1; 3707 return 1;
3711 if (tos & IPTOS_LOWDELAY) 3708 if (tos & IPTOS_LOWDELAY)
3712 return 0; 3709 return 0;
3710 break;
3711 case QETH_PRIO_Q_ING_SKB:
3712 if (skb->priority > 5)
3713 return 0;
3714 return ~skb->priority >> 1 & 3;
3715 case QETH_PRIO_Q_ING_VLAN:
3716 tci = &((struct ethhdr *)skb->data)->h_proto;
3717 if (*tci == ETH_P_8021Q)
3718 return ~*(tci + 1) >> (VLAN_PRIO_SHIFT + 1) & 3;
3719 break;
3713 default: 3720 default:
3714 break; 3721 break;
3715 } 3722 }
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index 8547de8a766c..8a25a2be9890 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -217,6 +217,10 @@ static ssize_t qeth_dev_prioqing_show(struct device *dev,
217 return sprintf(buf, "%s\n", "by precedence"); 217 return sprintf(buf, "%s\n", "by precedence");
218 case QETH_PRIO_Q_ING_TOS: 218 case QETH_PRIO_Q_ING_TOS:
219 return sprintf(buf, "%s\n", "by type of service"); 219 return sprintf(buf, "%s\n", "by type of service");
220 case QETH_PRIO_Q_ING_SKB:
221 return sprintf(buf, "%s\n", "by skb-priority");
222 case QETH_PRIO_Q_ING_VLAN:
223 return sprintf(buf, "%s\n", "by VLAN headers");
220 default: 224 default:
221 return sprintf(buf, "always queue %i\n", 225 return sprintf(buf, "always queue %i\n",
222 card->qdio.default_out_queue); 226 card->qdio.default_out_queue);
@@ -253,9 +257,19 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
253 if (!strcmp(tmp, "prio_queueing_prec")) { 257 if (!strcmp(tmp, "prio_queueing_prec")) {
254 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC; 258 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
255 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; 259 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
260 } else if (!strcmp(tmp, "prio_queueing_skb")) {
261 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_SKB;
262 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
256 } else if (!strcmp(tmp, "prio_queueing_tos")) { 263 } else if (!strcmp(tmp, "prio_queueing_tos")) {
257 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS; 264 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
258 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; 265 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
266 } else if (!strcmp(tmp, "prio_queueing_vlan")) {
267 if (!card->options.layer2) {
268 rc = -ENOTSUPP;
269 goto out;
270 }
271 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN;
272 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
259 } else if (!strcmp(tmp, "no_prio_queueing:0")) { 273 } else if (!strcmp(tmp, "no_prio_queueing:0")) {
260 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; 274 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
261 card->qdio.default_out_queue = 0; 275 card->qdio.default_out_queue = 0;