|
| 1 | +=================== |
| 2 | +PRP Offload |
| 3 | +=================== |
| 4 | + |
| 5 | +.. rubric:: **Introduction** |
| 6 | + |
| 7 | +HSR (High-availability Seamless Redundancy) framework in Linux supports HSR and PRP (Parallel Redundancy Protocol) modes of redundancy by using 2 ports. |
| 8 | +It also allows to offload the below functionalities of PRP mode to the underlying hardware/device: |
| 9 | + |
| 10 | +- hsr-tag-ins-offload: Add PRP trailer to the frame |
| 11 | +- hsr-dup-offload: Duplicate the outgoing PRP frame |
| 12 | +- hsr-tag-rm-offload: Remove PRP trailer from the frame |
| 13 | + |
| 14 | +The ICSSG PRP firmware supports offloading of all above functionalities saving overhead from the driver. |
| 15 | + |
| 16 | +.. note:: |
| 17 | + |
| 18 | + The offload of functionality hsr-fwd-offload should also be enabled for correct driver configuration. |
| 19 | + |
| 20 | +The below script sets up a PRP interface with all possible offload functionalities enabled |
| 21 | + |
| 22 | +.. code-block:: bash |
| 23 | +
|
| 24 | + #!/bin/sh |
| 25 | +
|
| 26 | + #For non offload - sh prp_setup.sh prp_sw <INTF_A> <INTF_B> <PRP_INTF_IP_ADDR> |
| 27 | + #For offload - sh prp_setup.sh prp_hw <INTF_A> <INTF_B> <PRP_INTF_IP_ADDR> |
| 28 | +
|
| 29 | + if [ "$#" != "4" ] |
| 30 | + then |
| 31 | + echo "$0 <prp_sw/prp_hw> <intf1> <intf2> <ip addr>" |
| 32 | + exit |
| 33 | + fi |
| 34 | +
|
| 35 | + if [ "$1" != "prp_sw" ] && [ "$1" != "prp_hw" ] |
| 36 | + then |
| 37 | + echo "$0 <prp_sw|prp_hw>" |
| 38 | + exit |
| 39 | + fi |
| 40 | +
|
| 41 | + if=prp0 |
| 42 | +
|
| 43 | + ifa=$2 |
| 44 | + ifb=$3 |
| 45 | +
|
| 46 | + ip=$4 |
| 47 | + mac=$(ifconfig "$ifa" | grep ether | cut -d " " -f 10) |
| 48 | +
|
| 49 | + echo "ip=$ip" |
| 50 | + echo "if=$if" |
| 51 | + echo "mac=$mac" |
| 52 | + echo "slave-a=$ifa" |
| 53 | + echo "slave-b=$ifb" |
| 54 | +
|
| 55 | + ip link set $if down |
| 56 | + ip link delete $if 2> /dev/null |
| 57 | +
|
| 58 | + if [ "$1" = "prp_hw" ] |
| 59 | + then |
| 60 | + echo "Available offload features for $ifa: " |
| 61 | + ethtool -k "$ifa" | grep hsr |
| 62 | + ethtool -K "$ifa" hsr-fwd-offload on |
| 63 | + ethtool -K "$ifa" hsr-dup-offload on |
| 64 | + ethtool -K "$ifa" hsr-tag-ins-offload on |
| 65 | + ethtool -K "$ifa" hsr-tag-rm-offload on |
| 66 | + echo "Enabled offload features for $ifa: " |
| 67 | + ethtool -k "$ifa" | grep hsr |
| 68 | +
|
| 69 | + echo "Available offload features for $ifb: " |
| 70 | + ethtool -k "$ifb" | grep hsr |
| 71 | + ethtool -K "$ifb" hsr-fwd-offload on |
| 72 | + ethtool -K "$ifb" hsr-dup-offload on |
| 73 | + ethtool -K "$ifb" hsr-tag-ins-offload on |
| 74 | + ethtool -K "$ifb" hsr-tag-rm-offload on |
| 75 | + echo "Enabled offload features for $ifb: " |
| 76 | + ethtool -k "$ifb" | grep hsr |
| 77 | + fi |
| 78 | +
|
| 79 | + ip link set dev "$ifa" address "$mac" |
| 80 | + ip link set dev "$ifb" address "$mac" |
| 81 | +
|
| 82 | + ip link add name $if type hsr slave1 "$ifa" slave2 "$ifb" supervision 45 proto 1 |
| 83 | +
|
| 84 | + sleep 3 |
| 85 | +
|
| 86 | + ip addr add "$ip"/24 dev $if |
| 87 | + ip link set $if up |
| 88 | +
|
| 89 | +To create PRP interface with IP address 192.168.1.10 using eth1 and eth2, |
| 90 | +run the script by passing the arguments as below |
| 91 | + |
| 92 | +.. code-block:: console |
| 93 | +
|
| 94 | + sh prp_setup.sh prp_hw eth1 eth2 192.168.1.10 |
| 95 | +
|
| 96 | +.. rubric:: *Multicast Filtering* |
| 97 | + |
| 98 | +All multi-cast addresses not registered will be filtered out. |
| 99 | + |
| 100 | +.. rubric:: Multicast Add/Delete |
| 101 | + |
| 102 | +Multicast MAC address can be added/deleted using ip maddr commands or Linux socket ioctl SIOCADDMULTI/SIOCDELMULTI. |
| 103 | + |
| 104 | +.. rubric:: Show multicast address |
| 105 | + |
| 106 | +Show current list of multicast address for the PRP interface |
| 107 | + |
| 108 | +.. code-block:: console |
| 109 | +
|
| 110 | + ip maddr show dev <prp_intf> |
| 111 | +
|
| 112 | +Example: |
| 113 | + |
| 114 | +.. code-block:: console |
| 115 | +
|
| 116 | + # ip maddr show dev prp0 |
| 117 | + 7: prp0 |
| 118 | + link 33:33:00:00:00:01 users 3 |
| 119 | + link 01:80:c2:00:00:0e users 3 static |
| 120 | + link 01:80:c2:00:00:03 users 3 static |
| 121 | + link 01:80:c2:00:00:00 users 3 static |
| 122 | + link 01:00:5e:00:00:01 users 3 |
| 123 | + link 33:33:ff:1e:a0:a8 users 3 |
| 124 | + link 01:00:5e:00:00:fb users 3 |
| 125 | + link 33:33:00:00:00:fb users 3 |
| 126 | + inet 224.0.0.251 |
| 127 | + inet 224.0.0.1 |
| 128 | + inet6 ff02::fb |
| 129 | + inet6 ff02::1:ff1e:a0a8 |
| 130 | + inet6 ff02::1 |
| 131 | + inet6 ff01::1 |
| 132 | +
|
| 133 | +.. rubric:: Add multicast address |
| 134 | + |
| 135 | +Add a multicast address |
| 136 | + |
| 137 | +.. code-block:: console |
| 138 | +
|
| 139 | + ip maddr add <multicast_mac_addr> dev <prp_intf> |
| 140 | +
|
| 141 | +Example: To add a multicast address and display the list in PRP and slave ports |
| 142 | + |
| 143 | +.. code-block:: console |
| 144 | +
|
| 145 | + # ip maddr add 01:80:c4:00:00:0e dev prp0 |
| 146 | + # ip maddr show dev prp0 |
| 147 | + 7: prp0 |
| 148 | + link 33:33:00:00:00:01 users 3 |
| 149 | + link 01:80:c2:00:00:0e users 3 static |
| 150 | + link 01:80:c2:00:00:03 users 3 static |
| 151 | + link 01:80:c2:00:00:00 users 3 static |
| 152 | + link 01:00:5e:00:00:01 users 3 |
| 153 | + link 33:33:ff:1e:a0:a8 users 3 |
| 154 | + link 01:00:5e:00:00:fb users 3 |
| 155 | + link 33:33:00:00:00:fb users 3 |
| 156 | + link 01:80:c4:00:00:0e users 3 static |
| 157 | + inet 224.0.0.251 |
| 158 | + inet 224.0.0.1 |
| 159 | + inet6 ff02::fb |
| 160 | + inet6 ff02::1:ff1e:a0a8 |
| 161 | + inet6 ff02::1 |
| 162 | + inet6 ff01::1 |
| 163 | +
|
| 164 | + # ip maddr show dev eth1 |
| 165 | + 5: eth1 |
| 166 | + link 33:33:00:00:00:01 users 3 |
| 167 | + link 01:00:5e:00:00:01 users 3 |
| 168 | + link 01:80:c2:00:00:0e users 4 static |
| 169 | + link 01:80:c2:00:00:03 users 4 static |
| 170 | + link 01:80:c2:00:00:00 users 4 static |
| 171 | + link 33:33:ff:1e:a0:a8 users 3 |
| 172 | + link 33:33:00:00:00:fb users 3 |
| 173 | + link 01:00:5e:00:00:fb users 2 |
| 174 | + link 01:80:c4:00:00:0e users 2 |
| 175 | + inet 224.0.0.1 |
| 176 | + inet6 ff02::fb |
| 177 | + inet6 ff02::1:ff1e:a0a8 |
| 178 | + inet6 ff02::1 users 2 |
| 179 | + inet6 ff01::1 |
| 180 | +
|
| 181 | + # ip maddr show dev eth2 |
| 182 | + 6: eth2 |
| 183 | + link 33:33:00:00:00:01 users 3 |
| 184 | + link 01:00:5e:00:00:01 users 3 |
| 185 | + link 01:80:c2:00:00:0e users 4 static |
| 186 | + link 01:80:c2:00:00:03 users 4 static |
| 187 | + link 01:80:c2:00:00:00 users 4 static |
| 188 | + link 33:33:ff:1e:a0:a7 users 2 |
| 189 | + link 33:33:00:00:00:fb users 3 |
| 190 | + link 33:33:ff:1e:a0:a8 users 2 |
| 191 | + link 01:00:5e:00:00:fb users 2 |
| 192 | + link 01:80:c4:00:00:0e users 2 |
| 193 | + inet 224.0.0.1 |
| 194 | + inet6 ff02::fb |
| 195 | + inet6 ff02::1:ff1e:a0a7 |
| 196 | + inet6 ff02::1 users 2 |
| 197 | + inet6 ff01::1 |
| 198 | +
|
| 199 | +.. rubric:: Delete multicast address |
| 200 | + |
| 201 | +Delete a multicast address |
| 202 | + |
| 203 | +.. code-block:: console |
| 204 | +
|
| 205 | + ip maddr del <multicast_mac_addr> dev <prp_intf> |
| 206 | +
|
| 207 | +Example: To delete an added multicast address and dislay the list of PRP and |
| 208 | +slave intefaces. |
| 209 | + |
| 210 | +.. code-block:: console |
| 211 | +
|
| 212 | + # ip maddr del 01:80:c4:00:00:0e dev prp0 |
| 213 | + # ip maddr show dev prp0 |
| 214 | + 7: prp0 |
| 215 | + link 33:33:00:00:00:01 users 3 |
| 216 | + link 01:80:c2:00:00:0e users 3 static |
| 217 | + link 01:80:c2:00:00:03 users 3 static |
| 218 | + link 01:80:c2:00:00:00 users 3 static |
| 219 | + link 01:00:5e:00:00:01 users 3 |
| 220 | + link 33:33:ff:1e:a0:a8 users 3 |
| 221 | + link 01:00:5e:00:00:fb users 3 |
| 222 | + link 33:33:00:00:00:fb users 3 |
| 223 | + inet 224.0.0.251 |
| 224 | + inet 224.0.0.1 |
| 225 | + inet6 ff02::fb |
| 226 | + inet6 ff02::1:ff1e:a0a8 |
| 227 | + inet6 ff02::1 |
| 228 | + inet6 ff01::1 |
| 229 | +
|
| 230 | + # ip maddr show dev eth1 |
| 231 | + 5: eth1 |
| 232 | + link 33:33:00:00:00:01 users 3 |
| 233 | + link 01:00:5e:00:00:01 users 3 |
| 234 | + link 01:80:c2:00:00:0e users 4 static |
| 235 | + link 01:80:c2:00:00:03 users 4 static |
| 236 | + link 01:80:c2:00:00:00 users 4 static |
| 237 | + link 33:33:ff:1e:a0:a8 users 3 |
| 238 | + link 33:33:00:00:00:fb users 3 |
| 239 | + link 01:00:5e:00:00:fb users 2 |
| 240 | + inet 224.0.0.1 |
| 241 | + inet6 ff02::fb |
| 242 | + inet6 ff02::1:ff1e:a0a8 |
| 243 | + inet6 ff02::1 users 2 |
| 244 | + inet6 ff01::1 |
| 245 | +
|
| 246 | + # ip maddr show dev eth2 |
| 247 | + 6: eth2 |
| 248 | + link 33:33:00:00:00:01 users 3 |
| 249 | + link 01:00:5e:00:00:01 users 3 |
| 250 | + link 01:80:c2:00:00:0e users 4 static |
| 251 | + link 01:80:c2:00:00:03 users 4 static |
| 252 | + link 01:80:c2:00:00:00 users 4 static |
| 253 | + link 33:33:ff:1e:a0:a7 users 2 |
| 254 | + link 33:33:00:00:00:fb users 3 |
| 255 | + link 33:33:ff:1e:a0:a8 users 2 |
| 256 | + link 01:00:5e:00:00:fb users 2 |
| 257 | + inet 224.0.0.1 |
| 258 | + inet6 ff02::fb |
| 259 | + inet6 ff02::1:ff1e:a0a7 |
| 260 | + inet6 ff02::1 users 2 |
| 261 | + inet6 ff01::1 |
| 262 | +
|
| 263 | +.. rubric:: *Multicast Filtering for VLAN Interfaces* |
| 264 | + |
| 265 | +Multicast filtering for VLAN interfaces is also supported. |
| 266 | + |
| 267 | +Show current list of multicast address for the PRP VLAN interface |
| 268 | + |
| 269 | +.. code-block:: console |
| 270 | +
|
| 271 | + ip maddr show dev <prp_vlan_intf> |
| 272 | +
|
| 273 | +Example: |
| 274 | + |
| 275 | +.. code-block:: console |
| 276 | +
|
| 277 | + # ip maddr show dev prp0.5 |
| 278 | +
|
| 279 | +Add multicast address for the PRP VLAN interface |
| 280 | + |
| 281 | +.. code-block:: console |
| 282 | +
|
| 283 | + ip maddr add <multicast_mac_addr> dev <prp_vlan_intf> |
| 284 | +
|
| 285 | +Example: |
| 286 | + |
| 287 | +.. code-block:: console |
| 288 | +
|
| 289 | + # ip maddr add 01:80:c4:00:00:0e dev prp0.5 |
| 290 | +
|
| 291 | +Delete multicast address for the PRP VLAN interface |
| 292 | + |
| 293 | +.. code-block:: console |
| 294 | +
|
| 295 | + ip maddr del <multicast_mac_addr> dev <prp_vlan_intf> |
| 296 | +
|
| 297 | +Example: |
| 298 | + |
| 299 | +.. code-block:: console |
| 300 | +
|
| 301 | + # ip maddr del 01:80:c4:00:00:0e dev prp0.5 |
| 302 | +
|
| 303 | +.. rubric:: Performance |
| 304 | + |
| 305 | +This section describes the throughput and CPU usage metrics in the offload case |
| 306 | + |
| 307 | +.. rubric:: Setup |
| 308 | + |
| 309 | +A sample test setup is as shown below |
| 310 | + |
| 311 | +.. Image:: /images/AM64_PRP_Setup.jpg |
| 312 | + :width: 400 |
| 313 | + |
| 314 | +.. rubric:: Test Procedure |
| 315 | + |
| 316 | +#. Connect the LAN cables between the DANP DUTs as shown in the setup image |
| 317 | + |
| 318 | +#. Execute the commands to setup and create PRP interface |
| 319 | + |
| 320 | + .. code-block:: console |
| 321 | +
|
| 322 | + sh prp_setup.sh prp_hw <INTF_A> <INTF_B> <PRP_INTF_IP_ADDR> |
| 323 | +
|
| 324 | +#. Confirm ping across all Nodes |
| 325 | + |
| 326 | + #. Node A < - - > Node B |
| 327 | + #. Node B < - - > Node C |
| 328 | + #. Node C < - - > Node A |
| 329 | + |
| 330 | +#. Disconnect one of the cable for a node and retry |
| 331 | + |
| 332 | +#. Monitor the CPU usage on DUTs |
| 333 | + |
| 334 | + .. code-block:: console |
| 335 | +
|
| 336 | + mpstat -P ALL 1 |
| 337 | +
|
| 338 | +#. Run iperf3 server on Node C |
| 339 | + |
| 340 | + .. code-block:: console |
| 341 | +
|
| 342 | + iperf3 -s |
| 343 | +
|
| 344 | +#. Run iperf3 client on Node A for 60 secs |
| 345 | + |
| 346 | + .. code-block:: console |
| 347 | +
|
| 348 | + iperf3 -c -t60 <Node_C_IP_Addr> |
| 349 | +
|
| 350 | +.. rubric:: Throughput at Node A |
| 351 | + |
| 352 | +.. list-table:: Throughput performance |
| 353 | + :widths: 25 25 |
| 354 | + |
| 355 | + * - Sender |
| 356 | + - Receiver |
| 357 | + * - 610 Mbits/sec |
| 358 | + - 605 Mbits/sec |
0 commit comments