Page MenuHomeFreeBSD

Add DSCP support for network QoS to iscsi target.
ClosedPublic

Authored by rscheff on Thu, Sep 10, 12:00 AM.

Details

Summary

In order to prioritize iSCSI traffic across a network,
DSCP can be used. In order not to rely on "ipfw setdscp"
or in-network reclassification, this adds the dscp value
directly to the portal group (where TCP sessions are accepted).

As the an incoming iSCSI session is first handled by ctld for
CHAP authentication and the socket - once found to match all
prerequisites - is then handed off to the in-kernel iscsi
driver without modification of the socket parameters, simply
setting up the socket here is sufficient to keep sending
outgoing iSCSI related traffic with the correct DSCP.

Test Plan

verify the IP Header DSCP value for both IPv4 and
IPv6 iSCSI traffic during CHAP authentication, and subsequent
iSCSI IOs (handled directly by the kernel driver).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rscheff requested review of this revision.Thu, Sep 10, 12:00 AM
rscheff created this revision.
rscheff updated this revision to Diff 76861.Thu, Sep 10, 12:24 AM
  • prevent the ECN bits to be set.
mav added a comment.Thu, Sep 10, 1:31 PM

I haven't written that part of the code, but I think you should add its support to the uclparse.c.

Otherwise it looks like nice functionality.

usr.sbin/ctld/ctld.c
2193 ↗(On Diff #76861)

It looks weird to modify the configuration while applying it. I'd say either modify it while parsing or use local variable here.

rscheff updated this revision to Diff 76880.Thu, Sep 10, 3:13 PM
  • adding uclparse and using temporary dscp variable when doing setsockopt
rscheff marked an inline comment as done.Thu, Sep 10, 3:29 PM
mav accepted this revision.Thu, Sep 10, 4:25 PM
This revision is now accepted and ready to land.Thu, Sep 10, 4:25 PM
rscheff updated this revision to Diff 76905.Thu, Sep 10, 8:12 PM
  • uclparse hex values for dscp too
This revision now requires review to proceed.Thu, Sep 10, 8:12 PM
rscheff updated this revision to Diff 76913.Fri, Sep 11, 7:36 AM
  • shift TOS predefinitions and dscp field correctly around
trasz accepted this revision.Sun, Sep 27, 6:51 PM

Looks good!

This revision is now accepted and ready to land.Sun, Sep 27, 6:51 PM
This revision was automatically updated to reflect the committed changes.