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